@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

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

:root {
    --primary: #1a5c2a;
    --primary-dark: #0e3d1a;
    --primary-light: #2d8a45;
    --gold: #c9a84c;
    --gold-light: #e0c97a;
    --bg: #0a0f0a;
    --bg-card: rgba(17, 26, 17, 0.7);
    --bg-card-solid: #111a11;
    --bg-glass: rgba(17, 26, 17, 0.4);
    --text: #e8e8e8;
    --text-muted: #9ca89c;
    --border: rgba(42, 58, 42, 0.6);
    --border-solid: #2a3a2a;
    --glass-blur: 20px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
    --primary: #1a7a30;
    --primary-dark: #145a24;
    --primary-light: #22a044;
    --gold: #b08a30;
    --gold-light: #d4a840;
    --bg: #f0f2f0;
    --bg-card: rgba(255, 255, 255, 0.55);
    --bg-card-solid: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.45);
    --text: #1a2a1a;
    --text-muted: #5a6a5a;
    --border: rgba(0, 0, 0, 0.08);
    --border-solid: #d0d8d0;
    --glass-blur: 24px;
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.8;
    overflow-x: hidden;
    transition: background-color 0.4s, color 0.4s;
}

a { text-decoration: none; color: inherit; }

/* GLASS CARD UTILITY */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    box-shadow: var(--glass-shadow);
}

/* HEADER */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}
header.scrolled { box-shadow: var(--glass-shadow); }

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.logo-text { font-size: 16px; font-weight: 700; line-height: 1.4; }
.logo-text span { display: block; font-size: 12px; font-weight: 400; color: var(--gold); }

.header-right { display: flex; align-items: center; gap: 12px; }

nav { display: flex; align-items: center; gap: 8px; }
nav a {
    padding: 8px 18px; border-radius: 8px;
    font-size: 14px; font-weight: 500;
    color: var(--text-muted); transition: all 0.3s ease;
}
nav a:hover, nav a.active { color: var(--text); background: var(--bg-glass); }
nav a.active { color: var(--gold); }

.mobile-toggle {
    display: none; background: none; border: none;
    color: var(--text); font-size: 24px; cursor: pointer; padding: 8px;
}

/* THEME SWITCH */
.theme-switch {
    display: flex; align-items: center; gap: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: 100px; padding: 4px; position: relative;
    flex-shrink: 0;
}
.theme-switch button {
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: transparent;
    color: var(--text-muted); font-size: 16px;
    cursor: pointer; transition: color 0.3s;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 2;
}
.theme-switch button.active { color: white; }
.theme-slider {
    position: absolute; top: 4px; right: 4px;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(26,92,42,0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}
.theme-switch[data-active="dark"] .theme-slider { transform: translateX(0); }
.theme-switch[data-active="system"] .theme-slider { transform: translateX(-38px); }
.theme-switch[data-active="light"] .theme-slider { transform: translateX(-76px); }

/* HERO */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; padding: 120px 24px 80px;
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26,92,42,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(201,168,76,0.1) 0%, transparent 60%);
}
[data-theme="light"] .hero::before {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26,122,48,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(176,138,48,0.06) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; max-width: 800px; }

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    padding: 8px 20px; border-radius: 100px;
    font-size: 13px; color: var(--gold); margin-bottom: 32px;
}
.hero-badge .dot {
    width: 8px; height: 8px;
    background: #e74c3c; border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.hero h1 {
    font-size: 48px; font-weight: 900; line-height: 1.3; margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text) 0%, var(--gold) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { font-size: 18px; color: var(--text-muted); margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 32px; border-radius: 12px;
    font-size: 15px; font-weight: 600;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer; border: none; transition: all 0.3s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; box-shadow: 0 4px 20px rgba(26,92,42,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(26,92,42,0.5); }
.btn-outline {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    color: var(--gold); border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-card); border-color: var(--gold); }
.btn-sm { padding: 8px 16px; font-size: 12px; width: auto; }

