/* Custom Design System: Antigravity News CSS System */

/* Root variables for Color Tokens */
:root {
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Georgia', serif;
    --font-display: 'Playfair Display', serif;
    
    /* Light Theme (Default) Variables */
    --bg-main: #f8fafc;
    --bg-rgb: 248, 250, 252;
    --bg-card: #ffffff;
    --bg-card-rgb: 255, 255, 255;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-invert: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.16);
    
    /* Accent Gradients */
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    --accent-color: #0284c7;
    --accent-hover: #4f46e5;
    
    /* Category Colors */
    --color-national: #a855f7;       /* Amethyst Purple */
    --color-international: #f97316;  /* Orange */
    --color-business: #f59e0b;       /* Amber */
    --color-technology: #06b6d4;     /* Cyan */
    --color-sports: #10b981;         /* Emerald Green */
    --color-entertainment: #ec4899;  /* Pink */
    --color-topstories: #ef4444;     /* Red */
    
    /* Layout Tokens */
    --max-width: 1200px;
    --header-height: 72px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables overriding Root */
[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-rgb: 11, 15, 25;
    --bg-card: #151e2e;
    --bg-card-rgb: 21, 30, 46;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-invert: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    --accent-color: #38bdf8;
    --accent-hover: #6366f1;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(56, 189, 248, 0.2);
}

/* 1. Global Reset & Boilerplate */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

input, select, textarea, button {
    font-family: inherit;
    color: inherit;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Glowing Top Bar */
.top-gradient-bar {
    height: 4px;
    background: var(--accent-gradient);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* 2. Header and Navigation */
.main-header {
    height: var(--header-height);
    background: rgba(var(--bg-rgb), 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 900;
    transition: var(--transition-smooth);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-right: 3px;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}
.nav-link:hover, .nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .nav-link:hover, [data-theme="light"] .nav-link.active {
    background: rgba(0, 0, 0, 0.04);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Search Box styling */
.search-form {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 2px 6px 2px 14px;
    width: 220px;
    transition: var(--transition-smooth);
}
[data-theme="light"] .search-form {
    background: rgba(0, 0, 0, 0.03);
}
.search-form:focus-within {
    width: 280px;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}
.search-form input {
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.85rem;
    width: 100%;
}
.search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.search-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

/* Action Buttons */
.theme-toggle, .admin-icon-btn, .mobile-menu-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: var(--transition-smooth);
}
.theme-toggle:hover, .admin-icon-btn:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}
[data-theme="light"] .theme-toggle:hover, [data-theme="light"] .admin-icon-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Moon/Sun display switch */
.sun-icon { display: block; }
.moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.mobile-menu-btn .bar {
    width: 18px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: var(--transition-smooth);
}

/* 3. Main layout & common items */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
    min-height: calc(100vh - var(--header-height) - 340px);
}

/* Category Badges */
.category-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    display: inline-block;
    color: #ffffff !important;
}

.badge-national { background-color: var(--color-national); }
.badge-international { background-color: var(--color-international); }
.badge-business { background-color: var(--color-business); }
.badge-technology { background-color: var(--color-technology); }
.badge-sports { background-color: var(--color-sports); }
.badge-entertainment { background-color: var(--color-entertainment); }
.badge-topstories { background-color: var(--color-topstories); }

/* Category tag text indicator */
.category-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 6px;
}
.tag-national { color: var(--color-national); }
.tag-international { color: var(--color-international); }
.tag-business { color: var(--color-business); }
.tag-technology { color: var(--color-technology); }
.tag-sports { color: var(--color-sports); }
.tag-entertainment { color: var(--color-entertainment); }
.tag-topstories { color: var(--color-topstories); }

/* Button designs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
}
.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}
.btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.btn-cancel:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}
.btn-full {
    width: 100%;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-gradient);
}

/* 4. Homepage styles */

/* Featured Hero Banner */
.featured-section {
    margin-bottom: 50px;
}
.featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
    transition: var(--transition-smooth);
}
.featured-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow), var(--shadow-md);
}

.featured-image-container {
    height: 480px;
    position: relative;
    overflow: hidden;
}
.featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.featured-card:hover .featured-img {
    transform: scale(1.03);
}
.featured-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0) 50%, rgba(var(--bg-card-rgb), 1) 100%);
}

.featured-info-card {
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.featured-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 15px;
    margin-bottom: 12px;
}

.featured-title {
    font-family: var(--font-display);
    font-size: 2.4rem;
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 15px;
}
.featured-title a:hover {
    color: var(--accent-color);
}

