/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* رنگ‌های اصلی */
    --primary: #6366f1;
    --secondary: #ec4899;
    --accent: #06b6d4;
    
    /* پس‌زمینه */
    --bg-dark: #0f0f23;
    --bg-darker: #070714;
    --bg-card: rgba(255, 255, 255, 0.03);
    
    /* متن */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* حاشیه */
    --border: rgba(255, 255, 255, 0.1);
    
    /* گرادینت */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    
    /* سایه */
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.3);
    
    /* فونت */
    --font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    
    /* فاصله‌گذاری */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 5rem;
    
    /* گوشه‌ها */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* انیمیشن */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms var(--ease-out-expo);
    --transition-normal: 300ms var(--ease-out-expo);
    --transition-slow: 500ms var(--ease-out-expo);
    
    /* Z-Index */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 500;
    --z-loader: 9999;

        /* رنگ‌های Toast */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --primary: #6366f1;
    --primary-dark: #4f46e5;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, select, textarea {
    font-family: inherit;
}

/* ========================================
   LOADER
   ======================================== */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loader);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.loader-logo {
    width: 60px;
    height: 60px;
    color: var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

.loader-logo svg {
    width: 100%;
    height: 100%;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.loader-progress {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* ========================================
   PARTICLES CANVAS
   ======================================== */
#particlesCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ========================================
   FLOATING NAVIGATION
   ======================================== */
.floating-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    padding: var(--space-md) var(--space-lg);
}

.floating-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg);
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}

/* Hamburger */
.nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: var(--space-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    order: 1;
}

@media (min-width: 768px) {
    .nav-hamburger {
        display: none;
    }
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-normal);
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.125rem;
    order: 2;
}

/* User Section */
.nav-user {
    position: relative;
    order: 3;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: var(--transition-normal);
}

.nav-user-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-user-btn img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--border);
}

.nav-user-btn .chevron {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    transition: var(--transition-normal);
}

.nav-user-btn.active .chevron {
    transform: rotate(180deg);
}

/* Dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + var(--space-sm));
    left: 0;
    min-width: 280px;
    background: rgba(15, 15, 35, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-card);
}

.nav-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
}

.nav-dropdown-header img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.nav-dropdown-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-dropdown-info span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.nav-dropdown-info span:last-child {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-sm) 0;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-normal);
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.nav-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-dropdown-item.logout {
    color: #ef4444;
}

.nav-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Mobile Menu */
.floating-nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--bg-dark);
    border-left: 1px solid var(--border);
    padding: var(--space-3xl) var(--space-lg) var(--space-lg);
    transition: right var(--transition-slow);
    z-index: var(--z-fixed);
    overflow-y: auto;
}

.floating-nav-menu.show {
    right: 0;
}

.nav-menu-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.nav-menu-header img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.nav-menu-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-menu-info span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.nav-menu-info span:last-child {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-menu-divider {
    height: 1px;
    background: var(--border);
    margin: var(--space-md) 0;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-normal);
}

.nav-menu-item:hover,
.nav-menu-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.nav-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-menu-item.logout {
    color: #ef4444;
}

.nav-menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* Menu Overlay */
.nav-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: calc(var(--z-fixed) - 1);
}

.nav-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    padding-top: calc(70px + var(--space-2xl));
    padding-bottom: var(--space-3xl);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    padding: var(--space-xl) var(--space-lg);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}



/* ========================================
   FOOTER ENAMAD
   ======================================== */
.footer-enamad {
    display: flex;
    justify-content: center;
    margin: var(--space-lg) 0;
}

.footer-enamad a {
    display: block;
    transition: transform 0.2s ease;
}

.footer-enamad a:hover {
    transform: scale(1.05);
}

.footer-enamad img {
    height: 70px;
    border-radius: var(--radius-md);
}
@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: right;
    }
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
}

.footer-copy {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ========================================
   SELECTION
   ======================================== */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}