@import url(./iransans.css);
@import url(./yekan.css);
:root {
    /* --- پالت رنگی برند (پیش‌فرض تاریک: طلایی و سرمه‌ای) --- */
    --gold-primary: #ffd966;
    --gold-glow: rgba(255, 217, 102, 0.25);
    
    --color-btc: #F7931A;
    --color-forex: #25D366;
    --color-silver: #E0E0E0;

    /* --- پالت پس‌زمینه و متون (تم تاریک) --- */
    --bg-dark: #0b1121;
    --surface-dark: rgba(23, 37, 84, 0.4);
    --header-bg: rgba(11, 17, 33, 0.85);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);

    /* --- تنظیمات افکت‌ها --- */
    --backdrop: blur(16px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 10px 40px -10px rgba(0,0,0,0.5);
}

/* * ------------------------------------------------------------------
 * 2. GLOBAL RESET & BASE
 * ------------------------------------------------------------------
 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: IRANSansX;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
button { font-family: inherit; }

/* افکت نویز سینمایی */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    transition: opacity 0.5s;
}
body.light-mode .noise-overlay { opacity: 0; }

/* * ------------------------------------------------------------------
 * 3. HEADER COMPONENT
 * ------------------------------------------------------------------
 */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: var(--backdrop);
    border-bottom: 1px solid var(--border-color);
    background: var(--header-bg);
    transition: var(--transition);
}

.brand-container { display: flex; align-items: center; gap: 12px; }

.logo-icon {
    font-size: 1.8rem;
    color: var(--gold-primary);
    filter: drop-shadow(0 0 8px var(--gold-glow));
    transition: var(--transition);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.header-actions { display: flex; gap: 15px; align-items: center; }

.auth-btn {
    padding: 8px 24px;
    border-radius: 8px;
    background: rgba(255, 217, 102, 0.05);
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.auth-btn:hover {
    background: var(--gold-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--gold-glow);
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    transition: var(--transition);
}
.theme-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.1); }

/* * ------------------------------------------------------------------
 * 4. HERO & LAYOUT
 * ------------------------------------------------------------------
 */
.hero-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 140px 20px 80px;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    animation: fadeUp 1s forwards;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 600px;
    margin-bottom: 4rem;
    line-height: 1.8;
    opacity: 0;
    animation: fadeUp 1s forwards 0.3s;
}

/* * ------------------------------------------------------------------
 * 5. CARDS COMPONENT
 * ------------------------------------------------------------------
 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 900px;
    perspective: 1000px;
    margin-bottom: 4rem;
}

.market-card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
    transform-style: preserve-3d;
    position: relative;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
}

.market-card:hover { transform: translateY(-8px); }

/* رنگ‌بندی تم تاریک */
body:not(.light-mode) .card-gold:hover { border-color: var(--gold-primary); box-shadow: 0 10px 30px rgba(255, 217, 102, 0.15); }
body:not(.light-mode) .card-silver:hover { border-color: var(--color-silver); box-shadow: 0 10px 30px rgba(224, 224, 224, 0.15); }
body:not(.light-mode) .card-btc:hover { border-color: var(--color-btc); box-shadow: 0 10px 30px rgba(247, 147, 26, 0.15); }
body:not(.light-mode) .card-forex:hover { border-color: var(--color-forex); box-shadow: 0 10px 30px rgba(37, 211, 102, 0.15); }

.icon-box {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
    transition: var(--transition);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.card-action {
    display: inline-block;
    padding: 10px 28px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

body:not(.light-mode) .market-card:hover .card-action {
    background: var(--text-main);
    color: var(--bg-dark);
    border-color: var(--text-main);
}

/* * ------------------------------------------------------------------
 * 6. FOOTER COMPONENT
 * ------------------------------------------------------------------
 */
footer {
    background: rgba(11, 17, 33, 0.98);
    border-top: 1px solid var(--border-color);
    padding: 60px 5% 30px;
    position: relative;
    z-index: 10;
    margin-top: auto;
    transition: var(--transition);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-col h3 {
    color: var(--gold-primary);
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 40px;
    height: 2px;
    background: var(--gold-primary);
}

.footer-col p, .contact-list li {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 0.95rem;
}

.contact-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.contact-list i { color: var(--gold-primary); }

.footer-bottom {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.7;
}

/* * ------------------------------------------------------------------
 * 7. LIGHT THEME OVERRIDES
 * ------------------------------------------------------------------
 */
body.light-mode {
    background-color: #f8fafc;
    color: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --header-bg: rgba(255, 255, 255, 0.9);
    --gold-primary: #0056b3;  /* آبی اقیانوسی */
    --gold-glow: rgba(0, 86, 179, 0.2);
}

body.light-mode header { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
body.light-mode .theme-btn:hover { background: rgba(0,0,0,0.05); color: var(--gold-primary); }

body.light-mode .auth-btn {
    background: transparent;
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}
body.light-mode .auth-btn:hover {
    background: var(--gold-primary);
    color: #ffffff;
    box-shadow: 0 5px 15px var(--gold-glow);
}

body.light-mode .market-card {
    background: #ffffff;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    border-color: var(--border-color);
    backdrop-filter: none;
}
body.light-mode .market-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
    border-color: var(--gold-primary);
}

body.light-mode .card-action {
    width: 100%;
    border: none;
    font-weight: 700;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
body.light-mode .card-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

body.light-mode .card-gold .card-action { background: var(--gold-primary); }
body.light-mode .card-silver .card-action { background: #757575; }
body.light-mode .card-btc .card-action { background: var(--color-btc); }
body.light-mode .card-forex .card-action { background: var(--color-forex); }

body.light-mode footer { background: #ffffff; border-top: 1px solid var(--border-color); }

/* Canvas in light mode */
body.light-mode #bg-canvas { opacity: 0.3; }

/* * ------------------------------------------------------------------
 * 8. RESPONSIVE & ANIMATIONS
 * ------------------------------------------------------------------
 */
@media (max-width: 768px) {
    .cards-grid { grid-template-columns: 1fr; padding: 0 10px; }
    .hero-title { font-size: 2.5rem; }
    header { padding: 1rem; }
    .auth-btn { padding: 6px 16px; font-size: 0.8rem; }
    .hero-section { padding-top: 100px; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    z-index: 0;
    transition: opacity 0.5s;
}