:root {
    --bg-dark: #02040a;
    --bg-card: #0f1219;
    --bg-card-hover: #1a1f2b;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #6366f1;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-color: #1e293b;
    --gradient-hero: linear-gradient(180deg, rgba(2, 4, 10, 0) 0%, rgba(2, 4, 10, 0.95) 100%);
    --gradient-blue: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --bg-card: #111;
    --border-color: #222;
}

/* Page Background Ambient Effect */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, rgba(29, 78, 216, 0.08), transparent 70%);
    pointer-events: none;
    animation: pulse-bg 10s infinite ease-in-out;
}

@keyframes pulse-bg {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: 99px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.btn-white {
    background: white;
    padding: 0 20px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

/* --- Header --- */
.bottom-nav {
    display: none;
}

header {
    background: #050505;
    /* Solid dark background for 'normal' look */
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
    /* Remove padding to let inner container handle it */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 20px;
    margin: 0 auto;
    /* Center the navigation */
}

.nav-links a {
    color: #cccccc;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
}

.header-data {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #cccccc;
    background: rgba(255, 255, 255, 0.05);
    /* Subtle background */
    padding: 6px 14px;
    border-radius: 99px;
    border: 1px solid #333;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: pulse 2s infinite;
}

.mobile-menu-btn {
    display: none;
    /* Hide on desktop by default */
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* --- Hero Section --- */
.hero-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 30px;
    height: 500px;
}

.hero-main {
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    grid-row: span 2;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.hero-sub {
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Full height to allow gradient to cover more if needed, or stick to bottom but extended */
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Align content to bottom */
    background: linear-gradient(0deg, rgba(2, 4, 10, 1) 0%, rgba(2, 4, 10, 0.95) 25%, rgba(2, 4, 10, 0.5) 60%, rgba(2, 4, 10, 0) 100%);
    z-index: 2;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
}

.hero-main:hover .hero-img,
.hero-sub:hover .hero-img {
    transform: scale(1.05);
}

.category-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tag-blue {
    color: #60a5fa;
}

.tag-purple {
    color: #c084fc;
}

.tag-cyan {
    color: #22d3ee;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.1;
    margin-bottom: 10px;
}

.sub-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    line-height: 1.3;
}

/* --- Ad Space --- */
.ad-space-lg {
    margin: 40px 0;
    height: 120px;
    border-radius: var(--card-radius);
    background: linear-gradient(45deg, #111, #1a1a1a);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ad-label {
    font-size: 0.6rem;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
    z-index: 2;
}

.ad-content {
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    z-index: 2;
}

.ad-space-lg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(94, 106, 210, 0.1), transparent 70%);
    opacity: 0.5;
    animation: rotateAd 10s linear infinite;
}

@keyframes rotateAd {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Bento Grid Layout --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.bento-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.bento-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.8);
}

.bento-img-wrap {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.bento-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.bento-item:hover .bento-img {
    transform: scale(1.1);
}

.bento-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.item-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.item-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Span classes for Bento */
.span-2 {
    grid-column: span 2;
}

.span-row-2 {
    grid-row: span 2;
}

/* --- Sidebar & Widgets --- */
.layout-split {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 40px;
}

.widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--card-radius);
    padding: 25px;
    margin-bottom: 30px;
}

.widget-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.trend-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: transform 0.2s;
}

.trend-item:hover {
    transform: translateX(5px);
}

.trend-rank {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--bg-surface-hover);
    -webkit-text-stroke: 1px var(--text-secondary);
}

.trend-info h4 {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
}

/* --- Responsive --- */
/* --- Footer --- */
footer {
    border-top: 1px solid var(--border-subtle);
    background: #020202;
    padding: 60px 0 20px 0;
    margin-top: 80px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 25px;
}

.mobile-top-ad {
    display: none;
}

/* =========================================
   Component: Widget
   ========================================= */
.footer-brand p {
    margin-top: 15px;
    max-width: 300px;
    line-height: 1.6;
    color: #666;
}

.footer-brand i {
    font-size: 1.2rem;
    color: white;
    transition: color 0.2s;
}

.footer-brand i:hover {
    color: var(--primary);
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-family: var(--font-heading);
    font-weight: 600;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.tag-red {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links {
        display: none !important;
    }

    .mobile-menu-btn {
        display: none !important;
    }

    /* Ensure Live Indicator stays on one line */
    .header-data {
        gap: 10px;
    }

    .live-indicator {
        font-size: 0.7rem;
        padding: 4px 10px;
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.08);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-brand p {
        margin: 15px auto 0;
    }

    .footer-col h4 {
        justify-content: center;
        color: var(--text-main);
        opacity: 0.9;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-bottom: 20px;
    }

    .footer-brand div {
        justify-content: center;
    }

    .layout-split {
        grid-template-columns: 1fr;
    }

    .hero-wrapper {
        grid-template-columns: 1fr;
        height: auto;
    }

    .hero-main {
        min-height: 280px;
        /* Reduced to show 2nd article */
        grid-row: span 1;
    }

    /* Mobile Ad Bar */
    .mobile-top-ad {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        background: #111;
        border: 1px dashed #333;
        padding: 5px 15px;
        margin-bottom: 20px;
        border-radius: 8px;
        font-size: 0.8rem;
        color: #888;
        height: 50px;
        width: 100%;
        box-sizing: border-box;
    }

    .mobile-top-ad .ad-badge {
        background: #333;
        color: #fff;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.6rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        z-index: 2;
        /* Ensure badge stays on top */
    }

    .mobile-top-ad p {
        z-index: 2;
        /* Ensure text stays on top */
        position: relative;
    }

    .mobile-top-ad a {
        color: var(--primary);
        text-decoration: none;
        font-weight: 600;
    }

    .hero-sub {
        min-height: 200px;
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    /* Bottom Nav Styles */
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 10000;
        /* Increased z-index */
        background: #050505;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    body {
        padding-top: 120px;
        /* Increased padding to prevent overlap */
        padding-bottom: 90px;
    }

    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        background: #050505;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    }

    .nav-item {
        color: #666;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-size: 0.7rem;
        gap: 6px;
        transition: all 0.3s;
        width: 100%;
        height: 100%;
    }

    .nav-item.active {
        color: var(--primary);
    }

    .nav-item.active i {
        transform: translateY(-2px);
    }

    .nav-item i {
        font-size: 1.3rem;
        transition: transform 0.2s;
    }
}

@media (max-width: 1024px) {
    .grid-system {
        grid-template-columns: 1fr;
    }

    .card-landscape {
        flex-direction: column;
        height: auto;
    }

    .card-landscape .card-img-wrap {
        width: 100%;
        height: 200px;
    }

    .card-landscape .card-body {
        width: 100%;
    }

    .featured-hero {
        height: 300px;
    }
}