/* ==========================================================================
   1. FONT DEFINITIONS (Local Assets)
   ========================================================================== */
@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('/fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- 2. فونت انگلیسی --- */
@font-face {
    font-family: 'PlusJakartaSans';
    src: url('/fonts/PlusJakartaSans/plus-jakarta-sans-v12-cyrillic-ext_latin-200.woff2') format('woff2');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PlusJakartaSans';
    src: url('/fonts/PlusJakartaSans/plus-jakarta-sans-v12-cyrillic-ext_latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PlusJakartaSans';
    src: url('/fonts/PlusJakartaSans/plus-jakarta-sans-v12-cyrillic-ext_latin-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* --- 3. فونت کره‌ای --- */
@font-face {
    font-family: 'NotoSansKR';
    src: url('/fonts/NotoSansKR/noto-sans-kr-v39-korean-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'NotoSansKR';
    src: url('/fonts/NotoSansKR/noto-sans-kr-v39-korean-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   2. DESIGN TOKENS / CSS VARIABLES (Single Source of Truth)
   ========================================================================== */
:root {
    /* فونت ها */
    --font-fa: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    --font-en: 'PlusJakartaSans', system-ui, sans-serif;
    --font-kr: 'NotoSansKR', sans-serif;
    --bg: #0B1120;
    --surface: rgba(17, 24, 39, 0.75);
    --primary: #8B5CF6;
    --accent: #EC4899;
    --text: #F8FAFC;
    --muted: #94A3B8;
    --border: rgba(255,255,255,.08);
}

/* ==========================================================================
   3. BASE / RESET RULES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background: radial-gradient(800px 600px at 20% 10%, rgba(236, 72, 153, 0.16), transparent 60%), radial-gradient(800px 600px at 80% 90%, rgba(139, 92, 246, 0.18), transparent 60%), var(--bg);
    /*background-color: var(--bg);*/
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: var(--font-fa);

    .en-title {
        font-family: var(--font-en);
    }

    .kr-title {
        font-family: var(--font-kr);
    }
}

main {
    flex: 1 0 auto;
}

/* ==========================================================================
   4. Navbar / Responsive
   ========================================================================== */

.navbar-custom {
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

    .navbar-custom.scrolled {
        background: rgba(11, 17, 32, 0.98);
        border-bottom-color: rgba(139, 92, 246, 0.25);
        box-shadow: 0 4px 32px rgba(139, 92, 246, 0.15);
    }

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
    transition: transform 0.2s ease;
}

    .navbar-brand:hover {
        color: var(--accent);
        transform: translateY(-2px);
    }


.brand-subtitle {
    display: block;
    font-size: 0.65rem;
    opacity: 0.6;
    font-weight: 400;
    margin-top: -2px;
}





.brand-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: transparent; /* یا حذف این خط */
}

.brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.brand-text {
    font-family: var(--font-en);
    letter-spacing: -0.02em;
}

.nav-link {
    color: var(--text);
    font-weight: 500;
    padding: 0.5rem 1.15rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    text-decoration: none;
    opacity: 0.85;
}

    .nav-link:hover {
        color: var(--accent);
        background: rgba(34, 211, 238, 0.08);
        opacity: 1;
    }

    .nav-link.active {
        opacity: 1;
    }

@media (min-width: 992px) {
    .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: -12px;
        right: 50%;
        transform: translateX(50%);
        width: 48px;
        height: 3px;
        background: var(--accent);
        border-radius: 2px;
    }
}

.btn-custom {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-register {
    background: transparent;
    color: var(--text);
    border: 1.5px solid rgba(139, 92, 246, 0.4);
}

    .btn-register:hover {
        background: rgba(139, 92, 246, 0.15);
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-1px);
    }

.btn-login {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: var(--text);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

    .btn-login:hover {
        box-shadow: 0 6px 24px rgba(139, 92, 246, 0.5);
        transform: translateY(-2px);
        color: var(--text);
    }

.navbar-toggler {
    border: 1px solid rgba(139, 92, 246, 0.4);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

    .navbar-toggler:hover {
        border-color: var(--primary);
        background: rgba(139, 92, 246, 0.15);
    }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(248, 250, 252, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
    outline: none;
}

@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(17, 24, 39, 0.98);
        border: 1px solid rgba(139, 92, 246, 0.2);
        border-radius: 12px;
        padding: 1.5rem;
        margin-top: 1rem;
        backdrop-filter: blur(16px);
    }

    .nav-link {
        padding: 0.75rem 1rem;
        margin-bottom: 0.25rem;
    }

    .auth-buttons {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(139, 92, 246, 0.2);
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-custom {
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 992px) {
    .auth-buttons {
        display: flex;
        gap: 0.75rem;
        align-items: center;
    }
}

.nav-link:focus-visible,
.btn-custom:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* منوی کاربر */
.user-menu {
    margin-right: 1rem;
}

.btn-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0.375rem 1rem 0.375rem 0.5rem;
    color: var(--text);
    font-family: var(--font-fa);
    transition: all 0.3s ease;
}

    .btn-user:hover {
        background: rgba(139, 92, 246, 0.1);
        border-color: var(--primary);
    }

.user-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    max-width: 160px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.user-email {
    font-size: 0.75rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Dropdown */
.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.dropdown-item {
    color: var(--text);
    font-family: var(--font-fa);
    font-size: 0.9rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .dropdown-item:hover {
        background: rgba(139, 92, 246, 0.15);
        color: var(--primary);
    }

    .dropdown-item.text-danger:hover {
        background: rgba(239, 68, 68, 0.1);
        color: #ef4444;
    }

.dropdown-divider {
    border-color: var(--border);
    margin: 0.5rem 0;
}

/* موبایل */
@media (max-width: 991px) {
    .user-menu {
        margin: 1rem 0 0 0;
        width: 100%;
    }

    .btn-user {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }

    .user-info {
        max-width: none;
        flex: 1;
    }

    .dropdown-menu {
        width: 100%;
        position: static !important;
        transform: none !important;
        margin-top: 0.5rem;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--bg) 0%, rgba(11, 17, 32, 0.98) 100%);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-title {
    font-family: var(--font-en);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.footer-subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

.footer-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.75rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

    .footer-links a {
        color: var(--muted);
        text-decoration: none;
        font-size: 0.875rem;
        transition: color 0.2s ease;
    }

        .footer-links a:hover {
            color: var(--accent);
        }

/* شبکه‌های اجتماعی */
.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

    .social-link:hover {
        background: rgba(236, 72, 153, 0.1);
        border-color: var(--accent);
        color: var(--accent);
        transform: translateY(-2px);
    }

/* نماد اعتماد و کپی‌رایت */
.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 1.5rem;
    gap: 2rem;
}

.trust-badges {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.trust-badge {
    display: block;
    transition: opacity 0.2s ease;
}

    .trust-badge:hover {
        opacity: 0.8;
    }

.trust-badge-img {
    height: 80px;
    width: auto;
    object-fit: contain;   
}

.copyright {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 991px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-section:first-child {
        grid-column: 1 / -1;
        text-align: center;
    }
}

@media (max-width: 575px) {
    .site-footer {
        padding: 2rem 0 1rem;
        margin-top: 3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }

    .footer-section:first-child {
        grid-column: 1;
    }

    .footer-links {
        align-items: center;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        gap: 1.5rem;
        text-align: center;
    }

    .trust-badges {
        justify-content: center;
    }

    .trust-badge-img {
        height: 70px;
    }
}
