/* ========== RESET & VARIABLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #0F172A;
    --dark-navy: #162033;
    --cyan: #0EA5C6;
    --cyan-dark: #0891B2;
    --white: #FFFFFF;
    --gray-100: #F8FAFC;
    --gray-200: #E5E7EB;
    --gray-300: #CBD5E1;
    --gray-700: #334155;
    --green: #10B981;
    --red: #EF4444;
    
    --bg-primary: var(--white);
    --bg-secondary: var(--gray-100);
    --text-primary: var(--navy);
    --text-secondary: var(--gray-700);
    --text-muted: #64748B;
    --border: var(--gray-200);
    --card-bg: var(--white);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, Helvetica, sans-serif;
    --header-height: 72px;
    --container-width: 1440px;
    --radius: 16px;
    --transition: 0.2s;
}

body.dark {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --border: #334155;
    --card-bg: #1E293B;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background var(--transition), color var(--transition);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== TYPOGRAPHY ========== */
h1, .h1 { font-size: 52px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2, .h2 { font-size: 34px; font-weight: 700; line-height: 1.3; }
h3, .h3 { font-size: 24px; font-weight: 700; line-height: 1.4; }
body, p { font-size: 16px; font-weight: 400; line-height: 1.6; }
.meta { font-size: 13px; font-weight: 400; color: var(--text-muted); }

/* ========== MÀU GIÁ CẢ ========== */
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.neutral { color: var(--cyan) !important; }

/* ========== HEADER ========== */
.header {
    background: linear-gradient(135deg, #081B33 0%, #102B4A 100%);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 40px;
}

/* Logo */
.logo__text {
    font-size: 42px;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -1px;
}

.logo__text sup {
    color: var(--cyan);
    font-size: 24px;
}

.logo__tagline {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-top: -4px;
}

/* Desktop Menu */
.nav-desktop {
    flex: 1;
}

.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-menu > li > a {
    text-decoration: none;
    color: var(--white);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 0;
    transition: color var(--transition);
}

.nav-menu > li > a:hover {
    color: var(--cyan);
}

.nav-menu > li > a.active {
    border-bottom: 3px solid var(--cyan);
    padding-bottom: 5px;
}

.has-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    z-index: 200;
    list-style: none;
    padding: 8px 0;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
}

.dropdown li a:hover {
    background: var(--bg-secondary);
    color: var(--cyan);
}

/* Header Actions */
.header__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-toggle, .theme-toggle, .login-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--white);
    font-size: 16px;
    padding: 8px 12px;
    border-radius: 999px;
    transition: background var(--transition);
}

.login-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-toggle:hover, .theme-toggle:hover, .login-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
}

/* Mobile Navigation */
.nav-mobile {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--navy);
}

.nav-mobile__scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 12px 20px;
}

.nav-mobile__scroll a {
    text-decoration: none;
    color: var(--white);
    font-size: 14px;
    white-space: nowrap;
}

/* ========== DRAWER ========== */
.drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-primary);
    z-index: 200;
    transition: left 0.3s;
    display: flex;
    flex-direction: column;
}

.drawer.open { left: 0; }

.drawer__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.drawer__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.drawer__nav {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer__nav a {
    text-decoration: none;
    color: var(--text-primary);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.drawer__footer {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    display: none;
}

.drawer-overlay.active { display: block; }

/* ========== MARKET TICKER ========== */
.market-ticker {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    height: 44px;
    overflow-x: auto;
    scrollbar-width: none;
    display: flex;
    align-items: center;
}

.ticker-scroll {
    display: flex;
    gap: 32px;
    padding: 0 24px;
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
}

.ticker-scroll:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ========== HERO GRID (44% + 26% + 30%) ========== */
.hero-grid {
    display: grid;
    grid-template-columns: 44% 26% 30%;
    gap: 24px;
    margin: 40px 0 48px;
}

.hero-image-wrapper {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s;
}

.hero-image-wrapper:hover .hero-image {
    transform: scale(1.03);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: var(--white);
}

.hero-tag {
    background: var(--cyan);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.3;
}

.hero-desc {
    font-size: 14px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.hero-meta {
    font-size: 12px;
    opacity: 0.7;
}

/* Tin phụ (26%) */
.sub-item {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    align-items: center;
}

.sub-img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
}

.sub-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}

.sub-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Market Today (30%) */
.hero-market {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.market-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cyan);
    display: inline-block;
}

.market-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.market-tab {
    background: none;
    border: none;
    padding: 4px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
}

.market-tab.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

.market-chart canvas {
    width: 100%;
    height: auto;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 16px;
}

.market-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.market-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.market-detail {
    width: 100%;
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cyan);
    cursor: pointer;
    transition: all var(--transition);
}

.market-detail:hover {
    background: var(--cyan);
    color: var(--white);
    border-color: var(--cyan);
}

/* ========== FEATURED GRID (4 cards) ========== */
.section {
    margin-bottom: 48px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cyan);
    display: inline-block;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.15);
}

.card-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.card-body {
    padding: 16px;
}

.card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========== TWO COLUMNS ========== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    margin-bottom: 48px;
}

/* Tin mới nhất */
.feed-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.feed-tab {
    background: none;
    border: none;
    padding: 6px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.feed-tab.active {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feed-item {
    display: flex;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.feed-img {
    width: 160px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
}

.feed-content {
    flex: 1;
}

.feed-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.feed-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.feed-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.view-more {
    margin-top: 20px;
    text-align: right;
}

.view-more a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 500;
}

/* Bài được quan tâm */
.trending-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    align-self: start;
}

.trending-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cyan);
    display: inline-block;
}

.trending-list {
    list-style: none;
    counter-reset: trending;
}

.trending-item {
    counter-increment: trending;
    margin-bottom: 16px;
    padding-left: 32px;
    position: relative;
}

.trending-item::before {
    content: counter(trending);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    background: var(--cyan);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.trending-item a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.trending-item a:hover {
    color: var(--cyan);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--navy);
    color: var(--white);
    padding: 64px 0 32px;
    margin-top: 48px;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 48px;
}

.footer__col h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer__col p, .footer__col li {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.footer__col ul {
    list-style: none;
}

.footer__col li {
    margin-bottom: 10px;
}

.footer__col a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
}

.footer__col a:hover {
    color: var(--cyan);
}

.footer__copyright {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__disclaimer {
    font-size: 11px;
    margin-top: 8px;
}

/* ========== BOTTOM NAV (MOBILE) ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--navy);
    display: none;
    justify-content: space-around;
    padding: 8px 16px 20px;
    z-index: 99;
}

.bottom-nav__item {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
}

.bottom-nav__item.active,
.bottom-nav__item:hover {
    color: var(--cyan);
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cyan);
    color: var(--white);
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    z-index: 98;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-desktop, .header__actions .search-toggle, .header__actions .login-btn {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-mobile {
        display: block;
    }
    
    .bottom-nav {
        display: flex;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .two-columns {
        grid-template-columns: 1fr;
    }
    
    .footer__grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .hero-title {
        font-size: 22px;
    }
    
    .sub-item {
        flex-direction: column;
        text-align: center;
    }
    
    .sub-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .feed-item {
        flex-direction: column;
    }
    
    .feed-img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    body {
        padding-bottom: 70px;
    }
}