/* ============================================
   CryptoHub - Main Stylesheet v2.1
   Fixed & Enhanced Version
   ============================================ */

/* CSS Variables */
:root {
    --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

/* Dark Theme - Default */
[data-theme="dark"] {
    --primary-bg: #0a0e1a;
    --primary-bg-alt: #0d1321;
    --secondary-bg: #111827;
    --tertiary-bg: #0f1626;
    --card-bg: #1a2235;
    --card-bg-alt: #1e2842;
    --card-hover: #222d47;
    --surface: #151c2e;
    --surface-alt: #1c2438;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f0f4fc;
    --text-secondary: #a0aec0;
    --text-muted: #6b7a99;
    --text-inverted: #0a0e1a;
    
    --gold: #f7931a;
    --gold-hover: #ffaa3f;
    --gold-dark: #d97f0e;
    --blue: #00d4ff;
    --blue-hover: #33e0ff;
    --blue-dark: #00a8cc;
    --purple: #a855f7;
    --purple-dark: #7c3aed;
    --green: #22c55e;
    --green-dark: #16a34a;
    --red: #ef4444;
    --red-dark: #dc2626;
    --yellow: #eab308;
    --cyan: #06b6d4;
    --pink: #ec4899;
    
    --gradient-gold: linear-gradient(135deg, #f7931a 0%, #ffb84d 100%);
    --gradient-blue: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%);
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    
    --glow-gold: 0 0 20px rgba(247, 147, 26, 0.4), 0 0 40px rgba(247, 147, 26, 0.2);
    --glow-blue: 0 0 20px rgba(0, 212, 255, 0.4), 0 0 40px rgba(0, 212, 255, 0.2);
    
    --nav-bg: rgba(13, 19, 33, 0.85);
    --nav-bg-solid: #0d1321;
    
    --success-bg: rgba(34, 197, 94, 0.12);
    --success-border: rgba(34, 197, 94, 0.4);
    --success-text: #86efac;
    
    --error-bg: rgba(239, 68, 68, 0.12);
    --error-border: rgba(239, 68, 68, 0.4);
    --error-text: #fecaca;
    
    --warning-bg: rgba(234, 179, 8, 0.12);
    --warning-border: rgba(234, 179, 8, 0.4);
    --warning-text: #fde047;
    
    --info-bg: rgba(6, 182, 212, 0.12);
    --info-border: rgba(6, 182, 212, 0.4);
    --info-text: #67e8f9;
}

/* Light Theme */
[data-theme="light"] {
    --primary-bg: #f8fafc;
    --primary-bg-alt: #f1f5f9;
    --secondary-bg: #ffffff;
    --tertiary-bg: #eef2f7;
    --card-bg: #ffffff;
    --card-bg-alt: #fafbfc;
    --card-hover: #f1f5f9;
    --surface: #f1f5f9;
    --surface-alt: #e8edf4;
    --border-color: rgba(15, 23, 42, 0.1);
    --border-strong: rgba(15, 23, 42, 0.15);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverted: #f8fafc;
    
    --gold: #ea580c;
    --gold-hover: #f97316;
    --gold-dark: #c2410c;
    --blue: #0891b2;
    --blue-hover: #06b6d4;
    --blue-dark: #0e7490;
    --purple: #9333ea;
    --purple-dark: #7c3aed;
    --green: #16a34a;
    --green-dark: #15803d;
    --red: #dc2626;
    --red-dark: #b91c1c;
    --yellow: #ca8a04;
    --cyan: #0891b2;
    --pink: #db2777;
    
    --gradient-gold: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
    --gradient-blue: linear-gradient(135deg, #0891b2 0%, #7c3aed 100%);
    --gradient-purple: linear-gradient(135deg, #9333ea 0%, #db2777 100%);
    
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 10px 10px -5px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
    
    --glow-gold: 0 0 20px rgba(234, 88, 12, 0.25), 0 0 40px rgba(234, 88, 12, 0.15);
    --glow-blue: 0 0 20px rgba(8, 145, 178, 0.25), 0 0 40px rgba(8, 145, 178, 0.15);
    
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-bg-solid: #ffffff;
    
    --success-bg: rgba(22, 163, 74, 0.08);
    --success-border: rgba(22, 163, 74, 0.35);
    --success-text: #166534;
    
    --error-bg: rgba(220, 38, 38, 0.08);
    --error-border: rgba(220, 38, 38, 0.35);
    --error-text: #991b1b;
    
    --warning-bg: rgba(202, 138, 4, 0.08);
    --warning-border: rgba(202, 138, 4, 0.35);
    --warning-text: #854d0e;
    
    --info-bg: rgba(8, 145, 178, 0.08);
    --info-border: rgba(8, 145, 178, 0.35);
    --info-text: #155e75;
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 800px 400px at 80% -10%, rgba(247, 147, 26, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 600px 400px at 20% 10%, rgba(0, 212, 255, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 800px 400px at 80% -10%, rgba(234, 88, 12, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 600px 400px at 20% 10%, rgba(8, 145, 178, 0.04) 0%, transparent 60%);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
    background: transparent;
    color: var(--text-primary);
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* Skip Link (Accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--gold);
    color: var(--text-inverted);
    padding: 12px 24px;
    z-index: 10000;
    border-radius: 0 0 var(--radius-md) 0;
    font-weight: 600;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
}

/* ============================================
   Typography
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hover) 50%, var(--purple) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s ease-in-out infinite;
}

.section-header { text-align: center; margin-bottom: 60px; position: relative; }

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.12), rgba(168, 85, 247, 0.12));
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 16px;
    backdrop-filter: blur(8px);
}

.section-badge i { font-size: 1rem; }

.section-title {
    font-size: clamp(1.75rem, 4.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 14px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
}

.section-padding { padding: 100px 0; position: relative; }

.section-cta { text-align: center; margin-top: 48px; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    border: none;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    text-align: center;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(100%);
    transition: transform var(--transition);
    z-index: -1;
}

.btn:hover::before { transform: translateY(0); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn-gold {
    background: var(--gradient-gold);
    color: var(--text-inverted);
    box-shadow: var(--glow-gold);
    font-weight: 700;
}

.btn-gold:hover {
    box-shadow: var(--shadow-lg), var(--glow-gold);
}

.btn-blue {
    background: var(--gradient-blue);
    color: #fff;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
    font-weight: 700;
}

.btn-purple {
    background: var(--gradient-purple);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.btn-outline:hover {
    background: var(--gold);
    color: var(--text-inverted);
    box-shadow: var(--glow-gold);
}

.btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #fff;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .btn-outline-light {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

[data-theme="light"] .btn-outline-light:hover {
    background: var(--text-primary);
    color: var(--text-inverted);
}

.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--card-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-danger {
    background: var(--red);
    color: #fff;
    font-weight: 600;
}

.btn-danger:hover {
    background: var(--red-dark);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: var(--green);
    color: #fff;
    font-weight: 600;
}

.btn-success:hover {
    background: var(--green-dark);
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
}

.btn i { font-size: 1.15em; transition: transform var(--transition); }
.btn:hover i { transform: scale(1.1); }

.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-xs { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition);
}

.navbar.scrolled {
    background: var(--nav-bg-solid);
    box-shadow: var(--shadow-md);
    border-bottom-color: transparent;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

/* Logo */
.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    z-index: 1001;
}

.logo-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.logo-icon {
    font-size: 1.6rem;
    background: var(--gradient-gold);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    z-index: 1;
}

.logo-glow {
    position: absolute;
    inset: 0;
    background: var(--gradient-gold);
    border-radius: 50%;
    filter: blur(14px);
    opacity: 0.4;
    animation: logoPulse 3s ease-in-out infinite;
}

.logo-text {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 800;
}

.navbar-logo:hover .logo-text { color: var(--gold); }
.navbar-logo:hover .logo-icon { animation: coinSpin 0.8s var(--bounce); }

/* Nav Menu */
.navbar-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-menu li { display: inline-flex; align-items: center; }
.nav-cta { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: 8px; }

.navbar-menu li > a:not(.btn) {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.92rem;
    position: relative;
    transition: all var(--transition);
}

.navbar-menu li > a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--gradient-gold);
    border-radius: var(--radius-full);
    transform: scaleX(0);
    transition: transform var(--transition);
}

.navbar-menu li > a:not(.btn):hover::after,
.navbar-menu li > a.active::after { transform: scaleX(1); }
.navbar-menu li > a:hover, .navbar-menu li > a.active { color: var(--text-primary); }

.navbar-menu li > a:not(.btn) i {
    font-size: 1.15em;
    transition: color var(--transition);
}

.navbar-menu li > a:not(.btn):hover i,
.navbar-menu li > a.active i { color: var(--gold); }

.navbar-menu li > a:not(.btn):hover { background: var(--surface); }
.navbar-menu li > a.active { 
    background: linear-gradient(135deg, rgba(247,147,26,.12), rgba(168,85,247,.08)); 
    color: var(--text-primary); 
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.theme-toggle:hover {
    color: var(--gold);
    transform: rotate(15deg) scale(1.05);
    border-color: var(--gold);
    box-shadow: var(--glow-gold);
}

[data-theme="dark"] .theme-icon-light { display: block; }
[data-theme="dark"] .theme-icon-dark { display: none; }
[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: block; }

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    gap: 5px;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    z-index: 1001;
    padding: 0;
}

.navbar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
    transform-origin: center;
}

.navbar-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition);
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Menu */
@media (max-width: 1024px) {
    .navbar-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(85vw, 320px);
        height: 100vh;
        background: var(--nav-bg-solid);
        flex-direction: column;
        align-items: stretch;
        padding: 90px 20px 20px;
        gap: 4px;
        overflow-y: auto;
        border-inline-start: 1px solid var(--border-color);
        transition: right var(--transition);
        z-index: 1000;
        box-shadow: var(--shadow-xl);
    }
    
    .navbar-menu.open { right: 0; }
    
    .navbar-menu li { display: block; width: 100%; }
    .navbar-menu li > a:not(.btn) { 
        width: 100%; 
        padding: 14px 16px;
    }
    
    .nav-cta {
        margin-inline-start: 0;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        width: 100%;
    }
    
    .nav-cta .btn { width: 100%; }
    
    .navbar-toggle { display: flex; }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    position: relative;
    padding: 80px 0 30px;
    margin-top: 100px;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
    background: var(--secondary-bg);
}

.footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, var(--tertiary-bg));
    z-index: 0;
    pointer-events: none;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.footer-col { display: flex; flex-direction: column; }

.footer-logo { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 1.25rem; 
    font-weight: 800; 
    margin-bottom: 16px; 
}

.footer-about {
    color: var(--text-secondary);
    font-size: 0.93rem;
    line-height: 1.9;
    margin-bottom: 24px;
}

.footer-social { display: flex; gap: 10px; }

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 1.3rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition);
}

.social-link:hover {
    transform: translateY(-4px);
    color: #fff;
    background: var(--gradient-gold);
    border-color: transparent;
    box-shadow: var(--glow-gold);
}

.social-link i { transition: transform var(--transition); }
.social-link:hover i { transform: rotate(360deg); }

.footer-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    width: 30px;
    height: 2px;
    background: var(--gradient-gold);
}

.footer-title i { color: var(--gold); }

.footer-links li { margin-bottom: 12px; }

.footer-links li a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    padding: 4px 0;
    transition: all var(--transition);
}

.footer-links li a i {
    transition: all var(--transition);
    opacity: 0;
    transform: translateX(4px);
}

.footer-links li a:hover { 
    color: var(--gold);
    padding-inline-start: 8px;
}

.footer-links li a:hover i {
    opacity: 1;
    transform: translateX(0);
}

