    /* --- تنظیمات متغیرها (رنگ‌بندی پزشکی مدرن) --- */
:root {
    --primary-color: #0d9488; /* سبز کله‌غازی مدرن */
    --primary-light: #ccfbf1;
    --primary-dark: #0f766e;
    --bg-app: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --nav-height: 70px; /* ارتفاع نوار پایین */
    --nav-bg: rgba(255, 255, 255, 0.85); /* شیشه‌ای */
    --shadow-nav: 0 -4px 20px rgba(0, 0, 0, 0.05);
    --transition-active: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-app);
    font-family: 'Vazirmatn', sans-serif;
    padding-bottom: 80px; /* فضای خالی برای نوار پایین در موبایل */
    overflow-x: hidden;
}

/* --- استایل تب‌ها در دسکتاپ (بالا) --- */
.nav-tabs {
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
    margin-bottom: 25px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 12px;
    transition: var(--transition-active);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tabs .nav-link i {
    font-size: 1.1rem;
}

.nav-tabs .nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-dark);
}

.nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(139, 148, 13, 0.3);
}


/* --- استایل نوار ناوبری موبایل (پایین صفحه - Native Style) --- */
/* --- نوار ناوبری پایین موبایل (Native Style) --- */
/* --- استایل کانتینر تب‌ها --- */
.patient-nav-container {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
    position: relative;
    width: 100%;
}

.patient-nav-container .nav-tabs {
    border-bottom: none;
    margin: 0;
    padding: 0;
}

.patient-nav-container .nav-link {
    border: none;
    border-radius: 0;
    color: #64748b;
    font-size: 0.85rem;
    padding: 12px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
    width: 100%;
}

.patient-nav-container .nav-link i {
    font-size: 1.2rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.patient-nav-container .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    font-weight: 700;
}

.patient-nav-container .nav-link.active i {
    transform: scale(1.2); /* بزرگ شدن آیکون */
}

/* نقطه نشانگر زیر تب فعال */
.patient-nav-container .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 10px 10px 0 0;
}

/* --- حالت دسکتاپ (تب‌ها در بالا) --- */
@media (min-width: 769px) {
    .patient-nav-container {
        margin-bottom: 20px;
    }
    
    .patient-nav-container .nav-link {
        padding: 12px 20px;
        flex-direction: row; /* آیکون و متن کنار هم */
        gap: 8px;
    }
    
    .patient-nav-container .nav-link.active::after {
        bottom: -2px;
        width: 100%;
        border-radius: 4px 4px 0 0;
    }
}

/* --- حالت موبایل (تب‌ها در پایین - اپ نیتیو) --- */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(var(--nav-height) + 90px); /* فضای خالی پایین صفحه */
    }

.patient-nav-container {
     
        position: fixed;
        bottom: 20px; /* فاصله از پایین صفحه */
        left: 50%;
        transform: translateX(-50%); /* وسط چین کردن دقیق */
        
        /* استایل کپسولی شناور */
        width: 92%;
        max-width: 400px;
        height: 65px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        
        border-radius: 24px; /* گوشه‌های کاملاً گرد */
        box-shadow: 0 0 30px -5px rgba(44, 44, 14, 0.918), 
                    0 0 0 1px rgba(255, 255, 255, 0.5) inset; /* حاشیه داخلی ظریف */
        
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 10px;
        z-index: 1050;
    padding-bottom: env(safe-area-inset-bottom); /* برای آیفون‌های جدید */


    }
    
    .patient-nav-container .nav-item {
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    .patient-nav-container .nav-link {
        width: 100%;
        height: 100%;
        padding: 0;
        flex-direction: column;
        gap: 2px;
    }
    
    .patient-nav-container .nav-text {
        font-size: 0.65rem;
        opacity: 0.7;
        font-weight: 500;
        transition: opacity 0.3s;
    }
    
    .patient-nav-container .nav-link.active::after {
        width: 4px;
        height: 4px;
        border-radius: 50%;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        box-shadow: 0 0 5px var(--primary-color);
    }
}


/* --- کارت‌ها و محتوا --- */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    background: #fff;
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 20px;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* --- دکمه‌ها --- */
.btn {
    border-radius: 14px;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.2s;
}

.btn-success {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.25);
}

