/* ============================================
   9T Noor ul Ilm — Pure Sunni Islamic Study Platform
   Design System & Global Styles
   ============================================ */

/* === CSS Custom Properties (Design Tokens) === */
:root {
    /* Primary Palette — Deep Islamic Gold & Emerald */
    --gold-50: #fefce8;
    --gold-100: #fef9c3;
    --gold-200: #fef08a;
    --gold-300: #fde047;
    --gold-400: #facc15;
    --gold-500: #d4a017;
    --gold-600: #b8860b;
    --gold-700: #92690a;
    --gold-800: #6b4f09;
    --gold-900: #3d2e06;

    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-300: #6ee7b7;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --emerald-800: #065f46;
    --emerald-900: #064e3b;

    /* Dark Theme Base */
    --bg-primary: #0a0f1a;
    --bg-secondary: #0f1629;
    --bg-tertiary: #141c33;
    --bg-card: #161e35;
    --bg-card-hover: #1a2440;
    --bg-elevated: #1e2a4a;

    /* Text Colors */
    --text-primary: #f0f0f5;
    --text-secondary: #a0aec0;
    --text-tertiary: #718096;
    --text-accent: #d4a017;
    --text-arabic: #fde68a;

    /* Accent Colors */
    --accent-primary: #d4a017;
    --accent-secondary: #10b981;
    --accent-glow: rgba(212, 160, 23, 0.3);
    --accent-glow-green: rgba(16, 185, 129, 0.3);

    /* Glass Effect */
    --glass-bg: rgba(22, 30, 53, 0.7);
    --glass-border: rgba(212, 160, 23, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Gradients */
    --gradient-gold: linear-gradient(135deg, #d4a017, #f5d060, #d4a017);
    --gradient-emerald: linear-gradient(135deg, #059669, #10b981, #34d399);
    --gradient-hero: linear-gradient(180deg, #0a0f1a 0%, #0f1629 40%, #141c33 100%);
    --gradient-card: linear-gradient(145deg, rgba(22, 30, 53, 0.9), rgba(26, 36, 64, 0.6));
    --gradient-islamic: linear-gradient(135deg, #0a1628, #0f2027, #0a1628);

    /* Madhab Colors */
    --hanafi-color: #6366f1;
    --maliki-color: #ec4899;
    --shafii-color: #14b8a6;
    --hanbali-color: #f59e0b;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic: 'Amiri', 'Noto Naskh Arabic', serif;
    --font-display: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--bg-secondary);
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.top-banner {
    position: sticky;
    top: 0;
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.65rem 1rem;
    background: linear-gradient(90deg, #072a1c, #0d472e 50%, #072a1c);
    border-bottom: 1px solid rgba(212, 160, 23, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.top-banner-bismillah {
    font-family: var(--font-arabic);
    font-size: 1.55rem;
    font-weight: 700;
    color: #fde68a;
    letter-spacing: 1.5px;
    text-shadow: 0 0 12px rgba(253, 230, 138, 0.4), 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--gold-700); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-600); }

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

/* === Loader === */
.loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-geometric {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-xl);
}

.geo-ring {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: 50%;
}

.ring-1 {
    border-top-color: var(--accent-primary);
    animation: spin 1.5s linear infinite;
}

.ring-2 {
    inset: 12px;
    border-right-color: var(--accent-secondary);
    animation: spin 2s linear infinite reverse;
}

.ring-3 {
    inset: 24px;
    border-bottom-color: var(--gold-300);
    animation: spin 1s linear infinite;
}

.geo-star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    background: var(--accent-primary);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: pulse-star 1.5s ease-in-out infinite;
}

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

@keyframes pulse-star {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.7; }
}

.loader-bismillah {
    font-family: var(--font-arabic);
    font-size: 1.6rem;
    color: var(--text-arabic);
    margin-bottom: var(--space-sm);
    animation: fadeInUp 1s ease forwards;
}

.loader-text {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: fadeInUp 1s ease 0.3s forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Navigation === */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) 0;
    transition: all var(--transition-normal);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(10, 15, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: var(--space-sm) 0;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.logo-accent {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.85em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(212, 160, 23, 0.08);
}

.nav-link.active {
    color: var(--accent-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

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

/* === Hero Section === */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: var(--gradient-hero);
    padding: var(--space-4xl) var(--space-xl);
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image:
        radial-gradient(circle at 25% 25%, var(--accent-primary) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, var(--accent-secondary) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: patternDrift 30s linear infinite;
}

@keyframes patternDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    animation: floatParticle 8s ease-in-out infinite;
}

@keyframes floatParticle {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    20% { opacity: 0.6; }
    80% { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-20vh) scale(1); }
}

.hero-content {
    text-align: center;
    max-width: 800px;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-primary);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.8s ease 0.5s forwards;
    opacity: 0;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--accent-glow-green); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px transparent; }
}

.hero-title {
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.8s ease 0.7s forwards;
    opacity: 0;
}

.title-arabic {
    display: block;
    font-family: var(--font-arabic);
    font-size: 3.2rem;
    color: var(--text-arabic);
    margin-bottom: var(--space-sm);
    text-shadow: 0 0 40px rgba(253, 230, 138, 0.2);
    letter-spacing: 2px;
}

.title-main {
    display: block;
    font-size: 3.8rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

.title-sub {
    display: block;
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 620px;
    margin: 0 auto var(--space-2xl);
    animation: fadeInUp 0.8s ease 0.9s forwards;
    opacity: 0;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
    animation: fadeInUp 0.8s ease 1.1s forwards;
    opacity: 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hero Buttons */
.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    animation: fadeInUp 0.8s ease 1.3s forwards;
    opacity: 0;
}

.market-switcher {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.market-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(212, 160, 23, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.market-chip:hover,
.market-chip.active {
    transform: translateY(-1px);
    border-color: rgba(212, 160, 23, 0.38);
    background: rgba(212, 160, 23, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-spring);
    cursor: pointer;
    border: none;
    font-family: var(--font-primary);
}

.btn-primary {
    background: var(--gradient-gold);
    color: var(--bg-primary);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(212, 160, 23, 0.08);
    transform: translateY(-2px);
}

/* Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeInUp 0.8s ease 1.5s forwards;
    opacity: 0;
}

.scroll-arrow {
    width: 20px;
    height: 30px;
    border: 2px solid var(--text-tertiary);
    border-radius: 10px;
    margin: var(--space-sm) auto 0;
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 3px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 0.3; }
}

/* === Daily Verse === */
.daily-verse {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.verse-card {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-2xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.verse-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--gradient-gold);
    border-radius: 0 0 3px 3px;
}

.verse-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-lg);
}

.verse-arabic {
    font-family: var(--font-arabic);
    font-size: 1.7rem;
    color: var(--text-arabic);
    line-height: 2.2;
    margin-bottom: var(--space-lg);
    text-shadow: 0 0 30px rgba(253, 230, 138, 0.1);
}

.verse-translation {
    font-size: 1rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.8;
    margin-bottom: var(--space-md);
}

.verse-reference {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 600;
}

/* === Section Styles === */
.section {
    padding: var(--space-4xl) 0;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-3xl);
}

.section-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-lg);
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.15);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-family: var(--font-arabic);
    font-size: 2.2rem;
    color: var(--text-arabic);
    line-height: 1.4;
    margin-bottom: var(--space-md);
}