.featured-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--accent-color);
    font-size: 0.95rem;
}
.read-more-btn:hover {
    color: var(--text-main);
}
.read-more-btn svg {
    transition: transform 0.3s ease;
}
.read-more-btn:hover svg {
    transform: translateX(4px);
}

/* Trending Stories Grid */
.trending-section {
    margin-bottom: 50px;
}
.trending-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.news-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition-smooth);
}
.news-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-image-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
}
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.news-card:hover .card-img {
    transform: scale(1.05);
}
.card-image-wrapper .category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 12px;
}
.card-title a:hover {
    color: var(--accent-color);
}

.card-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

.card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}
.card-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
}
.card-link:hover {
    color: var(--text-main);
}

/* Split Layout: Categories & Sidebar Feed */
.layout-split {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 40px;
}

/* Left Stream card design */
.stream-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stream-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
    transition: var(--transition-smooth);
}
.stream-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.stream-img-wrapper {
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.stream-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stream-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.stream-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}
.stream-title a:hover {
    color: var(--accent-color);
}
.stream-excerpt {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Right Sidebar design */
.sidebar-feed {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}
.widget-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.headlines-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.headline-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}
.headline-number {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--border-hover);
    line-height: 1;
}
.headline-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-color);
    margin-bottom: 3px;
    display: inline-block;
}
.headline-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
}
.headline-title a:hover {
    color: var(--accent-color);
}
.headline-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.admin-promo-widget {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: rgba(56, 189, 248, 0.2);
}
.admin-promo-widget h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.admin-promo-widget p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* 5. Article Detail Page styling */

/* Reading progress bar */
.read-progress-bar {
    position: fixed;
    top: 4px;
    left: 0;
    height: 3px;
    background: var(--accent-gradient);
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease;
}

.article-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.article-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}
.crumb-separator {
    color: var(--border-color);
}
.crumb-active {
    color: var(--text-main);
    font-weight: 500;
}

.article-header {
    margin-bottom: 30px;
}
.article-header-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.header-source-pill {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}
[data-theme="light"] .header-source-pill {
    background: rgba(0, 0, 0, 0.03);
}

.article-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    line-height: 1.25;
    font-weight: 800;
    margin-bottom: 18px;
    letter-spacing: -0.5px;
}
.article-subtitle {
    font-size: 1.22rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.article-author-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}
.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
}
.author-name {
    font-size: 0.9rem;
}
.article-pub-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-hero-image {
    margin-bottom: 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.article-hero-image img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    display: block;
}
.image-caption {
    display: block;
    padding: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

/* Reading Body Layout */
.article-body-layout {
    position: relative;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 40px;
}

/* Floating Share Sidebar */
.share-sidebar {
    position: relative;
}
.share-sticky-group {
    position: sticky;
    top: calc(var(--header-height) + 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.share-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.share-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}
.share-circle:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.08);
}
[data-theme="light"] .share-circle:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Editorial typography for article body - Sans-Serif for a clean, modern feeling */
.article-content-rich {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--text-main);
    letter-spacing: -0.1px;
    max-width: 720px; /* Restrict max-width for comfortable reading line length */
}
.article-content-rich p {
    margin-bottom: 28px;
    opacity: 0.95; /* Subtle text-softening for eye comfort */
}
.article-content-rich h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 800;
    margin-top: 48px;
    margin-bottom: 20px;
    color: var(--text-main);
    letter-spacing: -0.5px;
    border-left: 4px solid var(--accent-color);
    padding-left: 16px;
    line-height: 1.3;
}
.article-content-rich h3 {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 36px;
    margin-bottom: 16px;
    line-height: 1.4;
}
.article-content-rich ul, .article-content-rich ol {
    margin-bottom: 28px;
    padding-left: 24px;
}
.article-content-rich li {
    margin-bottom: 12px;
    line-height: 1.8;
}
.article-content-rich strong {
    font-weight: 700;
    color: var(--text-main);
}

/* Attributions */
.original-attribution-box {
    margin: 40px 0;
    padding: 20px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    border-left: 3px solid var(--accent-color);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.original-attribution-box a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: underline;
}

.article-source-credit {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 40px;
}
.article-source-credit a {
    color: var(--accent-color);
    font-weight: 600;
}