.footer-contact li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.footer-contact li i { color: var(--gold); }

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.footer-bottom p { display: inline-flex; align-items: center; gap: 6px; }
.footer-bottom p i { color: var(--gold); }

.footer-bottom-links { display: inline-flex; align-items: center; gap: 12px; }
.footer-bottom-links a:hover { color: var(--gold); }
.footer-bottom-links span { color: var(--border-strong); }

/* ============================================
   Alerts & Notifications
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    animation: fadeInDown 0.4s ease;
    position: relative;
}

.alert i:first-child { font-size: 1.3rem; flex-shrink: 0; }

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.alert-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: var(--warning-text);
}

.alert-info {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    color: var(--info-text);
}

.alert .close-alert {
    margin-inline-start: auto;
    background: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.alert .close-alert:hover { opacity: 1; transform: scale(1.1); }

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label i { color: var(--gold); }

.form-input, .form-select {
    width: 100%;
    padding: 13px 16px;
    background: var(--surface-alt);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.96rem;
    transition: all var(--transition);
}

.form-input:hover, .form-select:hover {
    border-color: var(--gold);
}

.form-input:focus, .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.7;
    font-family: var(--font-family);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f7931a'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    background-size: 20px;
    padding-inline-end: 40px;
}

[dir="rtl"] .form-select {
    background-position: left 12px center;
}

/* Form Validation States */
.form-input.is-valid, .form-select.is-valid {
    border-color: var(--green);
}