.section-title span {
    display: block;
    font-family: var(--font-primary);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: var(--space-sm);
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* === Quran Section === */
.quran-section {
    background: var(--bg-primary);
}

.quran-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.quran-card {
    padding: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.quran-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
    transform-origin: left;
}

.quran-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 160, 23, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.quran-card:hover::before {
    transform: scaleX(1);
}

.qcard-icon {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.quran-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.quran-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.qcard-topics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.topic-tag {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.12);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-primary);
}

/* === Hadith Section === */
.hadith-section {
    background: var(--bg-secondary);
}

.hadith-collections {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-3xl);
}

.hadith-book {
    display: flex;
    align-items: flex-start;
    gap: var(--space-xl);
    padding: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.hadith-book:hover {
    border-color: rgba(212, 160, 23, 0.25);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--accent-primary), 0 8px 30px rgba(0, 0, 0, 0.2);
}

.book-rank {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-gold);
    color: var(--bg-primary);
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: var(--radius-md);
}

.book-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.book-author {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

.book-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.book-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Featured Hadith */
.featured-hadith {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    position: relative;
}

.featured-hadith::before,
.featured-hadith::after {
    content: '"';
    font-family: var(--font-arabic);
    font-size: 5rem;
    color: var(--accent-primary);
    opacity: 0.15;
    position: absolute;
    line-height: 1;
}

.featured-hadith::before { top: 10px; left: 20px; }
.featured-hadith::after { bottom: -20px; right: 20px; }

.fh-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-lg);
}

.fh-text {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: var(--space-md);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.fh-source {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    font-weight: 500;
}

/* === Fiqh Section === */
.fiqh-section {
    background: var(--bg-primary);
}

.madhahib-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-3xl);
}

.madhab-card {
    padding: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.madhab-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.madhab-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
}

