/* ==================== ROOT VARIABLES ==================== */
:root {
    /* Dark Mode Colors */
    --bg-primary-dark: #0a0e1a;
    --bg-secondary-dark: #1a1f35;
    --bg-card-dark: #151926;
    --bg-card-hover-dark: #1e2538;
    --border-color-dark: #2a3348;
    --text-primary-dark: #ffffff;
    --text-secondary-dark: #94a3b8;
    --shadow-dark: rgba(0, 0, 0, 0.5);
    
    /* Light Mode Colors */
    --bg-primary-light: #f8fafc;
    --bg-secondary-light: #ffffff;
    --bg-card-light: #ffffff;
    --bg-card-hover-light: #f1f5f9;
    --border-color-light: #e2e8f0;
    --text-primary-light: #0f172a;
    --text-secondary-light: #64748b;
    --shadow-light: rgba(15, 23, 42, 0.1);
    
    /* Common Colors */
    --gold-primary: #f59e0b;
    --gold-secondary: #fbbf24;
    --gold-glow: rgba(245, 158, 11, 0.3);
    --silver-primary: #94a3b8;
    --silver-secondary: #cbd5e1;
    --silver-glow: rgba(148, 163, 184, 0.3);
    --success-color: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger-color: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --accent-color: #3b82f6;
    
    /* Transitions */
    --transition-speed: 0.3s;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== THEME CLASSES ==================== */
.theme-dark {
    --bg-primary: var(--bg-primary-dark);
    --bg-secondary: var(--bg-secondary-dark);
    --bg-card: var(--bg-card-dark);
    --bg-card-hover: var(--bg-card-hover-dark);
    --border-color: var(--border-color-dark);
    --text-primary: var(--text-primary-dark);
    --text-secondary: var(--text-secondary-dark);
    --shadow: var(--shadow-dark);
}

.theme-light {
    --bg-primary: var(--bg-primary-light);
    --bg-secondary: var(--bg-secondary-light);
    --bg-card: var(--bg-card-light);
    --bg-card-hover: var(--bg-card-hover-light);
    --border-color: var(--border-color-light);
    --text-primary: var(--text-primary-light);
    --text-secondary: var(--text-secondary-light);
    --shadow: var(--shadow-light);
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color var(--transition-speed) var(--transition-smooth),
                color var(--transition-speed) var(--transition-smooth);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.03;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--gold-primary) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, var(--silver-primary) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all var(--transition-speed) var(--transition-smooth);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    transition: all var(--transition-speed);
}

.navbar-brand:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.brand-accent {
    background: linear-gradient(135deg, var(--gold-primary), var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==================== THEME TOGGLE BUTTON ==================== */
.theme-toggle-btn {
    position: relative;
    width: 60px;
    height: 32px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    border-color: var(--gold-primary);
    transform: scale(1.05);
}

.theme-toggle-btn::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    border-radius: 50%;
    transition: transform var(--transition-speed) var(--transition-smooth);
    left: 4px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.theme-light .theme-toggle-btn::before {
    transform: translateX(26px);
    background: linear-gradient(135deg, var(--accent-color), var(--gold-primary));
}

.sun-icon, .moon-icon {
    font-size: 0.875rem;
    transition: all var(--transition-speed);
    z-index: 1;
}

.theme-dark .sun-icon {
    color: var(--text-secondary);
}

.theme-dark .moon-icon {
    color: var(--gold-primary);
}

.theme-light .sun-icon {
    color: var(--gold-primary);
}

.theme-light .moon-icon {
    color: var(--text-secondary);
}

/* ==================== LIVE BADGE ==================== */
.live-badge {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(220, 38, 38, 0.6);
    }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* ==================== STATS BANNER ==================== */
.stats-banner {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all var(--transition-speed) var(--transition-smooth);
}

.stats-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--shadow);
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-item i {
    font-size: 1.5rem;
    color: var(--gold-primary);
}

.stats-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--success-color);
}

.stats-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
}

/* ==================== PRICE CARDS ==================== */
.price-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s var(--transition-smooth);
    box-shadow: 0 8px 32px var(--shadow);
}

.price-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px var(--shadow);
}

/* Card Glow Effect */
.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-speed);
    pointer-events: none;
}

.price-card:hover .card-glow {
    opacity: 0.15;
}

.gold-card {
    --glow-color: var(--gold-glow);
}

.gold-card:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 20px 60px var(--shadow), 0 0 40px var(--gold-glow);
}

.silver-card {
    --glow-color: var(--silver-glow);
}

.silver-card:hover {
    border-color: var(--silver-primary);
    box-shadow: 0 20px 60px var(--shadow), 0 0 40px var(--silver-glow);
}

/* ==================== CARD HEADER ==================== */
.card-header-custom {
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-card-hover), var(--bg-card));
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.gold-card .header-left {
    color: var(--gold-primary);
}

.silver-card .header-left {
    color: var(--silver-primary);
}

.unit-badge {
    background: var(--bg-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.header-right small {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    
}

/* ==================== CARD BODY ==================== */
.card-body-custom {
    padding: 2rem 1.75rem;
}

.price-display {
    text-align: center;
    margin-bottom: 2rem;
}

.price-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1rem;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: -1px;
    transition: all var(--transition-speed);
}

.price-value:hover {
    transform: scale(1.05);
}

.change-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 13px !important;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all var(--transition-speed);
}

.text-success {
    color: var(--success-color) !important;
    background: var(--success-bg);
}

.text-danger {
    color: var(--danger-color) !important;
    background: var(--danger-bg);
}

/* ==================== PRICE STATS ==================== */
.price-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-speed);
}

.high-icon {
    background: var(--success-bg);
    color: var(--success-color);
}

.low-icon {
    background: var(--danger-bg);
    color: var(--danger-color);
}

.stat-item:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-content small {
    display: block;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background: var(--border-color);
}

/* ==================== FOOTER ==================== */
.footer-info {
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-secondary);
}

.footer-info i {
    color: var(--accent-color);
}

/* ==================== ANIMATIONS ==================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes priceFlash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: var(--gold-glow);
    }
}

.price-flash {
    animation: priceFlash 0.5s ease;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .price-value {
        font-size: 2.5rem;
    }
    
    .stats-banner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-divider {
        display: none;
    }
    
    .stats-item {
        width: 100%;
        justify-content: center;
    }
    
    .navbar-brand {
        font-size: 1.4rem;
    }
    
    .live-badge {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }
    
    .price-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-divider {
        display: none;
    }
    
    .stat-item {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 576px) {
    .theme-toggle-btn {
        width: 50px;
        height: 28px;
    }
    
    .theme-toggle-btn::before {
        width: 20px;
        height: 20px;
    }
    
    .theme-light .theme-toggle-btn::before {
        transform: translateX(20px);
    }
}