/* فونت فارسی وزیر */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --primary-color: #4e54c8;
    --secondary-color: #8f94fb;
    --success-color: #11998e;
    --danger-color: #eb3349;
    --warning-color: #f093fb;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.8;
}

/* نوار ناوبری */
.navbar {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color)) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

/* کارت‌ها */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.card-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 700;
    border: none;
    padding: 1.2rem;
    font-size: 1.1rem;
}

.card-body {
    padding: 2rem;
}

/* دکمه‌ها */
.btn {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Vazirmatn', sans-serif;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 15px rgba(78, 84, 200, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 84, 200, 0.6);
}

.btn-success {
    background: linear-gradient(to right, #11998e, #38ef7d);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.4);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.6);
}

/* فرم‌ها */
.form-control {
    border-radius: 15px;
    padding: 15px 20px;
    border: 2px solid #e1e1e1;
    font-family: 'Vazirmatn', sans-serif;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 84, 200, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

/* پیام‌های اطلاع‌رسانی */
.alert {
    border-radius: 15px;
    border: none;
    font-weight: 500;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* صفحه اصلی */
.hero-section {
    background: white;
    border-radius: 30px;
    padding: 4rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
    margin-top: 3rem;
}

.hero-section h1 {
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.hero-section p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* آیکون‌ها */
.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* فوتر */
.footer {
    text-align: center;
    padding: 2rem;
    color: white;
    margin-top: 3rem;
    font-size: 0.9rem;
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 1rem;
        margin-top: 1rem;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* انیمیشن لودینگ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.6s ease forwards;
}

/* استایل خاص برای داشبورد */
.dashboard-stat {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 1rem;
}

.dashboard-stat h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.dashboard-stat p {
    font-size: 1rem;
    opacity: 0.9;
}

/* ============================================= */
/* استایل‌های تقویم شمسی (jalalidatepicker) */
/* ============================================= */

.jdp, .jdp * {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif !important;
}

.jdp-container .jdp {
    background: white;
    border-radius: 28px !important;
    box-shadow: 0 20px 35px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.02) !important;
    border: none !important;
    overflow: hidden;
    width: 320px;
    transition: all 0.2s ease;
}

.jdp .jdp-header {
    background: linear-gradient(120deg, #6c5ce7, #a363d9) !important;
    padding: 16px 12px !important;
    color: white !important;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.jdp .jdp-header i {
    font-style: normal;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 40px;
    transition: 0.2s;
    cursor: pointer;
}

.jdp .jdp-header i:hover {
    background: rgba(255,255,255,0.4);
}

.jdp .jdp-weekdays {
    background: #f9f9fc;
    padding: 14px 0 8px 0;
    border-bottom: 1px solid #efefef;
}

.jdp .jdp-weekdays span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4b4b6e;
    text-transform: none;
}

.jdp .jdp-days {
    padding: 8px 6px;
}

.jdp .jdp-days .jdp-cell {
    width: 42px;
    height: 38px;
    margin: 2px;
    border-radius: 40px !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    color: #1e1e2f;
    background: transparent;
}

.jdp .jdp-days .jdp-cell.jdp-current {
    background: #e0d4ff !important;
    color: #4a2f8d !important;
    font-weight: 700;
    box-shadow: none;
}

.jdp .jdp-days .jdp-cell.jdp-selected {
    background: linear-gradient(135deg, #11998e, #38ef7d) !important;
    color: white !important;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(17, 153, 142, 0.3);
    transform: scale(0.98);
}

.jdp .jdp-days .jdp-cell:hover:not(.jdp-disabled):not(.jdp-selected) {
    background: #f0eef9 !important;
    transform: scale(1.02);
    color: #4a2f8d;
}

.jdp .jdp-days .jdp-cell.jdp-disabled {
    color: #cdcddc !important;
    background: transparent;
}

.jdp .jdp-footer {
    background: #fafaff;
    border-top: 1px solid #eaeef5;
    padding: 10px;
}

.jdp .jdp-footer button {
    background: #6c5ce7;
    border: none;
    border-radius: 60px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 20px;
    color: white;
    transition: 0.2s;
    font-family: 'Vazirmatn', sans-serif;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.jdp .jdp-footer button:hover {
    background: #5a4bcf;
    transform: translateY(-1px);
}

input[data-jdp] {
    cursor: pointer;
    transition: all 0.2s;
}

input[data-jdp]:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 0.2rem rgba(108, 92, 231, 0.2);
}

@media (max-width: 640px) {
    .jdp-container .jdp {
        width: 280px;
    }
    .jdp .jdp-days .jdp-cell {
        width: 34px;
        height: 34px;
        font-size: 0.8rem;
    }
}

/* ============================================= */
/* استایل‌های مودال راهنما (کوچک‌تر و جمع‌وجور) – بدون دکمه ضربدر */
/* ============================================= */

.modal-dialog {
    max-width: 420px !important;
}

.modal-content {
    border-radius: 25px !important;
    border: none !important;
    overflow: hidden;
    box-shadow: 0 25px 40px -12px rgba(0, 0, 0, 0.35);
    animation: modalFadeIn 0.25s ease-out;
    background: rgba(255,255,255,0.98);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    border-bottom: none;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    border-radius: 25px 25px 0 0;
}

.modal-header .modal-title {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.2px;
    color: white;
}

.modal-body {
    padding: 1.2rem 1.5rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #2c3e50;
}

.modal-body ol {
    padding-right: 1.2rem;
    margin-bottom: 0.8rem;
}

.modal-body li {
    margin-bottom: 0.6rem;
    font-weight: 500;
}

.modal-body li strong {
    color: #4e54c8;
    background: #f0f0ff;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
}

.modal-footer {
    border-top: 1px solid #eef2ff;
    padding: 0.8rem 1.5rem 1.2rem;
    background: #fafcff;
    justify-content: center;
}

.modal-footer .btn-secondary {
    background: linear-gradient(145deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 50px;
    padding: 6px 22px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    transition: 0.2s;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3);
}

.modal-footer .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.4);
}

/* دکمه راهنمای فعال‌سازی داخل کارت هشدار (همرنگ کادر زرد) */
#showGuideBtn {
    background: #ffc107 !important;
    border: none !important;
    color: #856404 !important;
    font-weight: 700;
    font-size: 0.8rem;
    border-radius: 50px;
    padding: 4px 15px;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#showGuideBtn:hover {
    background: #e0a800 !important;
    color: #5a3e02 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* استایل کارت هشدار زرد */
.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-right: 4px solid #ffc107;
    font-size: 0.9rem;
    padding: 0.8rem;
}

/* ریسپانسیو مودال برای موبایل */
@media (max-width: 576px) {
    .modal-dialog {
        max-width: 340px !important;
        margin: 1rem auto;
    }
    .modal-body {
        padding: 1rem;
        font-size: 0.85rem;
    }
    .modal-header .modal-title {
        font-size: 1rem;
    }
    .modal-body li {
        margin-bottom: 0.5rem;
    }
    .modal-footer .btn-secondary {
        padding: 5px 18px;
        font-size: 0.8rem;
    }
}

/* ============================================= */
/* طراحی صفحه مدیریت داروها کاملاً هماهنگ با تم بنفش-آبی سایت */
/* ============================================= */

/* کارت‌های داروهای ضروری – هماهنگ با تم */
.essential-med {
    background: linear-gradient(145deg, #ffffff, #f5f3ff) !important;
    border-radius: 32px !important;
    border: 1px solid rgba(108, 92, 231, 0.2) !important;
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.08), 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: all 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    overflow: hidden;
    position: relative;
}

.essential-med:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 35px -12px rgba(78, 84, 200, 0.25);
    border-color: rgba(78, 84, 200, 0.4) !important;
    background: linear-gradient(145deg, #ffffff, #f0edfe) !important;
}

/* عنوان داروها با گرادیان بنفش-آبی */
.essential-med h6 {
    font-weight: 800;
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

/* جدول داروهای کاربر */
.table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table thead th {
    background: linear-gradient(145deg, #e9eaff, #dddfff);
    color: #2d3a8c;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0px;
    border: none;
    padding: 16px 20px;
}

.table tbody tr {
    background: linear-gradient(110deg, #ffffff, #fafaff);
    border-radius: 24px;
    transition: all 0.25s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.table tbody tr:hover {
    background: linear-gradient(110deg, #f2f1fe, #eceaff);
    transform: scale(1.01);
    box-shadow: 0 12px 20px -8px rgba(78, 84, 200, 0.1);
}

.table tbody td {
    padding: 16px 20px;
    font-size: 0.9rem;
    vertical-align: middle;
    border-top: none;
}

/* بج زمان مصرف دارو – آبی-بنفش ملایم */
.badge.bg-info {
    background: #e0e7ff !important;
    color: #3730a3 !important;
    font-weight: 700;
    border-radius: 60px;
    padding: 6px 16px;
    font-size: 0.75rem;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
}

/* دکمه یادآور – بنفش شاد */
.reminder-btn {
    background: #ede9fe;
    border: none;
    color: #5b21b6;
    font-weight: 700;
    border-radius: 60px;
    transition: 0.2s;
}

.reminder-btn:hover {
    background: #c4b5fd;
    color: #3b0764;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(91, 33, 182, 0.15);
}

/* دکمه افزودن دارو – گرادیان سبز-آبی (هماهنگ با دکمه موفقیت) */
.btn-light {
    background: linear-gradient(120deg, #e6f7f5, #d4f1f9);
    color: #0f766e;
    font-weight: 700;
    border: none;
}

.btn-light:hover {
    background: linear-gradient(120deg, #ccece8, #b9e4f0);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.05);
}

/* دکمه ثبت مصرف */
.btn-outline-secondary {
    border-color: #a78bfa;
    background: #f5f3ff;
    color: #4c1d95;
}
.btn-outline-secondary:hover {
    background: #ddd6fe;
    color: #2e1065;
    border-color: #8b5cf6;
}

/* فرم افزودن دارو */
.collapse .card {
    background: rgba(245, 243, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    border: 1px solid #ddd6fe;
}

/* انیمیشن ورود گرم (هماهنگ) */
.essential-med, .table tbody tr, .card {
    animation: fadeInUp 0.4s ease-out;
}
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .essential-med {
        margin-bottom: 1rem;
    }
    .table tbody td {
        padding: 10px 12px;
        font-size: 0.75rem;
    }
    .badge.bg-info {
        font-size: 0.65rem;
        padding: 3px 10px;
    }
    .btn-sm {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

/* =============================================
   استایل‌های صفحه راهنمای تغذیه (nutrition_guide)
   و حالت تاریک (بدون حذف حتی یک خط از کد اصلی)
   ============================================= */

/* دکمه حالت تاریک */
#darkModeToggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

/* تب‌های پیمایش صفحه تغذیه */
.nav-pills .nav-link {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0 4px;
    border-radius: 2rem;
}

.nav-pills .nav-link.active {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white !important;
    box-shadow: 0 4px 10px rgba(78, 84, 200, 0.4);
}

/* دایره امتیاز رژیم */
.score-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: conic-gradient(#10b981 calc(var(--score) * 3.6deg), #e2e8f0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.6rem;
    margin: 0 auto;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}

/* کادر جستجوی خودکار */
.autocomplete-items {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.autocomplete-items div {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #eee;
}

.autocomplete-items div:last-child {
    border-bottom: none;
}

.autocomplete-items div:hover {
    background-color: #f0edfe;
}

/* آیتم‌های چک‌لیست */
.checklist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fc;
    border-radius: 10px;
    padding: 12px;
    margin: 6px 0;
}

/* کارت‌های فاز پیوند */
.phase-card {
    display: none;
    border-radius: 15px;
}

.phase-card.active {
    display: block;
}

/* ============================================= */
/* حالت تاریک (dark mode) – عمومی برای کل سایت  */
/* ============================================= */
body.dark-mode {
    background: #0f172a !important;
    color: #e2e8f0;
}

.dark-mode .card {
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.dark-mode .card-header {
    background-blend-mode: overlay;
}

.dark-mode .nav-pills .nav-link {
    color: #cbd5e0;
}

.dark-mode .nav-pills .nav-link.active {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white !important;
}

.dark-mode .text-muted {
    color: #94a3b8 !important;
}

.dark-mode .alert {
    background-color: #1e293b;
    color: #e2e8f0;
}

.dark-mode .form-control {
    background: #334155;
    border-color: #475569;
    color: #e2e8f0;
}

.dark-mode .autocomplete-items {
    background: #1e293b;
    border-color: #475569;
}

.dark-mode .autocomplete-items div:hover {
    background-color: #334155;
}

.dark-mode .checklist-item {
    background: #2d3a4a;
}

.dark-mode .table {
    color: #e2e8f0;
}

.dark-mode .table thead th {
    background: #334155;
    color: #e2e8f0;
}

.dark-mode .table tbody tr {
    background: #1e293b;
}

.dark-mode .btn-light {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}