.madhab-color-bar {
    flex: 1;
    height: 3px;
    border-radius: 3px;
    opacity: 0.3;
}

.hanafi .madhab-number, .hanafi .madhab-color-bar { background: var(--hanafi-color); }
.maliki .madhab-number, .maliki .madhab-color-bar { background: var(--maliki-color); }
.shafii .madhab-number, .shafii .madhab-color-bar { background: var(--shafii-color); }
.hanbali .madhab-number, .hanbali .madhab-color-bar { background: var(--hanbali-color); }

.madhab-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.hanafi:hover { border-color: rgba(99, 102, 241, 0.4); }
.maliki:hover { border-color: rgba(236, 72, 153, 0.4); }
.shafii:hover { border-color: rgba(20, 184, 166, 0.4); }
.hanbali:hover { border-color: rgba(245, 158, 11, 0.4); }

.madhab-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.madhab-founder {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.madhab-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.madhab-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.madhab-books {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.madhab-books span {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.madhab-followers {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Fiqh Topics */
.fiqh-topics {
    text-align: center;
}

.topics-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.topic-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.topic-item:hover {
    border-color: rgba(212, 160, 23, 0.3);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.topic-icon {
    font-size: 1.2rem;
}

/* === Seerah Timeline === */
.seerah-section {
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: var(--space-2xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    opacity: 0.3;
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-2xl);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-dot {
    position: absolute;
    left: calc(-1 * var(--space-2xl) + 4px);
    top: 8px;
    width: 18px;
    height: 18px;
    background: var(--bg-primary);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    z-index: 1;
    transition: all var(--transition-normal);
}

.timeline-item:hover .timeline-dot {
    background: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: scale(1.3);
}

.timeline-content {
    padding: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.timeline-item:hover .timeline-content {
    border-color: rgba(212, 160, 23, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.timeline-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timeline-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-sm) 0;
}

.timeline-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === Aqeedah Section === */
.aqeedah-section {
    background: var(--bg-primary);
}

.aqeedah-pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.pillar-card {
    padding: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.pillar-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.pillar-card:hover {
    transform: translateY(-6px);
    border-color: rgba(212, 160, 23, 0.3);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.pillar-card:hover::after {
    opacity: 0.15;
}

.pillar-num {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-gold);
    color: var(--bg-primary);
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: 50%;
    margin: 0 auto var(--space-lg);
    position: relative;
    z-index: 1;
}

.pillar-card h3 {
    font-family: var(--font-arabic);
    font-size: 1.4rem;
    color: var(--text-arabic);
    margin-bottom: var(--space-xs);
    position: relative;
    z-index: 1;
}

.pillar-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.pillar-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* === Scholars Section === */
.scholars-section {
    background: var(--bg-secondary);
}

.scholars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.scholar-card {
    padding: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.scholar-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 160, 23, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.scholar-avatar {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.scholar-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.scholar-dates {
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.scholar-bio {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.scholar-works {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.scholar-works span {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-secondary);
}

/* === Prayer Section === */
.prayer-section {
    background: var(--bg-primary);
}

.prayer-dashboard {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-3xl);
}

.prayer-current {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.prayer-current::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.15;
}

.current-prayer-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.current-prayer-name {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
}

.current-prayer-time {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
    position: relative;
    z-index: 1;
}

.prayer-countdown {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    position: relative;
    z-index: 1;
}

.prayer-times-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-sm);
}

.prayer-time-card {
    display: grid;
    grid-template-columns: 40px 100px 80px 1fr;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.prayer-time-card:hover {
    border-color: rgba(212, 160, 23, 0.3);
    transform: translateX(4px);
}

.prayer-time-card.active-prayer {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.pt-icon { font-size: 1.3rem; }
.pt-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.pt-time {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
}
.pt-rakaat {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* === Adhkar Section === */
.adhkar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: var(--space-xl);
}

.adhkar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

.dhikr-card {
    padding: var(--space-xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.dhikr-card:hover {
    border-color: rgba(212, 160, 23, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.dhikr-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
}

.dhikr-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.dhikr-arabic {
    font-family: var(--font-arabic);
    font-size: 1.3rem;
    color: var(--text-arabic);
    line-height: 2;
    margin-bottom: var(--space-sm);
    text-align: right;
    direction: rtl;
}

.dhikr-trans {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* === Trading Dashboard === */
.trading-section {
    position: relative;
    background:
        radial-gradient(circle at top, rgba(16,185,129,0.10), transparent 34%),
        radial-gradient(circle at bottom right, rgba(212,160,23,0.08), transparent 24%),
        linear-gradient(180deg, #0b101a 0%, #0f172a 55%, #0b101a 100%);
}

.trading-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.18;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.06) 0 1px, transparent 1.5px),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,0.05) 0 1px, transparent 1.5px),
        radial-gradient(circle at 35% 75%, rgba(255,255,255,0.04) 0 1px, transparent 1.5px);
    background-size: 220px 220px;
}

.trading-section > .container {
    position: relative;
    z-index: 1;
}

/* PKT Clock Bar */
.pkt-clock-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-lg);
    background:
        linear-gradient(180deg, rgba(22, 86, 60, 0.94), rgba(13, 58, 40, 0.98));
    border: 1px solid rgba(85, 209, 143, 0.32);
    border-radius: 28px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 0 32px rgba(16,185,129,0.12);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.pkt-clock-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.07), transparent 35%),
        radial-gradient(circle at top right, rgba(255,255,255,0.09), transparent 26%);
    pointer-events: none;
}

@keyframes pkt-scan {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.pkt-clock-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 0;
    flex: 1 1 auto;
}

.pkt-flag {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.14));
}

.pkt-time-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pkt-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(240, 255, 248, 0.72);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.pkt-time {
    font-size: clamp(1.5rem, 2.8vw, 2.3rem);
    font-weight: 900;
    font-family: 'Courier New', monospace;
    color: #d9ffe9;
    letter-spacing: 0.2em;
    text-shadow: 0 0 14px rgba(0,0,0,0.22);
    line-height: 1;
    white-space: nowrap;
}

.pkt-date {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.82);
    letter-spacing: 0.04em;
}

.pkt-clock-right {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: var(--space-md);
    align-items: center;
    min-width: 0;
}

.pkt-rate-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: var(--space-md) var(--space-lg);
    background: rgba(7, 24, 17, 0.35);
    border: 1px solid rgba(214, 255, 231, 0.14);
    border-radius: 20px;
    min-width: 0;
}

.pkt-rate-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(240, 255, 248, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pkt-rate-value {
    font-size: clamp(1rem, 1.7vw, 1.35rem);
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: #c9ffdb;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0,0,0,0.2);
    transition: color 0.3s ease;
    white-space: nowrap;
}

.pkt-rate-value.upgrading {
    color: #a7f3d0;
    text-shadow: 0 0 10px rgba(16,185,129,0.34);
}

.pkt-rate-value.downgrading {
    color: #fca5a5;
    text-shadow: 0 0 8px rgba(239,68,68,0.26);
}

.pkt-rate-value.pkt-neutral {
    color: rgba(255,255,255,0.72);
    font-size: 0.95rem;
    text-shadow: none;
}

.pkt-rate-block:hover {
    transform: translateY(-1px);
    border-color: rgba(214, 255, 231, 0.24);
    background: rgba(7, 24, 17, 0.45);
}

@media (max-width: 768px) {
    .pkt-clock-bar {
        flex-direction: column;
        gap: var(--space-md);
        align-items: flex-start;
    }
    .pkt-clock-right {
        width: 100%;
        grid-template-columns: 1fr;
    }
    .pkt-time {
        font-size: 1.4rem;
    }
    .pkt-rate-block {
        width: 100%;
        align-items: flex-start;
    }

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

    .top-banner {
        justify-content: flex-start;
        text-align: left;
        padding: 0.75rem 1rem;
    }
}

.trading-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.trading-chart-container {
    background: linear-gradient(180deg, rgba(17, 25, 34, 0.98), rgba(12, 18, 25, 0.95));
    border: 1px solid rgba(214, 255, 231, 0.08);
    border-radius: 24px;
    padding: var(--space-xl);
    position: relative;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chart-title-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.chart-mode-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-mode-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-mode-btn.active {
    background: linear-gradient(135deg, #d4a017, #10b981);
    color: #0a0f1a;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.chart-view-wrapper {
    width: 100%;
    position: relative;
}

.chart-view-wrapper.hidden {
    display: none;
}

#marketChart {
    width: 100% !important;
    height: 400px !important;
    display: block !important;
    background: #090e1a;
    border-radius: var(--radius-md);
    border: 1px solid rgba(212, 160, 23, 0.15);
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-secondary);
    background: rgba(16, 185, 129, 0.1);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-secondary);
    border-radius: 50%;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 900px) {
    .asset-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .asset-grid { grid-template-columns: 1fr; }
}

/* Gold card accent */
.asset-card.gold-card {
    border-color: rgba(212, 160, 23, 0.5);
    background: linear-gradient(135deg, rgba(12,18,10,0.92), rgba(40,30,8,0.7));
}
.asset-card.gold-card .asset-price { color: #f5c842; }

/* Silver card accent */
.asset-card.silver-card {
    border-color: rgba(180, 180, 200, 0.4);
    background: linear-gradient(135deg, rgba(12,14,22,0.92), rgba(28,32,46,0.8));
}
.asset-card.silver-card .asset-price { color: #c8ccd8; }

/* Trade Learn Button Row */
.trade-learn-row {
    display: flex;
    justify-content: center;
    margin: var(--space-lg) 0;
}

.btn-trade-learn {
    background: linear-gradient(135deg, #d4a017, #10b981);
    color: #0a0f1a;
    font-size: 1rem;
    font-weight: 800;
    padding: var(--space-md) var(--space-3xl);
    border: none;
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(212, 160, 23, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    letter-spacing: 0.3px;
}
.btn-trade-learn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(212, 160, 23, 0.5);
}

.market-panels {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.market-panel {
    padding: 1rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(18, 33, 27, 0.9), rgba(12, 21, 18, 0.94));
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
    min-height: 170px;
}

.market-panel.live {
    border-color: rgba(16, 185, 129, 0.28);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.1);
}

.market-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.market-panel-head h3 {
    margin: 0;
    font-size: 1rem;
}

.market-panel-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.market-panel-badge.live {
    background: rgba(16, 185, 129, 0.12);
    color: #9ef0be;
}

.market-panel-desc {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.market-panel-stats {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: var(--text-primary);
    font-size: 0.84rem;
}

.market-panel-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.market-candle-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.45rem;
    align-items: end;
    height: 112px;
    margin: 0.85rem 0;
    padding: 0.7rem 0.55rem 0.5rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.mini-candle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.mini-candle .wick {
    position: absolute;
    width: 3px;
    border-radius: 999px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.08);
}

.mini-candle .body {
    width: 18px;
    min-height: 10px;
    border-radius: 6px;
    position: relative;
    z-index: 2;
    transition: height 0.35s ease, transform 0.35s ease, background 0.35s ease;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.14);
}

.mini-candle.bullish .body {
    background: linear-gradient(180deg, #9ef0be, #34d399);
}

.mini-candle.bullish .wick {
    background: #34d399;
}

.mini-candle.bearish .body {
    background: linear-gradient(180deg, #fda4af, #f87171);
}

.mini-candle.bearish .wick {
    background: #f87171;
}

.mini-candle.neutral .body {
    background: linear-gradient(180deg, #d6dae6, #94a3b8);
}

.mini-candle.neutral .wick {
    background: #94a3b8;
}

.mini-candle:hover .body {
    transform: translateY(-1px) scaleY(1.03);
}

.candle-section {
    margin-top: var(--space-2xl);
    padding: 1.1rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(12, 18, 31, 0.96), rgba(10, 14, 22, 0.94));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.candle-header {
    margin-bottom: 1rem;
}

.candle-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.legend-pill {
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
}

.candle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.candle-card {
    padding: 1rem;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(15, 22, 37, 0.95), rgba(10, 14, 22, 0.96));
}

.candle-card.bullish {
    border-color: rgba(52, 211, 153, 0.22);
}

.candle-card.bearish {
    border-color: rgba(248, 113, 113, 0.22);
}

.candle-card.neutral {
    border-color: rgba(255, 255, 255, 0.08);
}

.candle-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.candle-card-head h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
}

.candle-tag {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.candle-tag.bullish {
    background: rgba(52, 211, 153, 0.12);
    color: #9ef0be;
}

.candle-tag.bearish {
    background: rgba(248, 113, 113, 0.12);
    color: #fda4af;
}

.candle-tag.neutral {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
}

.candle-diagram {
    position: relative;
    height: 120px;
    border-radius: 18px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03), transparent 60%);
}

.candle-svg {
    width: 100%;
    height: 100%;
}

.candle-svg .wick {
    stroke-linecap: round;
    stroke-width: 3;
}

.candle-svg .body {
    rx: 4;
    ry: 4;
}

.candle-note {
    margin: 0.75rem 0 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.55;
}

.candle-note strong {
    color: var(--text-primary);
}

.bullish-color {
    color: #34d399;
}

.bearish-color {
    color: #f87171;
}

.asset-card {
    background: linear-gradient(180deg, rgba(18, 33, 27, 0.92), rgba(12, 21, 18, 0.94));
    border: 1px solid rgba(214, 255, 231, 0.08);
    border-radius: 22px;
    padding: var(--space-lg);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.asset-card.featured {
    border-color: rgba(85, 209, 143, 0.34);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.12);
}

.asset-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #34d399, #16a34a);
}

.crude-card {
    border-color: rgba(212, 160, 23, 0.24);
}

.oil-tag {
    background: rgba(16, 185, 129, 0.16);
    color: #9ef0be;
}

.btc-bird {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    width: fit-content;
    margin-bottom: var(--space-xs);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f0fff7;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.btc-bird.hidden {
    display: none;
}

.asset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.asset-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.asset-tag {
    font-size: 0.65rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.asset-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    font-family: var(--font-display);
    transition: color 0.3s ease;
}

.asset-change {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

.upgrading {
    color: var(--accent-secondary) !important;
}

.downgrading {
    color: #ef4444 !important; /* Red */
}

/* Animations for price flashes */
@keyframes flash-green {
    0% { background-color: rgba(16, 185, 129, 0.2); }
    100% { background-color: transparent; }
}

@keyframes flash-red {
    0% { background-color: rgba(239, 68, 68, 0.2); }
    100% { background-color: transparent; }
}

.flash-up {
    animation: flash-green 1s ease-out;
}

.flash-down {
    animation: flash-red 1s ease-out;
}

/* === Trading Extra Grid & Spot Trade Widget === */
.trading-extra-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.sunnah-trade-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    position: relative;
    overflow: hidden;
}

.sunnah-trade-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-gold);
}

.st-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: rgba(212, 160, 23, 0.1);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: var(--space-md);
}

.sunnah-trade-card h3 {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--text-arabic);
    margin-bottom: var(--space-xs);
}