/* Tags container */
.article-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
}
.tags-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.tag-pill {
    font-size: 0.78rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 30px;
    color: var(--text-muted);
}
.tag-pill:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Related section bottom */
.related-section {
    margin-top: 60px;
    padding-top: 50px;
    border-top: 1px solid var(--border-color);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.related-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.related-img-link {
    display: block;
    height: 140px;
    overflow: hidden;
}
.related-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.related-card:hover .related-img-link img {
    transform: scale(1.05);
}
.related-card-content {
    padding: 16px;
}
.related-card-content .category-badge {
    margin-bottom: 8px;
    font-size: 0.65rem;
}
.related-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card-title a:hover {
    color: var(--accent-color);
}
.related-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Toast confirmations */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #10b981;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}
.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 6. Admin Panel Styles */
.admin-dashboard-container {
    max-width: var(--max-width);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}
.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}
.articles-stat { background-color: var(--color-technology); }
.logs-stat { background-color: var(--color-business); }
.time-stat { background-color: var(--color-sports); }

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: block;
}
.stat-val {
    font-size: 1.6rem;
    font-weight: 700;
}

.admin-main-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    margin-bottom: 40px;
}

.admin-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
}
.admin-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.admin-alert {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
}
.warning-alert {
    background-color: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.success-alert {
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.alert-icon {
    font-size: 1.1rem;
    line-height: 1;
}

/* Admin forms formatting */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.admin-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.admin-form input, .admin-form select, .admin-form textarea {
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}
[data-theme="light"] .admin-form input, [data-theme="light"] .admin-form select, [data-theme="light"] .admin-form textarea {
    background-color: rgba(0,0,0,0.02);
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 25px 0;
}

.input-with-button {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.scraper-action-block h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.scraper-action-block p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.sync-progress-box {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: var(--radius-sm);
    background-color: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.15);
    margin-top: 15px;
    font-size: 0.85rem;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.sync-result-box {
    display: none;
    padding: 15px;
    border-radius: var(--radius-sm);
    background-color: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    margin-top: 15px;
    font-size: 0.82rem;
    line-height: 1.5;
}

/* Management Table styling */
.articles-list-card {
    margin-top: 40px;
}
.table-scroll-wrapper {
    overflow-x: auto;
    width: 100%;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}
.admin-table th {
    padding: 14px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
}
.admin-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.td-title {
    max-width: 320px;
}
.td-slug {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}
.td-actions {
    white-space: nowrap;
}
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: rgba(255,255,255,0.02);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    margin-right: 5px;
}
.action-btn:hover {
    color: var(--text-main);
    border-color: var(--border-hover);
}
.edit-btn:hover { background-color: rgba(56, 189, 248, 0.1); color: var(--accent-color); }
.delete-btn:hover { background-color: rgba(239, 68, 68, 0.1); color: var(--color-topstories); }

/* Inline editing styling */
.edit-row {
    background-color: rgba(255, 255, 255, 0.01);
}
.admin-inline-edit-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-left: 2px solid var(--accent-color);
}
.admin-inline-edit-form h3 {
    font-size: 1rem;
    font-weight: 700;
}
.edit-actions {
    display: flex;
    gap: 10px;
}

/* Simulation warning banner */
.simulation-alert {
    background-color: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-family: var(--font-sans);
}
.simulation-alert a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 600;
}

/* Zero state card styling */
.zero-state-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}
.min-height-card {
    padding: 100px 0;
}
.zero-state-card {
    max-width: 550px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 50px;
    text-align: center;
    box-shadow: var(--shadow-md);
}
.zero-state-icon {
    margin-bottom: 20px;
    color: var(--text-muted);
}
.zero-state-card h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    margin-bottom: 12px;
}
.zero-state-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}
.zero-state-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 7. Footer Style */
.main-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 0 0;
    transition: var(--transition-smooth);
}
.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr;
    gap: 60px;
}

.footer-logo {
    display: inline-block;
    margin-bottom: 20px;
}
.about-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.social-links {
    display: flex;
    gap: 12px;
}
.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.social-links a:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background-color: rgba(255,255,255,0.03);
}

.footer-col h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 10px;
}
.footer-col li a {
    font-size: 0.88rem;
    color: var(--text-muted);
}
.footer-col li a:hover {
    color: var(--text-main);
    padding-left: 4px;
}

.newsletter-col p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}
.newsletter-form {
    display: flex;
    gap: 8px;
}
.newsletter-form input {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    width: 100%;
    outline: none;
}
.newsletter-form input:focus {
    border-color: var(--accent-color);
}
.newsletter-form button {
    background: var(--accent-gradient);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.88rem;
}
.newsletter-form button:hover {
    box-shadow: var(--shadow-glow);
}
.newsletter-success {
    display: none;
    color: #10b981;
    font-size: 0.82rem;
    margin-top: 8px;
    font-weight: 600;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
}
.footer-bottom-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.footer-meta-links {
    display: flex;
    gap: 15px;
}
.footer-meta-links a:hover {
    color: var(--text-main);
}