.btn-success:active {
    transform: scale(0.98);
}

/* --- فرم‌ها --- */
.form-control, .form-select {
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

/* --- انیمیشن باز شدن تب‌ها --- */
.tab-pane {
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ریسپانسیو --- */
@media (min-width: 769px) {
    .mobile-bottom-nav {
        display: none !important;
    }
    body {
        padding-bottom: 0;
    }
}



    /* --- استایل‌های جدید برای بخش ورود و ثبت نام (Native Feel) --- */
    
    /* دکمه‌های هدر برای حالت مهمان */
    #auth-buttons {
        display: flex;
        gap: 8px;
    }
    .auth-btn-icon {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255,255,255,0.3);
        background: rgba(255,255,255,0.1);
        color: white;
        transition: all 0.2s;
    }
    .auth-btn-icon:hover { background: rgba(255,255,255,0.2); transform: scale(1.05); }
    .auth-btn-icon i { font-size: 1.1rem; }

    /* لایه تمام صفحه اورلی */
    .auth-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(5px);
        z-index: 2000;
        display: none; /* مخفی به صورت پیش‌فرض */
        align-items: flex-end; /* در موبایل از پایین باز شود */
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    /* پنل فرم */
    .auth-panel {
        background: #fff;
        width: 100%;
        max-width: 500px;
        border-radius: 24px 24px 0 0;
        padding: 30px 20px;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* حالت فعال (نمایش) */
    .auth-overlay.show { display: flex; opacity: 1; }
    .auth-overlay.show .auth-panel { transform: translateY(0); }

    /* هدر پنل فرم */
    .auth-header {
        text-align: center;
        margin-bottom: 25px;
        position: relative;
    }
    .auth-header h4 { font-weight: 800; color: var(--primary-dark); margin-bottom: 5px; }
    .auth-header p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
    .auth-close-btn {
        position: absolute;
        left: 0;
        top: 0;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #f1f5f9;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        cursor: pointer;
        transition: 0.2s;
    }
    .auth-close-btn:hover { background: #e2e8f0; color: #000; }

    /* استایل اینپوت‌ها */
    .native-input-group {
        position: relative;
        margin-bottom: 15px;
    }
    .native-input {
        width: 100%;
        padding: 16px 15px 16px 45px; /* فضای آیکون در چپ */
        background: var(--input-bg);
        border: 2px solid transparent;
        border-radius: 16px;
        font-size: 1rem;
        font-family: inherit;
        transition: all 0.3s;
        box-sizing: border-box;
        outline: none;
    }
    .native-input:focus {
        background: #fff;
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
    }
    .input-icon {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-muted);
        font-size: 1.1rem;
        transition: 0.3s;
    }
    .native-input:focus + .input-icon { color: var(--primary-color); }
    
    /* دکمه ارسال */
    .native-btn {
        width: 100%;
        padding: 16px;
        border-radius: 16px;
        border: none;
        font-weight: 700;
        font-size: 1rem;
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
        box-shadow: 0 8px 20px rgba(13, 148, 136, 0.3);
        transition: transform 0.1s, box-shadow 0.2s;
        margin-top: 10px;
    }
    .native-btn:active { transform: scale(0.98); box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2); }
    
    /* لینک تغییر وضعیت */
    .auth-switch {
        text-align: center;
        margin-top: 20px;
        font-size: 0.9rem;
        color: var(--text-muted);
    }
    .auth-switch a {
        color: var(--primary-color);
        font-weight: 700;
        text-decoration: none;
        margin-right: 5px;
    }
    
    
    /* چت تمام صفحه در موبایل */
    @media (max-width: 768px) {
    #active-chat-panel {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1050 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        height: 100vh !important;
    }

    #active-chat-panel .card-body {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100vh - 56px) !important;
        padding: 0 !important;
    }

    .chat-box {
        flex: 1 !important;
        height: auto !important;
        overflow-y: auto !important;
        padding-bottom: 10px !important;
    }

    /* بخش ورودی - دقیقاً زیر چت باکس و تمیز */
    #active-chat-panel .p-3.bg-white.border-top {
        padding: 12px 15px !important;
        margin: 0 !important;
        background: #fff !important;
        border-top: 1px solid #ddd !important;
        flex-shrink: 0;   /* مهم */
    }

    /* بهبود ظاهر input و دکمه */
    #active-chat-panel .input-group {
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        border-radius: 12px !important;
        overflow: hidden;
    }

    #order-chat-input {
        border: none !important;
        padding: 14px 16px !important;
        font-size: 15.5px !important;
    }

    #active-chat-panel .btn-success {
        padding: 0 20px !important;
        border-radius: 0 12px 12px 0 !important;
    }
}