.sunnah-trade-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.st-quote {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.st-principles {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.st-tag {
    padding: var(--space-xs) var(--space-md);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

/* Spot Trade Card */
.spot-trade-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    position: relative;
}

.spot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.spot-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.spot-badge {
    font-size: 0.72rem;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.spot-sub {
    font-size: 0.83rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.spot-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1;
}

.form-row {
    display: flex;
    gap: var(--space-md);
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.spot-input {
    background: rgba(10, 15, 26, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: var(--font-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.spot-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(212, 160, 23, 0.2);
}

.btn-spot-execute {
    width: 100%;
    margin-top: var(--space-xs);
    background: var(--gradient-emerald);
    color: var(--bg-primary);
    font-size: 1rem;
    font-weight: 700;
    justify-content: center;
    border: none;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-spot-execute:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.4);
}

.trade-result {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    transition: all var(--transition-fast);
}

.trade-result.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
}

.trade-result.hidden {
    display: none;
}

.trade-toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 6000;
    display: grid;
    gap: 0.65rem;
}

.trade-toast {
    min-width: 240px;
    max-width: 320px;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    background: rgba(8, 18, 14, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.trade-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.trade-toast strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #f0fff7;
}

.trade-toast span {
    display: block;
    font-size: 0.86rem;
    color: rgba(240, 255, 247, 0.82);
}

.trade-toast.positive {
    border-color: rgba(16, 185, 129, 0.24);
}

.trade-toast.negative {
    border-color: rgba(239, 68, 68, 0.24);
}

/* Bullish Surge Banner on BTC Card */
.bullish-surge-badge {
    background: linear-gradient(90deg, #ef4444, #d4a017);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    animation: pulse-surge 1s infinite alternate;
}

.bullish-surge-badge.hidden {
    display: none;
}

.rec-dot {
    width: 7px;
    height: 7px;
    background: #ffffff;
    border-radius: 50%;
    animation: blink-rec 0.8s infinite;
}

@keyframes pulse-surge {
    0% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.4); }
    100% { box-shadow: 0 0 15px rgba(212, 160, 23, 0.8); }
}

@keyframes blink-rec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Pakistan Stadium Scale Card 📌 */
.stadium-scale-card {
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-top: var(--space-xl);
    position: relative;
}

.stadium-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.stadium-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stadium-badge {
    font-size: 0.75rem;
    background: rgba(212, 160, 23, 0.15);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.stadium-desc {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-lg);
}

.stadium-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stadium-item {
    background: rgba(10, 15, 26, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.st-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.st-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary);
    margin-bottom: var(--space-xs);
    font-family: var(--font-display);
}

.st-sub {
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-weight: 500;
}

.stadium-progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.stadium-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Khan Ghauri Honor Badge */
.ghauri-honor-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-xl);
    background: linear-gradient(135deg, rgba(212, 160, 23, 0.15), rgba(16, 185, 129, 0.15));
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(212, 160, 23, 0.2);
}

.ghauri-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent-primary);
    letter-spacing: 0.5px;
}