/* SECTIONS */
.section { padding: 80px 24px; max-width: 1300px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
.section-header p { font-size: 16px; color: var(--text-muted); }
.section-header .accent-line { width: 60px; height: 3px; background: linear-gradient(90deg, var(--primary), var(--gold)); margin: 16px auto 0; border-radius: 2px; }

/* LIVE CARDS */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; }
.live-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: 16px;
    border: 1px solid var(--border); overflow: hidden; transition: all 0.3s ease;
}
.live-card:hover { border-color: var(--primary-light); transform: translateY(-4px); box-shadow: var(--glass-shadow); }
.live-card .video-wrapper { position: relative; padding-top: 56.25%; background: #000; }
.live-card .video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.live-card .live-info { padding: 20px; }
.live-card .live-info h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.live-card .live-info p { font-size: 13px; color: var(--text-muted); }
.live-card .live-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(231,76,60,0.15); color: #e74c3c;
    padding: 4px 12px; border-radius: 100px;
    font-size: 12px; font-weight: 600; margin-top: 12px;
}
.live-card .live-badge .dot { width: 6px; height: 6px; background: #e74c3c; border-radius: 50%; animation: pulse 2s infinite; }

/* GALLERY */
.gallery-filters { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.filter-btn {
    padding: 8px 20px; border-radius: 100px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text-muted); font-family: 'Vazirmatn', sans-serif;
    font-size: 14px; cursor: pointer; transition: all 0.3s ease;
}
.filter-btn:hover, .filter-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.gallery-item {
    position: relative; border-radius: 16px; overflow: hidden;
    aspect-ratio: 16/10; cursor: pointer;
    border: 1px solid var(--border); transition: all 0.3s ease;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item .overlay {
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 50%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 20px; opacity: 0; transition: opacity 0.3s ease;
}
.gallery-item:hover .overlay { opacity: 1; }
.gallery-item .overlay h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.gallery-item .overlay p { font-size: 12px; color: var(--text-muted); }
.gallery-item .media-type {
    position: absolute; top: 12px; left: 12px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
    padding: 6px 12px; border-radius: 8px;
    font-size: 12px; display: flex; align-items: center; gap: 6px;
}

/* LIGHTBOX */
.lightbox {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,0.95);
    display: none; align-items: center; justify-content: center; padding: 40px;
}
.lightbox.active { display: flex; }
.lightbox-close {
    position: absolute; top: 20px; left: 20px;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    border: none; color: white;
    width: 44px; height: 44px; border-radius: 12px;
    font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 10;
}
.lightbox img { max-width: 90%; max-height: 85vh; border-radius: 12px; object-fit: contain; }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    border: none; color: white;
    width: 48px; height: 48px; border-radius: 12px;
    font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background 0.3s;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav.disabled { opacity: 0.2; pointer-events: none; }
.lightbox-prev { right: 20px; }
.lightbox-next { left: 20px; }
.lightbox-caption {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    text-align: center; color: white; font-size: 16px; font-weight: 600;
}

/* ABOUT */
.about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-text h3 { font-size: 28px; font-weight: 800; margin-bottom: 16px; }
.about-text p { color: var(--text-muted); margin-bottom: 16px; font-size: 15px; }
.about-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: 16px; padding: 24px; text-align: center;
}
.stat-card .number { font-size: 32px; font-weight: 900; color: var(--gold); display: block; }
.stat-card .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* SUPPORT */
.support-section {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border); border-radius: 20px;
    padding: 40px; margin: 60px auto; max-width: 1300px;
}
.support-section .support-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.support-section h2 { font-size: 24px; font-weight: 800; margin-bottom: 12px; }
.support-section h2 span { color: var(--gold); }
.support-section .support-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; line-height: 1.9; }
.support-links { display: flex; flex-direction: column; gap: 12px; }
.social-link {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border); border-radius: 12px;
    transition: all 0.3s; text-decoration: none;
}
.social-link:hover { border-color: var(--primary-light); transform: translateX(-4px); }
.social-link .icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.social-link .icon.bale { background: rgba(0,123,255,0.15); }
.social-link .icon.telegram { background: rgba(0,136,204,0.15); }
.social-link .icon.rubika { background: rgba(232,53,69,0.15); }
.social-link .icon.donate { background: rgba(201,168,76,0.15); }
.social-link .info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.social-link .info p { font-size: 12px; color: var(--text-muted); }
.donate-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 14px 28px; background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1a1a; border-radius: 12px; font-weight: 700; font-size: 15px;
    text-decoration: none; transition: all 0.3s; font-family: 'Vazirmatn', sans-serif;
}
.donate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(201,168,76,0.3); }
.donate-visual { text-align: center; padding: 20px; }
.donate-visual .big-icon { font-size: 72px; margin-bottom: 16px; }
.donate-visual h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: var(--gold); }
.donate-visual p { font-size: 14px; color: var(--text-muted); }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 80px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }

/* PAGE HEADER */
.page-header { padding: 140px 24px 60px; text-align: center; position: relative; }
.page-header::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(26,92,42,0.12) 0%, transparent 70%); }
.page-header h1 { font-size: 36px; font-weight: 900; position: relative; margin-bottom: 12px; }
.page-header p { color: var(--text-muted); position: relative; font-size: 16px; }

/* FOOTER */
footer {
    border-top: 1px solid var(--border);
    background: var(--bg-glass);
    backdrop-filter: blur(var(--glass-blur));
    padding: 40px 24px; margin-top: 40px;
}
.footer-inner {
    max-width: 1300px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
.footer-inner p { font-size: 13px; color: var(--text-muted); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 13px; color: var(--text-muted); transition: color 0.3s; }
.footer-links a:hover { color: var(--gold); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .mobile-toggle { display: block; }
    .header-right {
        position: fixed; top: 72px; left: 0; right: 0;
        background: var(--bg-glass); backdrop-filter: blur(var(--glass-blur));
        border-bottom: 1px solid var(--border);
    }
    nav {
        flex-direction: column; padding: 16px; gap: 4px;
        display: none;
    }
    nav.open { display: flex; }
    nav a { width: 100%; text-align: center; padding: 14px; font-size: 15px; }
    .theme-switch { margin: 12px auto 8px; justify-content: center; display: none; }
    nav.open ~ .theme-switch,
    .header-right .theme-switch.mobile-show { display: flex; }
    .live-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: 1fr; }
    .about-content { grid-template-columns: 1fr; gap: 24px; }
    .about-stats { grid-template-columns: repeat(2, 1fr); }
    .section { padding: 40px 16px; }
    .section-header h2 { font-size: 24px; }
    .section-header p { font-size: 14px; }
    .support-section .support-inner { grid-template-columns: 1fr; }
    .support-section { padding: 24px; margin: 32px 16px; }
    .page-header h1 { font-size: 28px; }
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
    .chat-widget { bottom: 16px; left: 16px; }
    .chat-box { width: calc(100vw - 32px); left: 0; bottom: 65px; height: 70vh; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 24px; }
    .stat-card .number { font-size: 24px; }
    .about-stats { grid-template-columns: 1fr; }
}