.form-input.is-invalid, .form-select.is-invalid {
    border-color: var(--red);
}

.form-error {
    display: block;
    font-size: 0.82rem;
    color: var(--red);
    margin-top: 6px;
}

.form-hint {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Form Input Wrapper */
.form-input-wrapper {
    position: relative;
}

.form-input-wrapper .lead {
    position: absolute;
    top: 50%;
    inset-inline-end: 16px;
    transform: translateY(-50%);
    color: var(--gold);
    font-size: 1.2rem;
    pointer-events: none;
}

[dir="rtl"] .form-input-wrapper .form-input {
    padding-inline-end: 44px;
}

[dir="ltr"] .form-input-wrapper .form-input {
    padding-inline-start: 44px;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.92rem;
    max-width: 300px;
    margin: 0 auto;
}

/* ============================================
   Loading States
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: loadingDot 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface) 25%,
        var(--surface-alt) 50%,
        var(--surface) 75%
    );
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 100%;
}

.skeleton-text.short { width: 60%; }
.skeleton-title { height: 24px; width: 80%; margin-bottom: 12px; }
.skeleton-image { height: 200px; width: 100%; }

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--surface);
    color: var(--text-secondary);
}

.badge-success { background: var(--success-bg); color: var(--green); }
.badge-danger { background: var(--error-bg); color: var(--red); }
.badge-warning { background: var(--warning-bg); color: var(--yellow); }
.badge-info { background: var(--info-bg); color: var(--cyan); }
.badge-buy { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge-sell { background: rgba(239, 68, 68, 0.15); color: var(--red); }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    transform: scale(0.9);
    transition: transform var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 1.2rem;
    display: grid;
    place-items: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--red);
    color: #fff;
}

.modal-body {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 90px;
    inset-inline-end: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
}

.toast.toast-success { border-inline-start: 4px solid var(--green); }
.toast.toast-error { border-inline-start: 4px solid var(--red); }
.toast.toast-warning { border-inline-start: 4px solid var(--yellow); }
.toast.toast-info { border-inline-start: 4px solid var(--cyan); }

.toast i { font-size: 1.4rem; }
.toast-success i { color: var(--green); }
.toast-error i { color: var(--red); }
.toast-warning i { color: var(--yellow); }
.toast-info i { color: var(--cyan); }

.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.92rem; }
.toast-message { font-size: 0.84rem; color: var(--text-secondary); }

.toast-close {
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--text-primary); }

/* ============================================
   Utility Classes
   ============================================ */
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 32px; }

.grid { display: grid; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 48px; }
.mb-md { margin-bottom: 24px; }
.mb-lg { margin-bottom: 48px; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Selection & Scrollbar
   ============================================ */
::selection {
    background: var(--gold);
    color: #fff;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--tertiary-bg); }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-sm);
    border: 2px solid var(--tertiary-bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 768px) {
    .section-padding { padding: 70px 0; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .section-title { font-size: 1.5rem; }
    .btn-lg { padding: 12px 24px; font-size: 0.95rem; }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .navbar, .footer, .theme-toggle, .btn, .nav-overlay { display: none !important; }
    body { background: #fff; color: #000; }
    .container { max-width: 100%; }
    a { color: #000; text-decoration: underline; }
    a::after { content: " (" attr(href) ")"; }
}