.ghauri-sub {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-secondary);
    text-transform: uppercase;
}

@media (max-width: 1024px) {
    .trading-extra-grid {
        grid-template-columns: 1fr;
    }
    .stadium-grid {
        grid-template-columns: 1fr;
    }
}

/* === Domain Section === */
.domain-section {
    padding: var(--space-3xl) 0;
    background: var(--bg-secondary);
}

.domain-card {
    text-align: center;
    padding: var(--space-3xl);
    background: var(--gradient-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.domain-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, var(--accent-glow) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, var(--accent-glow-green) 0%, transparent 50%);
    opacity: 0.15;
}

.domain-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: var(--space-lg);
    position: relative;
    z-index: 1;
}

.domain-name {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.domain-tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    position: relative;
    z-index: 1;
}

.domain-alternatives {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 1;
}

.alt-domain {
    padding: var(--space-sm) var(--space-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.alt-domain:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(212, 160, 23, 0.08);
}

/* === Footer === */
.footer {
    padding: var(--space-3xl) 0 var(--space-xl);
    background: var(--bg-primary);
    border-top: 1px solid var(--glass-border);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.footer-logo .logo-icon {
    color: var(--accent-primary);
}

.footer-brand p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.footer-aqeedah {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-style: italic;
}

.footer-links h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.footer-dua {
    font-family: var(--font-arabic);
    font-size: 1.2rem;
    color: var(--text-arabic);
    opacity: 0.6;
}

.footer-dua-trans {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* === Animations for scroll reveal === */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .quran-grid { grid-template-columns: repeat(2, 1fr); }
    .aqeedah-pillars { grid-template-columns: repeat(2, 1fr); }
    .topics-grid { grid-template-columns: repeat(2, 1fr); }
    .prayer-dashboard { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        flex-direction: column;
        background: var(--bg-secondary);
        padding: var(--space-4xl) var(--space-xl);
        border-left: 1px solid var(--glass-border);
        transition: right var(--transition-normal);
        z-index: 999;
    }

    .nav-links.open { right: 0; }
    .nav-toggle { display: flex; }

    .title-arabic { font-size: 2rem; }
    .title-main { font-size: 2.4rem; }
    .hero-stats { flex-wrap: wrap; gap: var(--space-lg); }
    .stat-item { flex: 0 0 40%; }
    .hero-actions { flex-direction: column; align-items: center; }

    .quran-grid { grid-template-columns: 1fr; }
    .madhahib-grid { grid-template-columns: 1fr; }
    .aqeedah-pillars { grid-template-columns: 1fr; }
    .scholars-grid { grid-template-columns: 1fr; }
    .topics-grid { grid-template-columns: 1fr 1fr; }
    .adhkar-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .domain-name { font-size: 2rem; }

    .hadith-book { flex-direction: column; }

    .section-title { font-size: 1.6rem; }
    .section-title span { font-size: 1.2rem; }

    .prayer-time-card {
        grid-template-columns: 40px 1fr 80px;
    }
    .pt-rakaat { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .container { padding: 0 var(--space-md); }
    .title-main { font-size: 1.8rem; }
    .topics-grid { grid-template-columns: 1fr; }
    .hero-stats { gap: var(--space-md); }
    .market-panels { grid-template-columns: 1fr; }
    .candle-grid { grid-template-columns: 1fr; }
    .market-candle-strip { height: 96px; }
}

/* =============================
   TRADE LEARNING MODAL
   ============================= */
.trade-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 8, 20, 0.88);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    overflow-y: auto;
}

.trade-modal.hidden {
    display: none;
}

.trade-modal-box {
    background: linear-gradient(145deg, #0d1526, #0a1a12);
    border: 1px solid rgba(212, 160, 23, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    max-width: 780px;
    width: 100%;
    position: relative;
    box-shadow: 0 0 60px rgba(16, 185, 129, 0.12), 0 0 120px rgba(212, 160, 23, 0.06);
    max-height: 90vh;
    overflow-y: auto;
}

.trade-modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.trade-modal-close:hover { background: rgba(239, 68, 68, 0.35); }

.trade-modal-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
    border-bottom: 1px solid rgba(212,160,23,0.15);
    padding-bottom: var(--space-xl);
}

.trade-modal-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(212,160,23,0.12);
    border: 1px solid rgba(212,160,23,0.25);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.5px;
}

.trade-modal-header h2 {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.trade-modal-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-arabic);
}

