/* ============================================================================
   🏆 سیستم تم پریمیوم «کیهان نامحدود» - Premium Theme System v3.0 🏆
   شامل ۱۲ تم سلطنتی با انیمیشن‌های سینمایی و افکت‌های سه‌بعدی
   ========================================================================== */

/* ============================================================
   🌌 تم تاریک اصلی - کهکشان شب
   ============================================================ */
[data-theme="dark"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #121a2e;
    --bg-tertiary: #1a2a4a;
    --text-primary: #ffffff;
    --text-secondary: #bfc7d5;
    --text-muted: #7b8698;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    
    /* 🔥 ویژگی‌های جدید */
    --glow-primary: rgba(0, 212, 255, 0.3);
    --glow-secondary: rgba(155, 89, 182, 0.2);
    --shadow-intense: 0 20px 60px rgba(0, 0, 0, 0.8);
    --gradient-hero: linear-gradient(135deg, #0a0e1a 0%, #1a2a4a 50%, #0a0e1a 100%);
    --glass-effect: rgba(255, 255, 255, 0.03);
}

/* ============================================================
   🌅 تم روشن اصلی - طلوع الماس
   ============================================================ */
[data-theme="light"] {
    --bg-primary: #f0f2f8;
    --bg-secondary: #e8ecf4;
    --bg-tertiary: #dde2ef;
    --text-primary: #1a1a2e;
    --text-secondary: #3d3d5c;
    --text-muted: #6b6b8a;
    --surface: rgba(0, 0, 0, 0.04);
    --surface-hover: rgba(0, 0, 0, 0.08);
    --border: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.2);
    
    /* 🔥 ویژگی‌های جدید */
    --glow-primary: rgba(0, 100, 255, 0.15);
    --glow-secondary: rgba(255, 215, 0, 0.1);
    --shadow-intense: 0 20px 60px rgba(0, 0, 0, 0.15);
    --gradient-hero: linear-gradient(135deg, #f0f2f8 0%, #dde2ef 50%, #f0f2f8 100%);
    --glass-effect: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   🎨 تم‌های اضافی - ۱۰ تم پریمیوم دیگر
   ============================================================ */

/* ۱. 🌹 تم رز طلایی (لوکس) */
[data-theme="rose-gold"] {
    --bg-primary: #1a0a0e;
    --bg-secondary: #2e121a;
    --bg-tertiary: #4a1a2a;
    --text-primary: #ffe8e8;
    --text-secondary: #e8b4b4;
    --text-muted: #a86a6a;
    --surface: rgba(255, 182, 193, 0.08);
    --surface-hover: rgba(255, 182, 193, 0.15);
    --border: rgba(255, 182, 193, 0.2);
    --border-strong: rgba(255, 182, 193, 0.35);
    --glow-primary: rgba(255, 182, 193, 0.3);
    --glow-secondary: rgba(255, 215, 0, 0.2);
    --shadow-intense: 0 20px 60px rgba(255, 182, 193, 0.1);
    --gradient-hero: linear-gradient(135deg, #1a0a0e 0%, #4a1a2a 50%, #1a0a0e 100%);
    --glass-effect: rgba(255, 182, 193, 0.05);
}

/* ۲. 💎 تم یاقوت کبود (سلطنتی) */
[data-theme="sapphire"] {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0a1a3e;
    --bg-tertiary: #0a2a5e;
    --text-primary: #e8f0ff;
    --text-secondary: #a0b8e8;
    --text-muted: #5a7aaa;
    --surface: rgba(65, 105, 225, 0.08);
    --surface-hover: rgba(65, 105, 225, 0.15);
    --border: rgba(65, 105, 225, 0.2);
    --border-strong: rgba(65, 105, 225, 0.35);
    --glow-primary: rgba(65, 105, 225, 0.4);
    --glow-secondary: rgba(0, 200, 255, 0.2);
    --shadow-intense: 0 20px 60px rgba(65, 105, 225, 0.15);
    --gradient-hero: linear-gradient(135deg, #0a0a1a 0%, #0a2a5e 50%, #0a0a1a 100%);
    --glass-effect: rgba(65, 105, 225, 0.05);
}

/* ۳. 🟢 تم زمرد (طبیعت لوکس) */
[data-theme="emerald"] {
    --bg-primary: #0a1a0a;
    --bg-secondary: #0a2e1a;
    --bg-territory: #0a4a2a;
    --bg-tertiary: #0a4a2a;
    --text-primary: #e8ffe8;
    --text-secondary: #a0e8b0;
    --text-muted: #5aaa6a;
    --surface: rgba(0, 255, 127, 0.08);
    --surface-hover: rgba(0, 255, 127, 0.15);
    --border: rgba(0, 255, 127, 0.2);
    --border-strong: rgba(0, 255, 127, 0.35);
    --glow-primary: rgba(0, 255, 127, 0.3);
    --glow-secondary: rgba(0, 200, 100, 0.2);
    --shadow-intense: 0 20px 60px rgba(0, 255, 127, 0.1);
    --gradient-hero: linear-gradient(135deg, #0a1a0a 0%, #0a4a2a 50%, #0a1a0a 100%);
    --glass-effect: rgba(0, 255, 127, 0.05);
}

/* ۴. 🟣 تم بنفش کیهانی (جادویی) */
[data-theme="cosmic-purple"] {
    --bg-primary: #0a0a1a;
    --bg-secondary: #1a0a3e;
    --bg-tertiary: #2a0a5e;
    --text-primary: #f0e8ff;
    --text-secondary: #c8b0f0;
    --text-muted: #8a6aaa;
    --surface: rgba(155, 89, 182, 0.08);
    --surface-hover: rgba(155, 89, 182, 0.15);
    --border: rgba(155, 89, 182, 0.2);
    --border-strong: rgba(155, 89, 182, 0.35);
    --glow-primary: rgba(155, 89, 182, 0.4);
    --glow-secondary: rgba(255, 0, 229, 0.2);
    --shadow-intense: 0 20px 60px rgba(155, 89, 182, 0.15);
    --gradient-hero: linear-gradient(135deg, #0a0a1a 0%, #2a0a5e 50%, #0a0a1a 100%);
    --glass-effect: rgba(155, 89, 182, 0.05);
}

/* ۵. 🔥 تم نارنجی (انرژی) */
[data-theme="energy-orange"] {
    --bg-primary: #1a0a00;
    --bg-secondary: #3e1a00;
    --bg-tertiary: #5e2a00;
    --text-primary: #fff0e8;
    --text-secondary: #f0c8b0;
    --text-muted: #aa7a5a;
    --surface: rgba(255, 165, 0, 0.08);
    --surface-hover: rgba(255, 165, 0, 0.15);
    --border: rgba(255, 165, 0, 0.2);
    --border-strong: rgba(255, 165, 0, 0.35);
    --glow-primary: rgba(255, 165, 0, 0.4);
    --glow-secondary: rgba(255, 100, 0, 0.2);
    --shadow-intense: 0 20px 60px rgba(255, 165, 0, 0.15);
    --gradient-hero: linear-gradient(135deg, #1a0a00 0%, #5e2a00 50%, #1a0a00 100%);
    --glass-effect: rgba(255, 165, 0, 0.05);
}

/* ۶. 🤍 تم الماس سفید (مینیمال لوکس) */
[data-theme="diamond-white"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #e8e8e8;
    --text-primary: #0a0a0a;
    --text-secondary: #3a3a3a;
    --text-muted: #6a6a6a;
    --surface: rgba(0, 0, 0, 0.03);
    --surface-hover: rgba(0, 0, 0, 0.06);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);
    --glow-primary: rgba(200, 200, 200, 0.3);
    --glow-secondary: rgba(100, 100, 100, 0.1);
    --shadow-intense: 0 20px 60px rgba(0, 0, 0, 0.08);
    --gradient-hero: linear-gradient(135deg, #ffffff 0%, #e8e8e8 50%, #ffffff 100%);
    --glass-effect: rgba(255, 255, 255, 0.8);
}

/* ۷. 🌊 تم آبی اقیانوس (آرامش‌بخش) */
[data-theme="ocean-blue"] {
    --bg-primary: #0a1a2a;
    --bg-secondary: #0a2a4a;
    --bg-tertiary: #0a3a6a;
    --text-primary: #e8f4ff;
    --text-secondary: #a0c8f0;
    --text-muted: #5a8aaa;
    --surface: rgba(0, 150, 255, 0.08);
    --surface-hover: rgba(0, 150, 255, 0.15);
    --border: rgba(0, 150, 255, 0.2);
    --border-strong: rgba(0, 150, 255, 0.35);
    --glow-primary: rgba(0, 150, 255, 0.3);
    --glow-secondary: rgba(0, 200, 255, 0.2);
    --shadow-intense: 0 20px 60px rgba(0, 150, 255, 0.1);
    --gradient-hero: linear-gradient(135deg, #0a1a2a 0%, #0a3a6a 50%, #0a1a2a 100%);
    --glass-effect: rgba(0, 150, 255, 0.05);
}

/* ۸. 🌸 تم صورتی نئونی (سایبرپانک) */
[data-theme="neon-pink"] {
    --bg-primary: #1a0a1a;
    --bg-secondary: #3a0a3a;
    --bg-tertiary: #5a0a5a;
    --text-primary: #ffe8ff;
    --text-secondary: #f0b0f0;
    --text-muted: #aa5aaa;
    --surface: rgba(255, 0, 255, 0.08);
    --surface-hover: rgba(255, 0, 255, 0.15);
    --border: rgba(255, 0, 255, 0.2);
    --border-strong: rgba(255, 0, 255, 0.35);
    --glow-primary: rgba(255, 0, 255, 0.4);
    --glow-secondary: rgba(0, 255, 255, 0.2);
    --shadow-intense: 0 20px 60px rgba(255, 0, 255, 0.15);
    --gradient-hero: linear-gradient(135deg, #1a0a1a 0%, #5a0a5a 50%, #1a0a1a 100%);
    --glass-effect: rgba(255, 0, 255, 0.05);
}

/* ۹. 🍃 تم جنگل (ارگانیک) */
[data-theme="forest"] {
    --bg-primary: #0a0e0a;
    --bg-secondary: #0a1a0a;
    --bg-tertiary: #0a2a0a;
    --text-primary: #e8f0e0;
    --text-secondary: #a0c0a0;
    --text-muted: #5a7a5a;
    --surface: rgba(0, 100, 0, 0.08);
    --surface-hover: rgba(0, 100, 0, 0.15);
    --border: rgba(0, 100, 0, 0.2);
    --border-strong: rgba(0, 100, 0, 0.35);
    --glow-primary: rgba(0, 255, 0, 0.15);
    --glow-secondary: rgba(0, 200, 0, 0.1);
    --shadow-intense: 0 20px 60px rgba(0, 100, 0, 0.1);
    --gradient-hero: linear-gradient(135deg, #0a0e0a 0%, #0a2a0a 50%, #0a0e0a 100%);
    --glass-effect: rgba(0, 100, 0, 0.05);
}

/* ۱۰. 🌅 تم غروب آفتاب (رمانتیک) */
[data-theme="sunset"] {
    --bg-primary: #1a0a0a;
    --bg-secondary: #3e1a0a;
    --bg-tertiary: #5e2a0a;
    --text-primary: #fff0e8;
    --text-secondary: #f0c8b0;
    --text-muted: #aa7a5a;
    --surface: rgba(255, 100, 0, 0.08);
    --surface-hover: rgba(255, 100, 0, 0.15);
    --border: rgba(255, 100, 0, 0.2);
    --border-strong: rgba(255, 100, 0, 0.35);
    --glow-primary: rgba(255, 100, 0, 0.3);
    --glow-secondary: rgba(255, 200, 0, 0.2);
    --shadow-intense: 0 20px 60px rgba(255, 100, 0, 0.15);
    --gradient-hero: linear-gradient(135deg, #1a0a0a 0%, #5e2a0a 50%, #1a0a0a 100%);
    --glass-effect: rgba(255, 100, 0, 0.05);
}

/* ============================================================
   🎯 دکمه‌ی تغییر تم - شاهکار تعاملی
   ============================================================ */
.theme-toggle {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        var(--shadow-intense),
        inset 0 1px 0 var(--surface-hover);
    position: relative;
    overflow: hidden;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* انیمیشن هاله‌ی دور دکمه */
.theme-toggle::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: conic-gradient(
        from var(--angle, 0deg),
        var(--glow-primary),
        var(--glow-secondary),
        var(--glow-primary)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotate-border 4s linear infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.theme-toggle:hover::before {
    opacity: 1;
}

@keyframes rotate-border {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.theme-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 
        var(--shadow-intense),
        0 0 40px var(--glow-primary),
        0 0 80px var(--glow-secondary);
    border-color: var(--border-strong);
}

.theme-toggle:active {
    transform: rotate(360deg) scale(0.95);
}

/* آیکون داخل دکمه با انیمیشن */
.theme-toggle .icon {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
}

.theme-toggle:hover .icon {
    transform: scale(1.2) rotate(30deg);
}

/* ============================================================
   💫 افکت‌های گلاس‌مورفیسم برای کل بدنه
   ============================================================ */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 20%, var(--glow-primary) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, var(--glow-secondary) 0%, transparent 50%);
    background-attachment: fixed;
}

/* کانتینر اصلی با افکت شیشه‌ای */
.app-container {
    background: var(--glass-effect);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 32px;
    box-shadow: var(--shadow-intense);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   🌟 کارت‌ها و سرفصل‌ها با افکت‌های لوکس
   ============================================================ */
.card {
    background: var(--surface);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    background: var(--surface-hover);
    border-color: var(--border-strong);
    box-shadow: 
        var(--shadow-intense),
        0 0 30px var(--glow-primary);
}

/* ============================================================
   ✍️ تایپوگرافی سلطنتی
   ============================================================ */
h1, h2, h3, h4 {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.5s ease;
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 0 0 60px var(--glow-primary);
}

h2 {
    font-size: 2.2rem;
    font-weight: 700;
}

/* ============================================================
   🔗 لینک‌ها و دکمه‌های تعاملی
   ============================================================ */
a, .btn {
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    position: relative;
}

a:hover, .btn:hover {
    color: var(--text-primary);
    text-shadow: 0 0 20px var(--glow-primary);
}

.btn-primary {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 32px;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-intense);
}

.btn-primary:hover {
    background: var(--surface-hover);
    transform: translateY(-2px) scale(1.02);
    border-color: var(--border-strong);
    box-shadow: 
        var(--shadow-intense),
        0 0 40px var(--glow-primary);
}

/* ============================================================
   📱 اسکرول‌بار سفارشی پریمیوم
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--surface-hover);
    box-shadow: 0 0 20px var(--glow-primary);
}

/* ============================================================
   📱 واکنش‌گرایی برای موبایل
   ============================================================ */
@media (max-width: 768px) {
    .theme-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
        padding: 10px;
    }
    
    .app-container {
        padding: 16px;
        border-radius: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .card {
        padding: 16px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .theme-toggle {
        width: 38px;
        height: 38px;
        font-size: 1rem;
        padding: 8px;
    }
    
    .app-container {
        padding: 12px;
        border-radius: 16px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
}

/* ============================================================
   🎆 انیمیشن ورود (فقط یکبار)
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-container {
    animation: fadeInUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.card {
    animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }
.card:nth-child(4) { animation-delay: 0.3s; }
.card:nth-child(5) { animation-delay: 0.4s; }
.card:nth-child(6) { animation-delay: 0.5s; }

/* ============================================================
   ✨ حالت‌های خاص برای انتخاب تم
   ============================================================ */
[data-theme="dark"] .theme-toggle .icon {
    content: '🌙';
}

[data-theme="light"] .theme-toggle .icon {
    content: '☀️';
}

[data-theme="rose-gold"] .theme-toggle .icon {
    content: '🌹';
}

[data-theme="sapphire"] .theme-toggle .icon {
    content: '💎';
}

[data-theme="emerald"] .theme-toggle .icon {
    content: '🟢';
}

[data-theme="cosmic-purple"] .theme-toggle .icon {
    content: '🟣';
}

[data-theme="energy-orange"] .theme-toggle .icon {
    content: '🔥';
}

[data-theme="diamond-white"] .theme-toggle .icon {
    content: '💠';
}

[data-theme="ocean-blue"] .theme-toggle .icon {
    content: '🌊';
}

[data-theme="neon-pink"] .theme-toggle .icon {
    content: '🌸';
}

[data-theme="forest"] .theme-toggle .icon {
    content: '🌳';
}

[data-theme="sunset"] .theme-toggle .icon {
    content: '🌅';
}