/* =================================
   1. RESET & BASE STYLES (All-Black Theme)
   ================================= */
:root {
    --color-bg: #000000;         /* مشکی مطلق */
    --color-text-primary: #FFFFFF; /* سفید برای متن اصلی */
    --color-text-secondary: #AAAAAA; /* خاکستری برای جزئیات */
    --color-accent: #2C3E50;    /* آبی تیره/خاکستری برای جداکننده‌ها و هاور */
    --color-border: #1A1A1A;    /* مرزهای بسیار تیره */
    --font-main: 'Vazirmatn', sans-serif;
    --font-tech: 'Orbitron', sans-serif;
    --transition-speed: 0.4s;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-main);
    direction: rtl; /* تنظیم پیش‌فرض برای فارسی */
}

/* =================================
   2. DASHBOARD LAYOUT
   ================================= */
#dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
#sidebar {
    width: 250px;
    background-color: var(--color-border);
    padding: 20px 10px;
    border-left: 1px solid var(--color-accent);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-accent);
}

.logo h1 {
    font-family: var(--font-tech);
    font-size: 24px;
    color: var(--color-text-primary);
}

.lang-switch {
    display: block;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 5px;
    transition: color var(--transition-speed);
}
.lang-switch:hover {
    color: var(--color-text-primary);
}

/* Navigation Styling */
#sidebar nav ul {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    position: relative;
    overflow: hidden;
}

.nav-item .nav-text {
    margin-right: 15px;
    font-weight: 700;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

/* Active/Hover States */
.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05); /* هاور ظریف */
    color: var(--color-text-primary);
}

.nav-item.active {
    background-color: var(--color-accent);
    color: var(--color-text-primary);
    border-right: 3px solid #008CBA; /* خط آبی ملایم برای تاکید - جایگزین نئون */
}

.user-info {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--color-accent);
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Main Content Area */
#content-area {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
}

/* Page Content Wrapper for Transitions (The key for "خفن‌تر") */
#page-content-wrapper {
    position: relative;
    min-height: 100%;
    transition: opacity var(--transition-speed) ease-in-out, transform var(--transition-speed) ease-in-out;
}

.content-visible {
    opacity: 1;
    transform: translateY(0);
}

.content-hidden {
    opacity: 0;
    transform: translateY(20px); /* حرکت کمی به پایین هنگام محو شدن */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none; /* برای اینکه محتوای قبلی کلیک نشود */
}

/* =================================
   3. GENERIC CONTENT STYLES (Modules/Cards)
   ================================= */
.content-page {
    padding: 10px 0;
}

.page-title {
    font-family: var(--font-tech);
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.module-card {
    background-color: var(--color-border);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--color-accent);
    transition: box-shadow 0.3s, transform 0.3s;
}

.module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(0, 140, 186, 0.1); /* سایه بسیار ظریف آبی */
}

.module-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #00BFFF; /* یک آبی بسیار ملایم برای تیتر ماژول‌ها */
    font-family: var(--font-tech);
}

.module-card p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* =================================
   4. RESPONSIVENESS (Mobile Optimization)
   ================================= */
@media (max-width: 992px) {
    #sidebar {
        width: 70px;
    }
    .nav-text {
        display: none; /* پنهان کردن متن در موبایل */
    }
    .logo h1 {
        font-size: 20px;
    }
    .nav-item {
        justify-content: center;
    }
    #dashboard-container {
        flex-direction: column;
    }
    #content-area {
        padding: 15px;
    }
    .user-info {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .module-grid {
        grid-template-columns: 1fr;
    }
}

/* RTL Support for English Content */
.lang-en #sidebar {
    direction: ltr;
}
.lang-en .nav-item .nav-text {
    margin-right: 0;
    margin-left: 15px;
}
.lang-en .page-title {
    text-align: left;
}
