/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: #000000;
    overflow: hidden; /* Prevent scrolling */
    height: 100vh;
    width: 100vw;
    position: fixed;
}

.container {
    width: 100%;
    max-width: 1440px;
    padding: 30px;
    margin: 0 auto;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo img {
    max-width: 60px;
    height: auto;
    filter: invert();
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-right: 25px;
}

nav ul li a {
    text-decoration: none;
    color: #000000;
    font-size: 16px;
    font-weight: 500;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

nav ul li a:hover {
    opacity: 0.7;
}

/* Main Content Styles */
main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    flex: 1;
    overflow: hidden;
}

.left-section {
    flex: 0.35;
    position: relative;
}

.category {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #000000;
    letter-spacing: 1px;
}

h2 {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 700;
    line-height: 1.2;
    max-width: 500px;
    margin-bottom: 30px;
    color: #000000;
}

.navigation-arrows {
    position: absolute;
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.arrow, .close {
    font-size: 24px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.arrow:hover, .close:hover {
    transform: scale(1.1);
}

/* Right Section - News Container */
.right-section {
    width: 40px;
    flex: 0.4;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-container {
    width: 450px;
    height: 450px;
    padding: 20px;
    overflow-y: auto;
    border-radius: 16px;
    border: 1px solid #000000;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer and Edge */
    overflow-y: scroll;
    scroll-behavior: smooth;
    flex: 1;
}

/* Additional styles for infinite scrolling */
.scroll-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    min-height: 50px;
    width: 450px;
}

.scroll-loader .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 5px;
}

.scroll-loader p {
    font-size: 12px;
    margin: 0;
}

/* Ensure the news items look more like reels with clearer separation */
.news-item {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-item:hover {
    transform: translateY(-2px);
    
}

hr {
    border: none;
    height: 1px;
    background-color: #E0E0E0;
    margin: 15px 0;
    opacity: 0.6;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    main {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow-y: hidden;
    }
    
    .left-section, .right-section {
        flex: 0 0 auto;
        width: 100%;
    }
    
    h2 {
        font-size: clamp(30px, 4vw, 48px);
        max-width: 100%;
    }
    
    .news-container {
        width: 100%;
        max-width: 600px;
        height: 400px;
        margin: 0 auto;
    }
    
    .navigation-arrows {
        position: static;
        display: flex;
        margin-bottom: 30px;
        transform: none;
    }
    
    .arrow, .close {
        margin-right: 20px;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: row;
        align-items: center;
    }
    
    .logo {
        width: 100%;
    }
    
    nav {
        margin-top: 0;
    }
    
    nav ul {
        flex-direction: row;
    }
    
    nav ul li {
        margin-left: 20px;
        margin-bottom: 0;
    }
    
    h2 {
        font-size: clamp(24px, 3vw, 36px);
    }
    
    .news-container {
        max-width: 100%;
        height: 350px;
    }
    
    .news-item {
        flex-direction: column;
    }
    
    .thumbnail {
        width: 100%;
        height: 120px;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Additional styles for news extractor integration */

/* Source selector buttons */
.news-source-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.source-button {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #000;
    border-radius: 4px;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.source-button:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.source-button.active {
    background-color: #000;
    color: #ffffff;
}

/* Loading indicator */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* News link styles */
.news-link {
    display: inline-block;
    color: #000;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid #000;
    margin-top: 8px;
    transition: opacity 0.2s;
    padding: 10px;
    text-decoration: none;
}

.news-link:hover {
    opacity: 0.7;
}

/* Source info in articles */
.source-info {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    padding: 10px;
}

/* Error message */
.error-message {
    background-color: rgba(255, 200, 200, 0.3);
    border-left: 3px solid #ff3b30;
}

.error-details {
    font-size: 12px;
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
} 

h3,p {
    padding: 10px;
}

.content {
    border: 1px solid #000000;
    border-radius: 10px;
}

/* Update the responsive styles for very small screens */
@media (max-width: 480px) {
    .logo {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }
    
    nav ul li {
        margin-left: 10px;
    }
    
    nav ul li a {
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
    }
}