/* ============================================
   MANAT.AZ — Əsas Stil
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0e1a;
    --bg-card: #111827;
    --bg-card-hover: #1a2235;
    --bg-surface: #0f172a;
    --border: #1e293b;
    --border-light: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --green: #10b981;
    --green-bg: #10b98115;
    --red: #ef4444;
    --red-bg: #ef444415;
    --gold: #fbbf24;
    --gold-bg: #fbbf2415;
    --silver: #94a3b8;
    --silver-bg: #94a3b815;
    --platinum: #a5b4fc;
    --palladium: #86efac;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(0,0,0,0.25);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.4);
    --transition: all .2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ============================================
   Header
   ============================================ */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 22px;
    color: var(--text);
}

.logo:hover { color: var(--text); }

.logo-icon {
    font-size: 36px;
    background: linear-gradient(135deg, var(--gold), #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    line-height: 1;
    position: relative;
    top: -2px;
}

.logo-text {
    font-size: 24px;
    letter-spacing: -0.5px;
}

.main-nav {
    display: flex;
    gap: 6px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--primary-light); background: rgba(99,102,241,0.1); }

.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

.header-ad, .footer-ad {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.08));
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.header-ad a, .footer-ad a {
    color: var(--primary-light);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.header-ad a:hover, .footer-ad a:hover {
    color: #fff;
}

.header-ad img, .footer-ad img {
    max-height: 50px;
    border-radius: var(--radius-sm);
    vertical-align: middle;
}

.header-ad span, .footer-ad span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.footer-ad { border-bottom: none; border-top: 1px solid var(--border); }

/* ============================================
   Hero
   ============================================ */
.hero {
    text-align: center;
    padding: 48px 0 32px;
    background: linear-gradient(180deg, rgba(99,102,241,0.06) 0%, transparent 100%);
}

.hero h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-date {
    font-size: 18px;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 4px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 15px;
}

/* ============================================
   Date Picker
   ============================================ */
.date-picker {
    padding: 20px 0;
}

.date-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.date-chip {
    padding: 8px 18px;
    border-radius: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.date-chip:hover { border-color: var(--primary); color: var(--text); }
.date-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ============================================
   Metals Section
   ============================================ */
.metals-section {
    padding: 20px 0 40px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

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

.metal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: var(--transition);
    display: block;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.metal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.metal-xau::before { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.metal-xag::before { background: linear-gradient(90deg, #94a3b8, #64748b); }
.metal-xpt::before { background: linear-gradient(90deg, #a5b4fc, #6366f1); }
.metal-xpd::before { background: linear-gradient(90deg, #86efac, #10b981); }

.metal-card:hover {
    border-color: var(--border-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.metal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.metal-icon { font-size: 32px; }

.metal-code {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface);
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
}

.metal-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.metal-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 4px;
}

.metal-value small {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.metal-nominal {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.metal-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 50px;
}

.metal-change.up { background: var(--green-bg); color: var(--green); }
.metal-change.down { background: var(--red-bg); color: var(--red); }
.metal-change.neutral { background: var(--bg-surface); color: var(--text-muted); }

.metal-change svg { flex-shrink: 0; }

/* ============================================
   Currency Table
   ============================================ */
.currencies-section {
    padding: 20px 0 60px;
}

.currency-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.currency-table {
    width: 100%;
    border-collapse: collapse;
}

.currency-table thead {
    background: var(--bg-surface);
}

.currency-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.currency-table th.th-rate,
.currency-table th.th-change {
    text-align: right;
}

.currency-row {
    border-top: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.currency-row:hover {
    background: var(--bg-card-hover);
}

.currency-table td {
    padding: 16px 20px;
    font-size: 14px;
}

.td-name {
    display: flex;
    align-items: center;
    gap: 14px;
}

.td-name .flag { font-size: 24px; }
.td-name strong { display: block; font-weight: 600; }
.td-name .cur-code { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.td-rate {
    text-align: right;
    font-weight: 700;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.td-change {
    text-align: right;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.td-change.up { color: var(--green); }
.td-change.down { color: var(--red); }
.td-change.neutral { color: var(--text-muted); }

.td-change small { font-size: 11px; color: var(--text-muted); }

.arrow-up { color: var(--green); }
.arrow-down { color: var(--red); }
.no-change { color: var(--text-muted); }

/* ============================================
   Metal/Currency Hero (Detail Pages)
   ============================================ */
.metal-hero, .currency-hero {
    padding: 48px 0;
    background: linear-gradient(180deg, rgba(99,102,241,0.06) 0%, transparent 100%);
}

.metal-hero-xau { background: linear-gradient(180deg, rgba(251,191,36,0.06) 0%, transparent 100%); }
.metal-hero-xag { background: linear-gradient(180deg, rgba(148,163,184,0.06) 0%, transparent 100%); }
.metal-hero-xpt { background: linear-gradient(180deg, rgba(165,180,252,0.06) 0%, transparent 100%); }
.metal-hero-xpd { background: linear-gradient(180deg, rgba(134,239,172,0.06) 0%, transparent 100%); }

.metal-hero-inner, .currency-hero-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.metal-hero-icon, .currency-hero-icon {
    font-size: 64px;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.metal-hero-info, .currency-hero-info {
    flex: 1;
    min-width: 200px;
}

.metal-hero-info h1, .currency-hero-info h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.metal-hero-code, .currency-hero-code {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.metal-hero-date, .currency-hero-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.metal-hero-price, .currency-hero-price {
    text-align: right;
    min-width: 200px;
}

.price-value {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
}

.price-currency {
    font-size: 18px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.price-nominal {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.price-change {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
}

.price-change.up { background: var(--green-bg); color: var(--green); }
.price-change.down { background: var(--red-bg); color: var(--red); }
.price-change.neutral { background: var(--bg-surface); color: var(--text-muted); }

/* ============================================
   Info Section
   ============================================ */
.metal-info-section, .currency-info-section {
    padding: 40px 0;
}

.metal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.metal-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.metal-info-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.metal-info-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

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

.info-row:last-child { border-bottom: none; }
.info-row span { color: var(--text-muted); font-size: 14px; }
.info-row strong { font-size: 15px; }
.info-row.highlight { background: rgba(99,102,241,0.08); margin: 0 -16px; padding: 14px 16px; border-radius: var(--radius-sm); }

/* ============================================
   Other Metals
   ============================================ */
.other-metals {
    padding: 40px 0 60px;
}

/* ============================================
   About
   ============================================ */
.about-section {
    padding: 40px 0 60px;
}

.about-content {
    max-width: 700px;
}

.about-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 12px;
}

.about-content h2:first-child { margin-top: 0; }

.about-content p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-content ul {
    list-style: none;
    margin: 16px 0;
}

.about-content li {
    padding: 8px 0 8px 28px;
    position: relative;
    color: var(--text-secondary);
}

.about-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   Error Box
   ============================================ */
.error-box {
    background: var(--red-bg);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    color: var(--red);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .metals-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 20px;
        gap: 4px;
    }

    .main-nav.open { display: flex; }

    .mobile-toggle { display: flex; }

    .mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

    .hero h1 { font-size: 28px; }
    .metals-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .metal-card { padding: 20px 16px; }
    .metal-value { font-size: 20px; }

    .metal-hero-inner, .currency-hero-inner { flex-direction: column; text-align: center; }
    .metal-hero-price, .currency-hero-price { text-align: center; }
    .metal-info-grid { grid-template-columns: 1fr; }

    .currency-table th { padding: 12px 14px; font-size: 11px; }
    .currency-table td { padding: 12px 14px; }
    .td-name .flag { font-size: 20px; }

    .footer-grid { grid-template-columns: 1fr; gap: 30px; }

    .date-nav { gap: 6px; }
    .date-chip { padding: 6px 14px; font-size: 13px; }

    .price-value { font-size: 32px; }
}

@media (max-width: 480px) {
    .metals-grid { grid-template-columns: 1fr; }
    .metal-value { font-size: 22px; }
    .hero { padding: 32px 0 24px; }
    .hero h1 { font-size: 24px; }
}
