/* ========================================== */
/* ===== تم اصلی (فایل مادر همه استایل‌ها) ===== */
/* ========================================== */

/* ===== ریست و تنظیمات پایه ===== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: Vazirmatn, -apple-system, sans-serif !important; 
}

body {
    background-color: #f5f5f7;
    color: #1d1d1f;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
}

/* ===== افکت حباب‌های نوری پس‌زمینه ===== */
body::before, body::after {
    content: ''; 
    position: fixed; 
    border-radius: 50%; 
    filter: blur(80px); 
    z-index: -1; 
    opacity: 0.6;
    transition: background 0.3s;
}
body::before { width: 500px; height: 500px; background: #e0f2fe; top: -100px; left: -100px; }
body::after { width: 600px; height: 600px; background: #f3e8ff; bottom: -150px; right: 10vw; }

/* ===== ۱. استایل سایدبار کامل (دسکتاپ) ===== */
.desktop-nav {
    position: fixed; 
    top: 0; 
    right: 0; 
    width: 200px;
    height: 100vh;
    background-color: #ffffff; 
    border-left: 1px solid rgba(0, 0, 0, 0.05); 
    padding: 25px 15px;
    display: flex; 
    flex-direction: column; 
    align-items: flex-start;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.03); 
    z-index: 9999;
    overflow-y: auto; 
    scrollbar-width: none;
}

/* ===== مخفی کردن المان‌های موبایل در دسکتاپ ===== */
.mobile-header, .mobile-menu-overlay {
    display: none;
}

.nav-item-home {
    display: flex; 
    align-items: center; 
    gap: 12px;
    width: 100%; 
    padding: 12px 15px; 
    border-radius: 12px;
    background-color: transparent; 
    text-decoration: none;
    color: #1d1d1f; 
    font-size: 16px; 
    font-weight: 600;
    transition: all 0.2s; 
}
.nav-item-home span {
    font-size: 14px;
    font-family: inherit;
}
.nav-item-home:hover { 
    background-color: #e8f0fe; 
    color: #0071e3; 
}

/* ===== کانتینر اصلی ===== */
.main-content {
    width: 100%; 
    max-width: 700px; 
    margin: 0 auto;
    padding: 40px 20px; 
    margin-right: calc(50% - 350px + 100px); 
    position: relative; 
    z-index: 10;
}

/* ===== کارت‌های اصلی ===== */
.app-card {
    background: #ffffff; 
    border-radius: 20px; 
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02); 
    margin-bottom: 20px;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
}
.app-card:hover { box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06); }

.app-card-title {
    font-size: 16px; 
    font-weight: 800; 
    margin-bottom: 20px;
    color: #1d1d1f; 
    display: flex; 
    align-items: center; 
    gap: 8px;
}

