:root {
    --primary-color: #4CAF50; /* A green accent */
    --background-color: #121212;
    --surface-color: #1E1E1E;
    --text-primary: #E0E0E0;
    --text-secondary: #B0B0B0;
    --border-color: #333;
}

body {
    background-color: var(--background-color);
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    margin: 0;
    line-height: 1.6;
}

header {
    background-color: var(--surface-color);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: auto;
    height: 50px;
}

header h1 {
    color: var(--primary-color);
    margin: 0;
    font-weight: 700;
    font-size: 2rem;
}

.controls-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#search-bar {
    background-color: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    width: 250px;
    transition: all 0.3s ease;
}

#search-bar::placeholder {
    color: var(--text-secondary);
}

#search-bar:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(67, 160, 71, 0.5);
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--border-color);
}

#theme-toggle svg {
    stroke: var(--text-primary);
    transition: stroke 0.3s ease;
}

body.light-mode .moon-icon {
    display: block;
}

body.light-mode .sun-icon {
    display: none;
}

body:not(.light-mode) .moon-icon {
    display: none;
}

body:not(.light-mode) .sun-icon {
    display: block;
}

body.light-mode {
    --background-color: #F0F2F5;
    --surface-color: #FFFFFF;
    --text-primary: #1C1E21;
    --text-secondary: #606770;
    --border-color: #DADDE1;
}

main {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.news-article {
    background-color: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 2.5rem;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

.article-content {
    padding: 1.5rem 2rem;
}

.article-title {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 700;
}

.article-subtitle {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 400;
    font-style: italic;
}

.article-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    display: block;
}

.article-body {
    color: var(--text-secondary);
    font-weight: 300;
}

.article-body img {
    max-width: 500px;
    height: auto;
}

.article-body p {
    margin: 0 0 1rem 0;
}

.article-body p:last-child {
    margin-bottom: 0;
}


/* Carousel Styles */
#news-carousel {
    height: 500;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.splide__slide {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.splide__slide a {
    text-decoration: none;
    color: white;
    display: block;
}

.splide__slide img {
    display: block;
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2.5rem 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
}

.carousel-caption h3 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.carousel-caption p {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 300;
}

/* News List Styles */
#news-container > h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.news-article-list {
    background-color: var(--surface-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-article-list:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.article-link-list {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.article-image-list {
    width: 200px;
    height: 150px;
    object-fit: cover;
    flex-shrink: 0;
}

.article-content-list {
    padding: 1rem 1.5rem;
}

.article-title-list {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}
.article-subtitle-list {
    margin: 0 0 0.75rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

.article-body-list {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;  
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Article Detail Page Styles */
#article-view-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

#article-full-content {
    flex: 3; /* Takes 3/4 of the space */
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-width: 600px;
}

.article-image-full {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

#sidebar-news-list {
    flex: 1; /* Takes 1/4 of the space */
    position: sticky;
    top: 100px; /* Adjust based on header height */
    width: 250px;
}

#sidebar-news-list h4 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.sidebar-article {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: var(--surface-color);
    padding: 0.75rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: 1px solid var(--border-color);
}

.sidebar-article:hover {
    background-color: var(--border-color);
    transform: translateX(3px);
}

.sidebar-article.current-article {
    border-left: 3px solid var(--primary-color);
    background-color: rgba(76, 175, 80, 0.1);
}

.sidebar-article-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.sidebar-article-content h5 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.3;
}
.sidebar-article-content span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

@media (max-width: 960px) {
    #article-view-container {
        flex-direction: column;
    }
    #sidebar-news-list {
        position: static;
        width: 100%;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        justify-content: center;
    }

    .controls-container {
        width: 100%;
        justify-content: space-between;
    }

    #search-bar {
        width: 100%;
        flex-grow: 1;
    }

    main {
        padding: 1rem;
    }

    #news-carousel {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .splide__slide img {
        height: 300px;
    }

    .carousel-caption {
        padding: 1.5rem 1rem;
    }

    .carousel-caption h3 {
        font-size: 1.8rem;
    }

    .carousel-caption p {
        font-size: 1rem;
    }

    .article-link-list {
        flex-direction: column;
        align-items: stretch;
    }

    .article-image-list {
        width: 100%;
        height: 180px;
    }
    
    .article-image {
        height: 250px;
    }
    
    .article-content {
        padding: 1rem 1.5rem;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-subtitle {
        font-size: 1.1rem;
    }
}