/* Main Application Styles - Part 1: Variables & Base */
:root {
    --primary-color: #0ea5e9;
    --primary-dark: #0284c7;
    --primary-light: #38bdf8;
    --secondary-color: #6366f1;
    --background-dark: #0f172a;
    --background-card: #1e293b;
    --background-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --sidebar-width: 280px;
    --header-height: 70px;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', 'Segoe UI', 'Arial', sans-serif;
    background: var(--background-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--background-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-header .logo-icon {
    width: 30px;
    height: 30px;
    color: white;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--background-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: var(--error-color);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

/* Main Content */
.main-content {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 20px;
    z-index: 100;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Header Buttons */
.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--background-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.header-btn svg {
    width: 18px;
    height: 18px;
}

.header-btn .btn-icon {
    font-size: 1rem;
}

.export-btn:hover {
    background: var(--success-color);
    border-color: var(--success-color);
}

.import-btn:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--background-hover);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* Content Container */
.content-container {
    flex: 1;
    padding: 24px;
}

/* Page Sections */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Under Development Card */
.under-development {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px;
}

.dev-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: pulse-icon 2s ease-in-out infinite;
}

.dev-icon svg {
    width: 50px;
    height: 50px;
    color: white;
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.under-development h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.under-development p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-container {
        padding: 16px;
    }

    .header {
        padding: 0 16px;
    }

    .header-title h1 {
        font-size: 1.2rem;
    }

    .user-name {
        display: none;
    }

    .header-btn .btn-text {
        display: none;
    }

    .header-btn {
        padding: 8px;
    }
}

/* RTL/LTR Support */
html[dir="ltr"] .sidebar {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 1px solid var(--border-color);
}

html[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: var(--sidebar-width);
}

html[dir="ltr"] .logout-btn svg,
html[dir="ltr"] .nav-link svg {
    transform: scaleX(-1);
}

@media (max-width: 1024px) {
    html[dir="ltr"] .sidebar {
        transform: translateX(-100%);
    }

    html[dir="ltr"] .sidebar.open {
        transform: translateX(0);
    }

    html[dir="ltr"] .main-content {
        margin-left: 0;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}