/* ===== هدر صفحات ===== */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.page-header h1 { font-size: 28px; font-weight: 800; color: #1d1d1f; letter-spacing: -1px; }
.page-header p { font-size: 14px; color: #86868b; font-weight: 500; margin-top: 5px; }

/* ===== فرم‌ها ===== */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: #555; margin-bottom: 8px; }

input, textarea, select {
    width: 100%; 
    padding: 14px; 
    border: 1px solid #e5e5ea;
    border-radius: 12px; 
    font-family: inherit; 
    font-size: 14px;
    background: #f5f5f7; 
    color: #1d1d1f; 
    transition: all 0.2s; 
    margin-bottom: 10px;
}
input:focus, textarea:focus { 
    outline: none; 
    border-color: #0071e3; 
    background: white; 
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1); 
}

/* ===== دکمه‌ها ===== */
.btn-primary {
    background: #0071e3; 
    color: white; 
    border: none; 
    padding: 14px 20px;
    border-radius: 12px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 14px;
    transition: all 0.2s; 
    font-family: inherit;
}
.btn-primary:hover { background: #005bb5; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3); }

.btn-secondary {
    background: #f5f5f7; 
    color: #555; 
    border: none; 
    padding: 14px 20px;
    border-radius: 12px; 
    cursor: pointer; 
    font-weight: bold; 
    font-size: 14px;
    transition: all 0.2s; 
    font-family: inherit;
}
.btn-secondary:hover { background: #e5e5ea; color: #1d1d1f; }

/* ===== مودال‌ها ===== */
.modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.4); 
    backdrop-filter: blur(5px); 
    z-index: 1000; 
    justify-content: center; 
    align-items: center; 
    padding: 20px; 
}
.modal.active { display: flex; }
.modal-content { 
    background: white; 
    width: 100%; 
    max-width: 450px; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.1); 
}
.modal-header { padding: 20px; border-bottom: 1px solid #f5f5f7; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }

/* ========================================== */
/* ===== حالت تاریک (Dark Mode) ===== */
/* ========================================== */

body.dark { background-color: #0f172a; color: #e2e8f0; }
body.dark::before { background: #1e3a8a; opacity: 0.3; }
body.dark::after { background: #4c1d95; opacity: 0.3; }

body.dark .desktop-nav { background-color: #1e293b; border-left: 1px solid rgba(255, 255, 255, 0.05); }
body.dark .nav-item-home { color: #e2e8f0; }
body.dark .nav-item-home:hover { background-color: #334155; color: #60a5fa; }

body.dark .app-card { background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.05); }
body.dark .app-card-title, body.dark .page-header h1 { color: #f8fafc; }
body.dark .page-header p { color: #94a3b8; }

body.dark input, body.dark textarea, body.dark select { background: #0f172a; border-color: #334155; color: #e2e8f0; }
body.dark .form-group label { color: #cbd5e1; }

body.dark .btn-secondary { background: #334155; color: #e2e8f0; }
body.dark .btn-primary { background: #3b82f6; }

body.dark .modal-content { background: #1e293b; border: 1px solid rgba(255, 255, 255, 0.05); }
body.dark .modal-header { border-bottom-color: #334155; }
body.dark .modal-header h2 { color: #f8fafc; }

/* ========================================== */
/* ===== استایل‌های اختصاصی صفحات ===== */
/* ========================================== */

/* کارت‌های لیست (کارها و هزینه‌ها) */
#taskList li, #expenseList li {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 15px 20px !important;
    background: #f8f9fc;
    border: 1px solid #e5e5ea;
    border-radius: 14px;
    margin-bottom: 10px;
}

#taskList li input[type="checkbox"] { width: 22px !important; height: 22px !important; accent-color: #0071e3; }
#taskList li .task-body { flex: 1 !important; text-align: right; }
.delete-btn, .expense-del { background: transparent !important; border: none !important; color: #ff3b30 !important; cursor: pointer; font-size: 18px; }
.expense-amount { color: #34c759; font-weight: bold; }

body.dark #taskList li, body.dark #expenseList li { background-color: #0f172a !important; border-color: #334155 !important; }
body.dark .task-text, body.dark #taskList li span, body.dark #expenseList li .expense-desc { color: #f8fafc !important; }
body.dark .stats-toggle { color: #f8fafc !important; }
body.dark .stats-arrow { color: #f8fafc !important; }

/* آمار ماه */
body.dark .stats-card, body.dark .expense-card { background-color: #1e293b !important; border-color: #334155 !important; }
body.dark .stats-card *, body.dark .expense-card * { color: #f8fafc !important; }
body.dark #expenseTotal, body.dark #monthTotal, body.dark .expense-amount { color: #34c759 !important; }

/* یادداشت‌ها */
.note-card { background: #ffffff; border-radius: 20px; padding: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); border: 1px solid rgba(0, 0, 0, 0.02); border-right: 4px solid #0071e3; margin-bottom: 15px; }
.note-title { font-weight: 800; font-size: 16px; color: #1d1d1f; }
.note-content { font-size: 14px; color: #555; margin-top: 5px; }
body.dark .note-card { background: #1e293b !important; border-color: #334155 !important; }
body.dark .note-title { color: #f8fafc !important; }
body.dark .note-content { color: #cbd5e1 !important; }

/* تقویم */
.day-info-list { list-style: none; padding: 0; margin: 0; }
.day-info-list li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f8f9fc; border-radius: 8px; margin-bottom: 6px; font-size: 13px; color: #333; }
.day-info-total { display: flex; justify-content: space-between; padding: 10px 12px; background: #e8f8ed; border-radius: 8px; font-size: 13px; margin-top: 10px; color: #555; }
body.dark .day-info-list li { background: #0f172a !important; color: #f8fafc !important; }
body.dark .day-info-total { background: #0f172a !important; color: #cbd5e1 !important; border: 1px solid #334155; }
body.dark .calendar-month-label { color: #f8fafc !important; }

/* ماشین‌حساب */
body.dark .calc-display { background: #0f172a !important; border: 1px solid #334155 !important; }
body.dark .calc-result { color: #f8fafc !important; }
body.dark .calc-num { background: #1e293b !important; border-color: #334155 !important; color: #f8fafc !important; }

/* بازی حافظه */
body.dark .memory-stat { background-color: #1e293b !important; border: 1px solid #334155 !important; }
body.dark .memory-stat h2 { color: #f8fafc !important; }
body.dark .memory-card-front { background-color: #1e293b !important; border-color: #334155 !important; }

/* تاریخ */
body.dark #dayPrefix { color: #94a3b8 !important; }
body.dark #dateLabel { color: #f8fafc !important; }


/* ========================================== */
/* ===== 📱 واکنش‌گرایی (هدر بالای موبایل) ===== */
/* ========================================== */
@media (max-width: 900px) {
    /* مخفی کردن منوی دسکتاپ */
    .desktop-nav { display: none !important; }

    /* 🌟 نمایش نوار هدر موبایل */
    .mobile-header {
        display: flex !important;
        position: relative;
        width: 100%;
        height: 60px;
        background: #ffffff;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        box-sizing: border-box;
        border-bottom: 1px solid #e5e5ea;
        margin-bottom: 20px;
    }

    /* دکمه منو (راست) */
    .mobile-menu-btn {
        display: flex !important;
        background: #f5f5f7;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 24px;
        color: #1d1d1f;
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }

    /* عنوان وسط هدر */
    .mobile-title {
        font-weight: 800;
        font-size: 16px;
        color: #1d1d1f;
    }

    /* 🌟 دکمه تم در موبایل */
    .mobile-theme-btn {
        display: flex;
        background: #f5f5f7;
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 20px;
        color: #1d1d1f;
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }

    /* دکمه خانه (چپ) */
    .mobile-logo-btn {
        display: flex !important;
        text-decoration: none;
        font-size: 24px;
        background: #f5f5f7;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        align-items: center;
        justify-content: center;
        color: #1d1d1f;
    }

    /* منوی کشویی */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 100000;
    }
    .mobile-menu-overlay.active { display: block; }

    .mobile-menu-content {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: #ffffff;
        padding: 60px 20px 20px 20px;
        box-shadow: -5px 0 30px rgba(0,0,0,0.1);
        transition: right 0.3s ease-in-out;
        overflow-y: auto;
    }
    .mobile-menu-overlay.active .mobile-menu-content { right: 0; }
    .mobile-menu-close { background: none; border: none; font-size: 24px; color: #ff3b30; cursor: pointer; position: absolute; top: 15px; right: 20px; }

    /* محتوا */
    .main-content {
        margin-right: 0 !important;
        margin-top: 0 !important;
        padding: 0 15px 20px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* حالت تاریک هدر موبایل */
    body.dark .mobile-header {
        background: #1e293b;
        border-bottom: 1px solid #334155;
    }
    body.dark .mobile-title { color: #f8fafc; }
    body.dark .mobile-logo-btn, 
    body.dark .mobile-menu-btn,
    body.dark .mobile-theme-btn {
        background: #334155;
        color: #f8fafc;
    }
    body.dark .mobile-menu-content {
        background: #1e293b;
    }
}

/* === خط کشیدن روی متن کارهای انجام‌شده ===== */
#taskList li.done span,
#taskList li.done .task-text {
    text-decoration: line-through !important;
    color: #6b7280 !important; /* رنگ خاکستری برای متن تیک‌خورده */
    opacity: 0.7;
}


/* ===== اصلاح متن مودال جمله روز در تم تاریک ===== */
body.dark #quoteText {
    color: #cbd5e1 !important;
}

/* ===== استایل مقایسه ماه ===== */
.compare-card {
    transition: background-color 0.3s;
}

#compareResult.increase {
    background: #ffe5e0 !important;
    color: #e74c3c !important;
}

#compareResult.decrease {
    background: #e8f8ed !important;
    color: #34c759 !important;
}

#compareResult.same {
    background: #f5f5f7 !important;
    color: #86868b !important;
}

/* حالت تاریک */
body.dark .compare-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark #compareResult {
    background: #0f172a !important;
    color: #f8fafc !important;
}

body.dark #compareResult.increase {
    background: #4a2c2c !important;
    color: #ff6b6b !important;
}

body.dark #compareResult.decrease {
    background: #1e3a2e !important;
    color: #4ade80 !important;
}

body.dark #prevMonthTotal {
    color: #94a3b8 !important;
}


/* ===== استایل مقایسه ماه ===== */
.compare-card {
    transition: background-color 0.3s;
}

#compareResult.increase {
    background: #ffe5e0 !important;
    color: #e74c3c !important;
}

#compareResult.decrease {
    background: #e8f8ed !important;
    color: #34c759 !important;
}

#compareResult.same {
    background: #f5f5f7 !important;
    color: #86868b !important;
}

/* حالت تاریک برای مقایسه ماه */
body.dark .compare-card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
}

body.dark #compareResult {
    background: #0f172a !important;
    color: #f8fafc !important;
}

body.dark #compareResult.increase {
    background: #4a2c2c !important;
    color: #ff6b6b !important;
}

body.dark #compareResult.decrease {
    background: #1e3a2e !important;
    color: #4ade80 !important;
}

body.dark #prevMonthTotal {
    color: #94a3b8 !important;
}

/* ===== اصلاح دکمه‌های کشویی در تم تاریک ===== */
body.dark #statsToggle,
body.dark #compareToggle {
    color: #f8fafc !important;
}

body.dark #statsArrow,
body.dark #compareArrow {
    color: #f8fafc !important;
}

/* ===== بودجه ماهانه ===== */
.budget-card {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #bae6fd;
}

body.dark .budget-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

.budget-progress-bg {
    background: #e5e5ea;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 5px;
}

.budget-progress-fill {
    height: 100%;
    background: #34c759;
    border-radius: 6px;
    width: 0%;
    transition: width 0.4s, background-color 0.4s;
}

body.dark .budget-progress-bg {
    background: #334155;
}

/* رنگ نوار بودجه وقتی از حد گذشت */
.budget-progress-fill.warning {
    background: #ff9500;
}

.budget-progress-fill.danger {
    background: #ff3b30;
}