/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    background-color: #0d1117;
    color: #f0f6fc;
}

/* Header Styles */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease;
}

body.dark-mode .header {
    background-color: #161b22;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    text-align: left;
}

.site-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-decoration: none;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffecd2);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
    position: relative;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

body.dark-mode .site-title {
    background: linear-gradient(135deg, #ff8a80, #64ffda, #40c4ff, #b39ddb, #ffcc02);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
}

.site-tagline {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0;
    font-weight: 400;
}

body.dark-mode .site-tagline {
    color: #8b949e;
}

/* Theme Switch - Simplified Icon Only */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-icon {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.05);
}

.theme-icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

body.dark-mode .theme-icon {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .theme-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Hide the old toggle switch */
.theme-switch {
    display: none;
}

/* Navigation */
.navigation {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
}

body.dark-mode .navigation {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-btn:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.nav-btn.active {
    background-color: #0d6efd;
    color: white;
}

body.dark-mode .nav-btn {
    color: #8b949e;
}

body.dark-mode .nav-btn:hover {
    background-color: #21262d;
    color: #f0f6fc;
}

body.dark-mode .nav-btn.active {
    background-color: #1f6feb;
    color: white;
}

/* Loading */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

body.dark-mode .loading-container {
    color: #8b949e;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

body.dark-mode .loading-spinner {
    border: 3px solid #30363d;
    border-top: 3px solid #58a6ff;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

body.dark-mode .welcome-message {
    background-color: #161b22;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.welcome-message h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
}

body.dark-mode .welcome-message h2 {
    color: #f0f6fc;
}

.welcome-message p {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

body.dark-mode .welcome-message p {
    color: #8b949e;
}

/* News Grid */
.news-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

/* News Cards */
.news-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

body.dark-mode .news-card {
    background-color: #161b22;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .news-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.news-card.featured {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.news-card.featured::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.news-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.news-card.featured .news-content {
    padding: 3rem 2rem;
}

/* News Meta */
.news-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.news-category {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-mode .news-category {
    background-color: #30363d;
    color: #f0f6fc;
}

.news-card.featured .news-category {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.featured-badge {
    background-color: #ffc107;
    color: #000;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* News Title */
.news-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.news-card.featured .news-title {
    font-size: 2rem;
    color: white;
    margin-bottom: 1.5rem;
}

body.dark-mode .news-title {
    color: #f0f6fc;
}

/* News Summary */
.news-summary {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.news-card.featured .news-summary {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

body.dark-mode .news-summary {
    color: #8b949e;
}

/* News Footer */
.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.875rem;
}

body.dark-mode .news-footer {
    border-top: 1px solid #30363d;
}

.news-card.featured .news-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.news-source {
    font-weight: 600;
    color: #0d6efd;
}

.news-card.featured .news-source {
    color: white;
}

body.dark-mode .news-source {
    color: #58a6ff;
}

.news-date {
    color: #6c757d;
    font-style: italic;
}

.news-card.featured .news-date {
    color: rgba(255, 255, 255, 0.7);
}

body.dark-mode .news-date {
    color: #8b949e;
}

/* No News */
.no-news {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
    font-style: italic;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-mode .no-news {
    color: #8b949e;
    background-color: #161b22;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top: 4rem;
    padding: 2rem 0;
}

body.dark-mode .footer {
    background-color: #0d1117;
    border-top: 1px solid #30363d;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
}

body.dark-mode .footer-content {
    color: #8b949e;
}

.last-updated {
    margin-top: 0.5rem;
    font-style: italic;
}

/* Responsive Design */
@media (min-width: 768px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-content {
        padding: 1.5rem 2rem;
    }
    
    .nav-content {
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-card.featured {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .logo-section {
        text-align: left;
        flex: 1;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-tagline {
        font-size: 0.8rem;
    }
    
    .theme-switch-wrapper {
        flex-shrink: 0;
    }
    
    .nav-content {
        padding: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-categories {
        display: flex;
        gap: 0.5rem;
        min-width: max-content;
        padding-bottom: 0.5rem;
    }
    
    .nav-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Custom scrollbar for nav */
    .nav-content::-webkit-scrollbar {
        height: 4px;
    }
    
    .nav-content::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    body.dark-mode .nav-content::-webkit-scrollbar-track {
        background: #30363d;
    }
    
    .nav-content::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    body.dark-mode .nav-content::-webkit-scrollbar-thumb {
        background: #6e7681;
    }
    
    .nav-content::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
    
    body.dark-mode .nav-content::-webkit-scrollbar-thumb:hover {
        background: #8b949e;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .news-content {
        padding: 1.5rem;
    }
    
    .news-card.featured .news-content {
        padding: 2rem 1.5rem;
    }
    
    .news-title {
        font-size: 1.25rem;
    }
    
    .news-card.featured .news-title {
        font-size: 1.75rem;
    }
    
    .welcome-message h2 {
        font-size: 2rem;
    }
    
    .welcome-message {
        padding: 2rem 1rem;
    }
}