/* 8. Responsiveness / Mobile Adaptations */
@media (max-width: 1024px) {
    .featured-card {
        grid-template-columns: 1fr;
    }
    .featured-image-container {
        height: 320px;
    }
    .featured-image-overlay {
        background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(var(--bg-card-rgb), 1) 100%);
    }
    .featured-info-card {
        padding: 30px;
    }
    .layout-split {
        grid-template-columns: 1fr;
    }
    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    .footer-col.newsletter-col {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Controlled by JS mobile menu toggle */
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }
    .nav-menu.mobile-open {
        display: flex;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .search-form {
        display: none; /* Hide standard search, or embed in mobile menu */
    }
    .trending-grid {
        grid-template-columns: 1fr;
    }
    .stream-card {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    .stream-img-wrapper {
        height: 180px;
    }
    .article-title {
        font-size: 1.85rem;
        line-height: 1.25;
        margin-bottom: 12px;
    }
    .article-subtitle {
        font-size: 1.0rem;
        line-height: 1.45;
        margin-bottom: 20px;
    }
    .article-body-layout {
        grid-template-columns: 1fr;
    }
    .article-content-rich {
        font-size: 1.02rem;
        line-height: 1.75;
    }
    .article-content-rich p {
        margin-bottom: 22px;
    }
    .article-content-rich h2 {
        font-size: 1.38rem;
        margin-top: 36px;
        margin-bottom: 14px;
        padding-left: 12px;
        border-left-width: 3px;
    }
    .article-content-rich h3 {
        font-size: 1.18rem;
        margin-top: 28px;
        margin-bottom: 10px;
    }
    .share-sidebar {
        order: 2;
    }
    .share-sticky-group {
        position: static;
        flex-direction: row;
        justify-content: center;
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        margin-top: 30px;
    }
    .share-label {
        margin-bottom: 0;
        margin-right: 15px;
    }
    .admin-main-row {
        grid-template-columns: 1fr;
    }
    .stat-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
    .footer-col.newsletter-col {
        grid-column: span 1;
    }
    .footer-bottom-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* --- 9. Audio Reader & Translation Styling --- */
.audio-translator-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 25px 0 35px 0;
    transition: var(--transition-smooth);
    flex-wrap: wrap;
}

.audio-player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    flex-wrap: wrap;
}

.audio-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    border: none;
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.audio-control-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}
.audio-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-control-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 50%;
}
[data-theme="light"] .audio-control-btn.secondary {
    background: rgba(0, 0, 0, 0.03);
}
.audio-control-btn.secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.audio-select {
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-main);
    color: var(--text-main);
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    font-weight: 500;
}
.audio-select:focus {
    border-color: var(--accent-color);
}

.audio-status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.language-dropdown-wrapper {
    display: flex;
    align-items: center;
}

/* Highlights reading text line/block */
.reading-highlight {
    background-color: rgba(56, 189, 248, 0.08) !important;
    border-left: 4px solid var(--accent-color) !important;
    padding-left: 16px !important;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    transition: var(--transition-smooth) !important;
}

/* Google Translate element premium custom overrides */
#google_translate_element {
    display: inline-block;
}
.goog-te-gadget {
    font-family: var(--font-sans) !important;
    font-size: 0.82rem !important;
    color: var(--text-muted) !important;
}
.goog-te-gadget-simple {
    background-color: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    padding: 6px 12px !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: var(--transition-smooth) !important;
}
.goog-te-gadget-simple:hover {
    border-color: var(--accent-color) !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}
[data-theme="light"] .goog-te-gadget-simple:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}
.goog-te-gadget-simple img {
    display: none !important;
}
.goog-te-gadget-simple span {
    color: var(--text-main) !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}
.goog-te-menu-value span {
    color: var(--text-main) !important;
}
.goog-te-menu-value img {
    display: none !important;
}
.goog-te-banner-frame {
    display: none !important;
}
body {
    top: 0px !important;
}

@media (max-width: 768px) {
    .audio-translator-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 12px;
    }
    .audio-player-controls {
        width: 100%;
        justify-content: flex-start;
    }
    .language-dropdown-wrapper {
        width: 100%;
        justify-content: flex-start;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
    }
}
