/* ریست پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* فونت فارسی از Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    background: #f0f2f5;
    direction: rtl;
    line-height: 1.6;
    padding: 15px;
    min-height: 100vh;
}

/* کانتینر اصلی */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 40px;
    position: relative;
}

/* هدر */
.header {
    text-align: center;
    padding: 15px 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 15px;
}

.header h1 {
    color: #2c3e50;
    font-size: 22px;
    margin-bottom: 8px;
}

.header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* منوی همبرگری برای موبایل */
.menu-toggle {
    display: none;
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin: 10px auto;
    width: 100%;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.menu-toggle:hover {
    background: #2980b9;
}

/* منوی ناوبری اصلی */
.navbar {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-links li {
    flex: 1;
    min-width: 120px;
}

.nav-links li a {
    display: block;
    padding: 10px 15px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
    text-align: center;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links li a:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.nav-links li a.active {
    background: #2c3e50;
}

.nav-links li a.logout {
    background: #e74c3c;
}

.nav-links li a.logout:hover {
    background: #c0392b;
}

/* منوی موبایل (مخفی شده) */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.mobile-menu-header h3 {
    color: #2c3e50;
    margin: 0;
}

.close-menu {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.mobile-nav-links {
    list-style: none;
}

.mobile-nav-links li {
    margin-bottom: 8px;
}

.mobile-nav-links li a {
    display: block;
    padding: 12px 15px;
    background: #f8f9fa;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    border-right: 4px solid transparent;
}

.mobile-nav-links li a:hover,
.mobile-nav-links li a.active {
    background: #3498db;
    color: white;
    border-right-color: #2980b9;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* انتخاب آپارتمان */
.apartment-selector {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.apartment-selector select {
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    min-width: 200px;
    max-width: 100%;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

/* اطلاعیه‌ها */
.notice {
    background: #fff3cd;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-right: 4px solid #ffc107;
}

.alert {
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

/* محتوا */
.content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    min-height: 300px;
}

/* صفحه ورود */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 22px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-form input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.login-form input:focus {
    outline: none;
    border-color: #3498db;
}

.login-form button {
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
}

.login-form button:hover {
    background: #2980b9;
}

/* داشبورد */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    border-color: #3498db;
}

.dashboard-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 16px;
}

.dashboard-card p {
    color: #7f8c8d;
    margin-bottom: 12px;
    font-size: 14px;
    min-height: 40px;
}

.dashboard-card .btn {
    display: inline-block;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
    font-size: 14px;
}

.dashboard-card .btn:hover {
    background: #2980b9;
}

/* ========================================================================== */
/* 📱 استایل‌های موبایل (صفحه با عرض کمتر از 768px) */
/* ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 8px;
    }
    
    .header h1 {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .header p {
        font-size: 13px;
    }
    
    /* مخفی کردن منوی اصلی در موبایل */
    .nav-links {
        display: none;
    }
    
    /* نمایش دکمه همبرگری */
    .menu-toggle {
        display: block;
        padding: 24px;
    }
    
    /* تنظیمات منوی موبایل */
    .mobile-menu {
        display: block;
        
    }
    
    .navbar {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .apartment-selector {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .apartment-selector select {
        min-width: 100%;
        font-size: 26px;
    }
    
    .notice {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .alert {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .content {
        padding: 15px;
        min-height: 200px;
    }
    
    .login-page {
        padding: 10px;
    }
    
    .login-box {
        padding: 25px 20px;
    }
    
    .login-box h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .dashboard-card {
        padding: 15px;
    }
    
    .dashboard-card h3 {
        font-size: 15px;
    }
    
    .dashboard-card p {
        font-size: 13px;
        min-height: 35px;
    }
}

/* موبایل‌های بسیار کوچک */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .mobile-menu {
        width: 100%;
    }
    
    .login-box {
        padding: 20px 15px;
    }
    
    .dashboard-card {
        padding: 12px;
    }
}