.trade-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.trade-step {
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
    padding: var(--space-lg);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}
.trade-step:hover {
    border-color: rgba(16, 185, 129, 0.25);
}

.step-num {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: 'Courier New', monospace;
    color: var(--accent-primary);
    opacity: 0.6;
    min-width: 44px;
    text-align: center;
    line-height: 1;
    padding-top: 4px;
}

.step-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.step-body p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.step-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.step-tags span {
    padding: 2px 10px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

/* ============================================
   WEEX BUTTONS, TABS & SIMULATOR STYLES
   ============================================ */
.btn-weex-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    padding: var(--space-md) var(--space-xl);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-weex-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(16, 185, 129, 0.4);
}

.btn-weex-secondary {
    background: linear-gradient(135deg, #d4a017, #b8860b);
    color: #0d1526;
    font-size: 0.95rem;
    font-weight: 800;
    padding: var(--space-md) var(--space-xl);
    border: 1px solid rgba(212, 160, 23, 0.4);
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(212, 160, 23, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-weex-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(212, 160, 23, 0.4);
}

.trade-learn-row {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin: var(--space-xl) 0;
}

/* Modal Tabs */
.weex-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: var(--space-xl);
    overflow-x: auto;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 8px;
}

.weex-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.weex-tab.active, .weex-tab:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--accent-secondary);
}

