:root {
    /* Color Palette - Premium Dark Gold Theme (Default) */
    --bg-dark: #0f1115;
    --bg-darker: #090a0c;
    --panel-bg: rgba(26, 29, 36, 0.7);
    --panel-border: rgba(255, 215, 0, 0.1);
    
    --gold-primary: #ffd700;
    --gold-light: #ffeba8;
    --gold-dark: #d4af37;
    --gold-glow: rgba(255, 215, 0, 0.15);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a5b1;
    --text-muted: #6b7280;
    
    --success: #10b981;
    
    /* Typography */
    --font-main: 'Outfit', sans-serif;
    
    /* Shadows & Transitions */
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    /* Light Theme */
    --bg-dark: #f8fafc;
    --bg-darker: #ffffff;
    --panel-bg: rgba(255, 255, 255, 0.95);
    --panel-border: rgba(0, 0, 0, 0.1);
    
    --gold-primary: #d97706; /* Darker gold for light mode */
    --gold-light: #f59e0b;
    --gold-dark: #b45309;
    --gold-glow: rgba(217, 119, 6, 0.15);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Effects */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(20, 25, 35, 0.8) 0%, transparent 70%);
}

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

/* Navigation */
.navbar {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo i {
    color: var(--gold-primary);
}

.logo .highlight {
    color: var(--gold-primary);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--gold-primary);
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    margin-left: 10px;
}

.theme-btn:hover {
    color: var(--gold-primary);
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 60px 0;
}

.hero-content h1 {
    font-size: 48px;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 90%;
}

.last-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.hero-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary));
}

.hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.1);
}

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

.card-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge:not(.live-badge) {
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold-primary);
    margin-left: 10px;
}

.card-price {
    font-size: 56px;
    font-weight: 700;
    color: var(--gold-primary);
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.card-price .currency {
    font-size: 24px;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    box-shadow: var(--shadow-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 30px;
    margin-bottom: 40px;
}

.section-title {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Rates Table */
.table-container {
    overflow-x: auto;
}

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

.rates-table th, .rates-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.rates-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rates-table tr:last-child td {
    border-bottom: none;
}

.history-table {
    font-size: 14px;
}

.history-table th {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .history-table th {
    background: rgba(0, 0, 0, 0.03);
}

.history-table td, .history-table th {
    text-align: center;
}

.history-table td:first-child, .history-table th:first-child {
    text-align: left;
}

.rates-table tbody tr {
    transition: var(--transition);
}

.rates-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.rates-table .highlight-row td {
    background: rgba(255, 215, 0, 0.03);
}

.unit-name {
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.text-right {
    text-align: right !important;
}

.font-bold {
    font-weight: 600;
    font-size: 18px;
}

.text-gold {
    color: var(--gold-light);
}

/* Calculator */
.calc-header {
    text-align: center;
    margin-bottom: 30px;
}

.calc-header h2 {
    color: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.calc-header p {
    color: var(--text-secondary);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.input-group.full-width {
    grid-column: 1 / -1;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.custom-select, .input-group input {
    position: relative;
    width: 100%;
}

.input-group select, .input-group input {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    appearance: none;
}

.input-group select:focus, .input-group input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.1);
}

.select-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.calc-result {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    border: 1px dashed rgba(255, 215, 0, 0.2);
}

.result-label {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 10px;
}

.result-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--gold-primary);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.result-value .currency {
    font-size: 20px;
    color: var(--text-secondary);
}

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

/* Info Section */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 215, 0, 0.1);
    color: var(--gold-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.info-item h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.info-item p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 215, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--gold-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 40px 0;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content p {
        max-width: 100%;
    }

    .last-updated {
        margin: 0 auto;
    }

    .calc-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .card-price {
        font-size: 42px;
        justify-content: center;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
    }
}
