/* Hệ thống bảng màu Premium Dark & Semantic Colors */
:root {
    --bg-global: #0b0f19;       /* Nền tối chủ đạo */
    --bg-card: #151c2c;         /* Nền của các mảng khối */
    --bg-card-hover: #1e2638;   /* Nền thẻ khi di chuột vào */
    
    /* Hệ màu chuẩn tín hiệu tài chính */
    --color-grow: #22c55e;      /* Xanh lục cho TĂNG TRƯỞNG */
    --color-drop: #ef4444;      /* Đỏ cho GIẢM / THẮT CHẶT */
    --gold-accent: #f59e0b;     /* Vàng kim sang trọng cho Tiêu đề/Badge */
    --gold-light: rgba(245, 158, 11, 0.1);
    
    --text-main: #e2e8f0;       /* Màu chữ chính */
    --text-muted: #94a3b8;      /* Màu chữ phụ */
    
    --font-serif: 'Merriweather', Georgia, serif;
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-global);
    color: var(--text-main);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* Header dạng e-Magazine đồ sộ */
.magazine-hero {
    position: relative;
    background-image: url('https://bcp.cdnchinhphu.vn/thumb_w/777/334894974524682240/2023/11/25/dat-trong-lua-17008865775781672667035.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 70vh;
    display: flex;
    align-items: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(11, 15, 25, 0.3), rgba(11, 15, 25, 0.95));
}

.hero-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
    z-index: 2;
}

.magazine-tag {
    background-color: var(--gold-accent);
    color: #0b0f19;
    padding: 6px 16px;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 4px;
}

.magazine-title {
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 1.2;
    margin-top: 20px;
    margin-bottom: 15px;
    font-weight: 700;
    color: #ffffff;
}

.magazine-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 20px;
}

/* Thân bài viết */
.magazine-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Khối Sapo chuyển sang mảng màu xám đá */
.overview-section {
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.sapo-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-top: 4px solid var(--gold-accent);
}

.sapo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.7;
    color: #ffffff;
}

/* Các thẻ số liệu tài chính */
.metrics-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.metric-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    text-align: center;
    border: 1px solid #1e293b;
    transition: transform 0.3s, border-color 0.3s;
}

.metric-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-accent);
}

.metric-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.metric-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
}

/* ĐỒNG NHẤT MÀU XANH / ĐỎ TÍN HIỆU */
.metric-trend {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.metric-trend.up { 
    background: rgba(34, 197, 94, 0.15); 
    color: var(--color-grow); 
}
.metric-trend.down { 
    background: rgba(239, 68, 68, 0.15); 
    color: var(--color-drop); 
}

/* Tiêu đề các mục lớn */
.section-header {
    text-align: center;
    margin: 60px 0 35px 0;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: #ffffff;
}

.line-decorator {
    width: 80px;
    height: 3px;
    background-color: var(--gold-accent);
    margin: 14px auto 0 auto;
}

/* Thanh điều hướng Tabs */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 2px solid #1e293b;
    padding-bottom: 12px;
    overflow-x: auto;
}

.nav-btn {
    background: transparent;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 6px;
}

.nav-btn:hover, .nav-btn.active {
    color: var(--gold-accent);
    background-color: var(--gold-light);
}

/* Panel hiển thị nội dung từng quốc gia */
.market-panel {
    display: none;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    border: 1px solid #1e293b;
    animation: slideUp 0.4s ease-out;
}

.market-panel.active { display: block; }

.panel-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}

/* Đồng bộ tín hiệu trong Tabs điều hướng */
#phil .market-rank { color: var(--color-drop); }
#china .market-rank { color: var(--color-grow); }
#ghana .market-rank { color: var(--text-muted); }
#ivory .market-rank { color: var(--color-drop); }
#malay .market-rank { color: var(--color-grow); }

.market-rank {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
}

.panel-info h3 {
    font-size: 1.8rem;
    color: #ffffff;
    margin: 6px 0 20px 0;
}

.panel-stats {
    background: #1e293b;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    border-left: 4px solid var(--gold-accent);
}

.panel-stats div { margin-bottom: 8px; color: #f1f5f9; }
.panel-stats div:last-child { margin-bottom: 0; }

.panel-info p {
    color: var(--text-muted);
    font-size: 15.5px;
    line-height: 1.7;
}

.panel-media img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    filter: brightness(0.9);
}

/* Grid hiển thị 3 thị trường đột biến */
.magazine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.mag-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: all 0.3s;
    border: 1px solid #1e293b;
}

.mag-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    background-color: var(--bg-card-hover);
    border-color: #334155;
}

.mag-img-container {
    position: relative;
    overflow: hidden;
}

.mag-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s;
    filter: brightness(0.85);
}

.mag-card:hover img {
    transform: scale(1.05);
    filter: brightness(1);
}

/* Badge tăng trưởng dùng sắc XANH LỤC đồng bộ */
.mag-badge-growth {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--color-grow);
    color: #0b0f19;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
}

/* Khối dự báo */
.forecast-block {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 50px;
    border-radius: 16px;
    margin: 60px 0;
    text-align: center;
    border: 1px solid #1e293b;
    background-image: radial-gradient(circle at top right, rgba(245, 158, 11, 0.08), transparent);
}

.forecast-block h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 16px;
}

.forecast-block p {
    max-width: 850px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-muted);
}

.magazine-footer {
    background: #070a12;
    color: #475569;
    text-align: center;
    padding: 40px;
    font-size: 13px;
    border-top: 1px solid #1e293b;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .panel-layout { grid-template-columns: 1fr; gap: 25px; }
    .magazine-title { font-size: 2.2rem; }
    .sapo-container { padding: 25px; }
}