.weex-tab-content.hidden { display: none; }

/* WEEX Simulator Styling */
.weex-sim-box {
    background: rgba(10, 15, 26, 0.8);
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.sim-stats-bar {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    background: rgba(255,255,255,0.03);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.sim-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sim-lbl {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.sim-val {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: var(--accent-secondary);
}

.sim-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 600px) {
    .sim-form-grid { grid-template-columns: 1fr; }
}

.sim-field label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
}

.sim-field input, .sim-field select {
    width: 100%;
    padding: 8px 12px;
    background: #0d1526;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
}

.sim-btn-row {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.btn-sim-buy {
    background: #10b981;
    color: #000;
    font-weight: 800;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    flex: 1;
}

.btn-sim-sell {
    background: #d4a017;
    color: #000;
    font-weight: 800;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    flex: 1;
}

.btn-sim-reset {
    background: rgba(255,255,255,0.08);
    color: #aaa;
    font-weight: 600;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.sim-log {
    background: #070b12;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    max-height: 140px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.sim-log-item {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sim-log-item.info { color: #d4a017; }
.sim-log-item.success { color: #34d399; }
.sim-log-item.danger { color: #f87171; }

/* ============================================
   WEEX AI CHATBOT & SCREENSHOT ANALYZER STYLES
   ============================================ */
.btn-weex-ai {
    background: linear-gradient(135deg, #6366f1, #d4a017);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    padding: var(--space-md) var(--space-xl);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-xl);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-weex-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.4);
}

.weex-ai-chat-card {
    background: linear-gradient(145deg, #0d1526, #09131e);
    border: 1px solid rgba(212, 160, 23, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin: var(--space-2xl) 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.ai-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ai-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.15);
    border: 1px solid rgba(212, 160, 23, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.ai-header-left h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.ai-header-left p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.ai-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.ai-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
}

.preset-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
}
.preset-btn:hover {
    background: rgba(212, 160, 23, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}
.preset-btn.upload-preset {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.ai-chat-messages {
    background: #060a12;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.chat-msg {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    max-width: 88%;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.msg-bubble {
    background: rgba(22, 30, 53, 0.85);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.chat-msg.user .msg-bubble {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: rgba(16, 185, 129, 0.3);
    color: #ffffff;
}

.chat-msg.bot .msg-bubble {
    background: linear-gradient(135deg, #0d1a24, #0f241a);
    border-color: rgba(212, 160, 23, 0.25);
}

.chat-msg-img {
    max-width: 220px;
    max-height: 160px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(212,160,23,0.3);
    margin-top: var(--space-xs);
    display: block;
}

.image-preview-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(99, 102, 241, 0.08);
    border: 1px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin-bottom: var(--space-sm);
}

.image-preview-container.hidden { display: none; }

.preview-box {
    position: relative;
    display: inline-block;
}

.preview-box img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--accent-primary);
}

.btn-remove-preview {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    cursor: pointer;
}

.preview-text {
    font-size: 0.8rem;
    color: #818cf8;
    font-weight: 600;
}

.ai-chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-upload-thumb {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #ffffff;
    font-size: 1.2rem;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.btn-upload-thumb:hover { background: rgba(99, 102, 241, 0.2); }

.ai-chat-input {
    flex: 1;
    background: #070b14;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: #ffffff;
    font-size: 0.9rem;
}

.btn-send-chat {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-send-chat:hover { transform: translateY(-1px); }



.trade-modal-footer {
    margin-top: var(--space-xl);
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255,255,255,0.06);
}