/* استایل هایلایت خطا */
.is-invalid-focus {
    border: 2px solid #ef4444 !important; /* رنگ قرمز جذاب */
    background-color: #fef2f2 !important; /* پس زمینه خیلی کم رنگ قرمز */
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important; /* هاله نورانی */
    transition: all 0.3s ease;
    animation: shake 0.4s ease-in-out; /* انیمیشن لرزش برای جلب توجه */
}

/* انیمیشن لرزش */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}



/* ===== دکمه کاربر ===== */
.btn-user {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-user:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}


/* ===== Dropdown Menu ===== */
.custom-dropdown {
     direction: rtl;
    text-align: right;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-dropdown .dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.custom-dropdown .dropdown-item:hover {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    transform: translateX(3px);
}


/* ===== بخش خدمات با سربرگ ===== */
.services-container {
    margin-top: 1.5rem;
}

.services-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.services-tabs .nav-link {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border: 2px solid transparent;
    border-radius: 25px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.services-tabs .nav-link:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.services-tabs .nav-link.active {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border-color: #1e40af;
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}

.services-tabs .nav-link i {
    font-size: 1rem;
}

/* محتوای تب‌ها */
.tab-content .tab-pane {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* لیست خدمات در هر تب */
.services-list-group .list-group-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1rem;
    padding: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.services-list-group .list-group-item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.services-list-group .list-group-item .bg-light {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
}

.services-list-group .quantity-control {
    border-radius: 20px;
    padding: 0.25rem;
}

.services-list-group .quantity-control button {
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Badge تعداد خدمات در هر دسته */
.category-badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.services-tabs .nav-link.active .category-badge {
    background: rgba(255, 255, 255, 0.4);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .services-tabs {
        gap: 0.4rem;
    }
    
    .services-tabs .nav-link {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
    
    .services-list-group .list-group-item {
        padding: 0.75rem;
    }
    
    .services-list-group .list-group-item h6 {
        font-size: 0.95rem;
    }
}


/* ===== ریسپانسیو موبایل ===== */


/*=====pwa ======*/

 /* مودال نصب */
        #install-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            color: white;
            text-align: center;
            padding: 20px;
        }
        
        #install-modal.hidden {
            display: none;
        }
        
        .install-icon {
            font-size: 80px;
            margin-bottom: 30px;
            animation: bounce 2s infinite;
        }
        
        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {
                transform: translateY(0);
            }
            40% {
                transform: translateY(-30px);
            }
            60% {
                transform: translateY(-15px);
            }
        }
        
        .install-btn {
            background: white;
            color: #667eea;
            border: none;
            padding: 15px 40px;
            border-radius: 50px;
            font-size: 18px;
            font-weight: bold;
            margin-top: 20px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }
        
        .install-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.3);
        }
        
        .instructions {
            background: rgba(255,255,255,0.1);
            padding: 20px;
            border-radius: 15px;
            margin-top: 20px;
            max-width: 500px;
        }
        
        .instructions ol {
            text-align: right;
            padding-right: 20px;
        }
        
        .instructions li {
            margin: 10px 0;
        }
        
        /* محتوای اصلی سایت */
        #pwa-main-content {
            display: none;
        }
        
        #pwa-main-content.visible {
            display: block;
        }

/*=====end pwa =====*/
/* انیمیشن خط مسیر */
.animated-route {
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* استایل خط در حالت hover */
.leaflet-interactive:hover {
    stroke-width: 6px;
    stroke: #2980b9;
}



/*custom map marker*/
/* استایل مارکرهای نقشه */


.tracking-info-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tracking-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.stat-box {
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-2px);
}

.progress-section {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.progress-bar {
    transition: width 0.5s ease;
}

.tracking-actions .btn {
    font-size: 0.9rem;
}