/* ========================================================
   1. المتغيرات الأساسية (Variables)
======================================================== */
:root {
    --primary: #0D9488;
    --primary-light: #f0fdfa;
    --dark: #0f172a;
    --bg-color: #f8fafc;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass: rgba(255, 255, 255, 0.9);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    
    /* ألوان الحالات (للمواعيد) */
    --status-pending: #f59e0b;
    --status-pending-bg: #fef3c7;
    --status-confirmed: #10b981;
    --status-confirmed-bg: #d1fae5;
    --status-rejected: #ef4444;
    --status-rejected-bg: #fee2e2;
}

/* ========================================================
   2. الإعدادات العامة (Global Reset)
======================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    padding-bottom: 90px;
    direction: rtl;
    overflow-x: hidden;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: transparent;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ========================================================
   3. شاشة التحميل (Loader)
======================================================== */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   4. الهيدر (Header)
======================================================== */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; 
    height: 65px; 
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-main);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(13, 148, 136, 0.1);
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.header-center h1 {
    font-size: 2rem; 
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    letter-spacing: 0.5px;
}

.menu-toggle {
    cursor: pointer; 
    font-size: 1.3rem; 
    color: var(--primary);
    background: rgba(255, 255, 255, 0.9); 
    border: 1px solid rgba(13, 148, 136, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 44px; 
    height: 44px; 
    border-radius: 50%; 
    box-shadow: 0 5px 15px rgba(13, 148, 136, 0.1);
}

.menu-toggle:hover, .menu-toggle.active { 
    background-color: var(--primary); 
    color: var(--white); 
    transform: rotate(-180deg) scale(1.05);
}

.login-btn {
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: var(--white);
    padding: 6px 18px; /* تم تصغير الارتفاع هنا للشاشات الكبيرة */
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.3);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 8px; 
    background: var(--white);
    padding: 4px 10px; 
    border-radius: 30px;
    border: 1px solid rgba(13, 148, 136, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-card:hover {
    background: var(--primary-light);
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
}

.user-img-placeholder {
    width: 28px; 
    height: 28px; 
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem; 
    box-shadow: 0 2px 5px rgba(13, 148, 136, 0.2);
}

.user-name {
    font-size: 0.8rem; 
    font-weight: 700;
    color: var(--text-main);
}

/* ========================================================
   5. القائمة الجانبية (Menu Overlay)
======================================================== */
.menu-backdrop {
    position: fixed; inset: 0; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px);
    z-index: 1999; 
    opacity: 0; 
    visibility: hidden; 
    transition: all 0.4s ease;
}

.menu-backdrop.active { 
    opacity: 1; 
    visibility: visible; 
}

.nav-overlay {
    position: fixed; top: 0; right: -100%; bottom: 0; 
    width: 360px; max-width: 85vw;
    background-color: var(--dark); 
    background-image: linear-gradient(to bottom, #0f172a, #042f2e);
    box-shadow: -10px 0 50px rgba(0,0,0,0.5);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    z-index: 2000; 
    display: flex; 
    flex-direction: column;
}

.nav-overlay.active { 
    right: 0; 
}

.nav-header { 
    display: flex; 
    justify-content: flex-end; 
    align-items: center; 
    padding: 25px 25px 0; 
}

.close-menu {
    position: absolute; top: 20px; left: 20px; z-index: 10;
    font-size: 1.3rem; cursor: pointer; color: var(--text-muted);
    width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background-color: rgba(255, 255, 255, 0.05); border: none; transition: all 0.4s ease;
}

.close-menu:hover { 
    color: var(--white); 
    background-color: #ef4444; 
}

.nav-links-container {
    padding: 50px 25px 20px; 
    display: flex; flex-direction: column; gap: 10px;
    overflow-y: auto;
}

.nav-links-container a {
    text-decoration: none; color: rgba(255, 255, 255, 0.85); font-size: 1.1rem; font-weight: 700;
    padding: 14px 18px; border-radius: 14px; transition: all 0.4s ease; display: flex; align-items: center; gap: 15px;
    background-color: rgba(255, 255, 255, 0.02);
}

.nav-links-container a i { 
    color: var(--primary-light); font-size: 1.1rem; background-color: rgba(13, 148, 136, 0.2); width: 40px; height: 40px; border-radius: 10px;
    display: flex; justify-content: center; align-items: center;
}

.nav-links-container a:hover { 
    background-color: rgba(255, 255, 255, 0.05); color: var(--white); transform: translateX(-5px); 
}

/* ========================================================
   6. نظام التنقل بين الأقسام (Tabs System)
======================================================== */
.tab-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   7. قسم البحث (Search Section)
======================================================== */
.search-section {
    padding: 20px;
}

.welcome-text-glass {
    text-align: right;
    margin-bottom: 25px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 15px;
    border-right: 4px solid var(--primary);
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.05);
    display: inline-block; 
}

.welcome-text-glass p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.5;
}

.search-box-wrapper {
    display: block; 
    width: 100%;
}

.main-search-bar {
    width: 100%;
    background: var(--white);
    padding: 24px 30px; 
    border-radius: 18px; 
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(13, 148, 136, 0.1);
    text-align: right;
    font-size: 1.25rem; 
    transition: var(--transition);
}

.main-search-bar:hover {
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.12);
    transform: translateY(-2px);
}

.main-search-bar i {
    font-size: 1.5rem;
    color: var(--primary);
}

.nearest-search-container {
    padding: 0 20px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap; 
}

.nearest-search-bar {
    flex: 1.2;
    background: linear-gradient(135deg, var(--dark), #1e293b);
    color: var(--white);
    padding: 18px 25px;
    border-radius: 15px; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nearest-search-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.location-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
}

.location-icon-wrapper .main-loc {
    font-size: 1.3rem;
    color: var(--primary-light);
    z-index: 2;
}

.location-icon-wrapper .floating-loc {
    position: absolute;
    font-size: 1.1rem;
    color: var(--primary-light);
    z-index: 1;
    animation: floatLoc 2s infinite ease-out;
}

@keyframes floatLoc {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(1.5); opacity: 0; }
}

.fav-icon-btn {
    flex: 1;
    background: var(--white);
    border-radius: 15px; 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px 20px; 
    gap: 10px;
    border: 1px solid rgba(13, 148, 136, 0.1);
    transition: var(--transition);
    white-space: nowrap;
}

.fav-icon-btn:hover {
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.12);
    transform: translateY(-2px);
}

.fav-icon-btn .fav-text {
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.95rem;
}

.heart-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
}

.heart-wrapper .main-heart {
    font-size: 1.3rem;
    color: #ef4444;
    z-index: 2;
}

.heart-wrapper .floating-heart {
    position: absolute;
    font-size: 1.1rem;
    color: #ef4444;
    z-index: 1;
    animation: floatHeart 2s infinite ease-out;
}

@keyframes floatHeart {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-20px) scale(1.5); opacity: 0; }
}

/* ========================================================
   فواصل الأقسام الاحترافية (Section Dividers)
======================================================== */
.modern-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25px 20px;
    opacity: 0.8;
}

.modern-divider::before, 
.modern-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(13, 148, 136, 0.3), transparent);
}

.modern-divider i {
    color: var(--primary);
    font-size: 1.2rem;
    margin: 0 15px;
    background: var(--primary-light);
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.1);
}

/* ========================================================
   8. قسم العروض والخصومات (Offers Slider)
======================================================== */
.offers-section {
    margin-top: 10px; 
    padding-top: 10px;
}

.best-doctors-section {
    margin-top: 10px; 
    padding-top: 10px;
    padding-bottom: 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--dark) 20%, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-right: 15px;
    display: inline-block;
}

.section-header h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 22px;
    background: linear-gradient(to bottom, var(--primary), #0ea5e9);
    border-radius: 5px;
}

.view-all-btn {
    background: var(--white);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(13, 148, 136, 0.2);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.05);
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15);
}

.horizontal-slider {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 15px 20px 25px; 
    scrollbar-width: none;
}

.horizontal-slider::-webkit-scrollbar {
    display: none;
}

.offer-card {
    min-width: 200px;
    width: 200px;
    height: 210px; 
    background: linear-gradient(145deg, #ffffff, #f4f7f6); 
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.08); 
    border: 1px solid rgba(13, 148, 136, 0.15);
    border-top: 4px solid var(--primary); 
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    justify-content: space-between; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.offer-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(13, 148, 136, 0.15);
}

.discount-badge-floating {
    position: absolute;
    top: -12px;
    left: -10px;
    background: linear-gradient(135deg, #f59e0b, #ea580c); 
    color: var(--white);
    padding: 4px 10px; 
    border-radius: 12px;
    font-size: 0.75rem; 
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
    border: 2px solid var(--white);
    z-index: 2;
    letter-spacing: 0.5px;
}

.offer-doc-row {
    display: flex;
    align-items: center;
    gap: 15px; 
    width: 100%;
    margin-bottom: 10px; 
}

.offer-img-circle {
    width: 55px; 
    height: 55px; 
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem; 
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.1); 
}

.offer-doc-text {
    display: flex;
    flex-direction: column;
    text-align: right;
    overflow: hidden;
    width: 100%;
}

.offer-doc-text .doc-name {
    font-size: 0.9rem; 
    font-weight: 800; 
    color: var(--text-main);
    margin: 0 0 4px 0; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offer-doc-text .discount-scope {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discount-duration-rect {
    background: var(--primary-light);
    color: var(--primary);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: auto; 
    display: inline-block;
    border: 1px solid rgba(13, 148, 136, 0.1);
}

.book-text-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: var(--white);
    padding: 10px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.2);
    transition: all 0.3s ease;
    border: none;
    margin-top: 10px; 
}

.book-text-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}

.doc-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 25px;
    padding: 25px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.offer-grid-card {
    display: flex;
    flex-direction: row; 
    align-items: center;
    background: linear-gradient(145deg, #ffffff, #f4f7f6);
    border-radius: 16px;
    padding: 20px 25px;
    box-shadow: 0 5px 20px rgba(13, 148, 136, 0.05);
    border: 1px solid rgba(13, 148, 136, 0.1);
    border-right: 5px solid var(--primary); 
    position: relative;
    transition: all 0.3s ease;
    min-height: 100px; 
    width: 100%;
}

.offer-grid-card:hover {
    transform: translateX(-5px); 
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.12);
    background: #ffffff;
}

.offer-grid-card .discount-badge-floating {
    top: -12px;
    right: 25px;
    left: auto;
}

.offer-grid-card .offer-doc-row {
    flex: 1; 
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.offer-grid-card .discount-duration-rect {
    margin: 0 20px; 
    margin-bottom: 0;
    white-space: nowrap;
}

.offer-grid-card .book-text-btn {
    width: auto; 
    margin-top: 0;
    padding: 10px 25px;
    white-space: nowrap;
}

/* ========================================================
   9. قسم أفضل الأطباء والبحث (Best Doctors & Search Cards)
======================================================== */
.quick-filters {
    display: flex;
    gap: 10px;
    padding: 0 20px 15px;
}

.filter-select, 
.filter-input {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: var(--white);
    font-size: 0.85rem;
    outline: none;
}

.best-doctors-list, .search-results-list {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.best-doc-card, 
.search-result-card {
    display: flex;
    background: linear-gradient(145deg, #ffffff, #f4f7f6);
    border-radius: 18px;
    padding: 18px;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    position: relative;
    border: 1px solid rgba(13, 148, 136, 0.08);
    border-right: 4px solid var(--primary);
    transition: all 0.3s ease;
    align-items: center;
    min-height: 110px; 
}

.best-doc-card:hover, 
.search-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.1);
}

.doc-img-rect, 
.doc-img-right {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.doc-info, 
.doc-details {
    flex: 1;
}

.doc-spec {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 5px;
}

.doc-address {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.doc-rating {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #f59e0b;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

.book-text-btn-small {
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
    border: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
}

.book-text-btn-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 148, 136, 0.3);
}

.card-btn-absolute {
    position: absolute;
    bottom: 15px;
    left: 15px;
}

/* ========================================================
   10. صفحة المواعيد والحالات (Appointments & States)
======================================================== */
.state-container { display: none; }
.state-container.active { display: block; }
.empty-state { text-align: center; padding: 50px 20px; }
.empty-icon { font-size: 3rem; color: #cbd5e1; margin-bottom: 15px; }
.empty-state p { font-size: 1rem; color: var(--text-muted); margin-bottom: 20px; }
.action-btn { background: var(--primary); color: var(--white); padding: 12px 30px; border-radius: 10px; font-size: 1rem; font-weight: 700; }
.appt-filters { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 20px; }
.appointments-list { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 15px; }

/* تصميم إضافة التاريخ في الفلاتر */
.date-filter-wrap {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 10px;
    flex: 1;
    overflow: hidden;
}
.date-filter-wrap span {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 8px;
    font-weight: 600;
    white-space: nowrap;
}
.date-filter-wrap input[type="date"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.85rem;
    color: var(--text-main);
}

/* التعديل الجديد الشامل لبطاقة الموعد */
.appt-card {
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(13, 148, 136, 0.1);
    border-right: 5px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
}

.appt-card:hover {
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.08);
    transform: translateY(-2px);
}

.appt-card .doc-name {
    margin-bottom: 5px;
    font-size: 1.15rem;
    color: var(--text-main);
}

/* نظام المربعات المتناسقة للمواعيد */
.appt-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 5px;
}

.detail-box {
    background: #f8fafc;
    border: 1px solid rgba(13, 148, 136, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.detail-box:hover {
    border-color: rgba(13, 148, 136, 0.3);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.05);
}

.detail-icon {
    width: 45px;
    height: 45px;
    background: var(--white);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary);
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    flex-shrink: 0;
}

.detail-data {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.appt-day, .appt-time {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.appt-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-data .status-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
    width: fit-content;
}

.status-badge {
    border-radius: 20px;
    font-weight: 700;
    display: inline-block;
}

.status-pending { background: var(--status-pending-bg); color: var(--status-pending); }
.status-confirmed { background: var(--status-confirmed-bg); color: var(--status-confirmed); }
.status-rejected { background: var(--status-rejected-bg); color: var(--status-rejected); }

.permanent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.action-change, .action-cancel, .action-goto {
    flex: 1;
    min-width: 130px;
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.action-change {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(13, 148, 136, 0.15);
}

.action-change:hover {
    background: var(--primary);
    color: var(--white);
}

.action-cancel {
    background: #fff0f0;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.action-cancel:hover {
    background: #ef4444;
    color: var(--white);
}

.action-goto {
    background: #f8fafc;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
}

.action-goto:hover {
    background: #e2e8f0;
}

/* ========================================================
   11. النوافذ المنبثقة والقوائم الكبيرة (Overlays / Modals)
======================================================== */
.page-title {
    padding: 20px;
    font-size: 1.2rem;
    color: var(--text-main);
}

.full-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 3000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.overlay-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    font-size: 1.2rem;
    color: var(--text-main);
}

.overlay-header h2 {
    font-size: 1.1rem;
}

.doctor-search-box {
    position: relative;
    padding: 20px 20px 0;
}

.doc-name-input {
    width: 100%;
    padding: 18px 50px 18px 20px;
    border-radius: 15px;
    border: 1px solid rgba(13, 148, 136, 0.2);
    font-size: 1.05rem;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    outline: none;
    font-family: 'Tajawal', sans-serif;
    color: var(--text-main);
}

.doc-name-input:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.1);
}

.doctor-search-box i {
    position: absolute;
    right: 40px;
    top: 40px;
    color: var(--primary);
    font-size: 1.3rem;
}

.filters-text-row {
    display: flex;
    gap: 12px;
    padding: 20px;
    justify-content: space-between;
    flex-direction: row; 
}

.filter-text-box {
    position: relative;
    flex: 1;
    background: var(--bg-color);
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(13, 148, 136, 0.15);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.filter-text-box:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
}

.filter-text-box select {
    width: 100%;
    padding: 18px 20px 18px 30px; 
    border: none;
    background: transparent;
    text-align: center;
    text-align-last: center;
    font-size: 1.05rem; 
    font-weight: 700;
    color: var(--text-main);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.filter-text-box::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
    font-size: 0.9rem;
}

#areaFilterBox, #offersAreaFilterBox, #bestDocsAreaFilterBox {
    padding: 16px; 
}

#areaFilterBox::after, #offersAreaFilterBox::after, #bestDocsAreaFilterBox::after {
    display: none; 
}

.filter-text-box span {
    width: 100%;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

.filter-text-box input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    outline: none;
}

.filter-text-box input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.filters-grid {
    padding: 20px;
    display: grid;
    gap: 15px;
}

.main-filter {
    width: 100%;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: var(--white);
    font-size: 0.95rem;
    outline: none;
}

/* ========================================================
   12. الشريط السفلي الثابت (Bottom Navigation)
======================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid rgba(13, 148, 136, 0.1);
    z-index: 1500;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

.nav-item i {
    font-size: 1.3rem;
    transition: 0.3s;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: translateY(-3px);
}

.test-toggle-btn {
    display: block;
    width: 90%;
    margin: 20px auto;
    background: var(--dark);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

/* ========================================================
   13. التجاوب مع الشاشات (Responsive & Mobile)
======================================================== */
@media (max-width: 768px) {
    .nav-overlay {
        width: 280px;
        max-width: 75vw;
    }
    
    .main-header {
        height: 55px; 
    }

    /* التعديل لضمان بقاء العنوان في المنتصف تماماً وعدم تحركه */
    .header-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        padding: 0;
        z-index: 10;
    }

    .header-center h1 {
        font-size: 1.1rem; 
        white-space: nowrap;
    }

    .header-right, .header-left {
        flex-shrink: 0;
    }

    .header-left {
        position: relative;
        transform: translateX(-5px);
    }

    .login-btn {
        padding: 6px 6px; /* تم تصغير الارتفاع هنا لشاشات الجوال */
        font-size: 0.75rem;
    }
    
    .user-card {
        padding: 3px 8px;
        gap: 5px;
    }
    
    .user-img-placeholder {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .user-name {
        font-size: 0.75rem;
    }

    .welcome-text-glass {
        padding: 10px 15px;
        margin-bottom: 15px;
    }

    .welcome-text-glass p {
        font-size: 0.95rem;
    }

    .search-box-wrapper {
        display: block;
    }

    .main-search-bar {
        padding: 22px 20px; 
        font-size: 1.1rem; 
        border-radius: 15px;
    }
    
    .main-search-bar i {
        font-size: 1.4rem; 
    }

    .nearest-search-container {
        gap: 10px;
    }

    .nearest-search-bar {
        padding: 16px 12px;
        border-radius: 12px;
        gap: 8px;
    }

    .nearest-search-bar span {
        font-size: 0.95rem;
    }

    .fav-icon-btn {
        padding: 14px 10px;
        border-radius: 12px;
        gap: 8px;
    }

    .fav-icon-btn .fav-text {
        font-size: 0.85rem;
    }
    
    .location-icon-wrapper, .heart-wrapper {
        width: 20px;
        height: 20px;
    }
    
    .location-icon-wrapper .main-loc, .heart-wrapper .main-heart {
        font-size: 1.1rem;
    }
    
    .location-icon-wrapper .floating-loc, .heart-wrapper .floating-heart {
        font-size: 0.9rem;
    }

    .filters-text-row {
        gap: 10px;
        padding: 15px 10px;
    }

    .filter-text-box {
        border-radius: 10px;
    }

    .filter-text-box select {
        padding: 14px 5px; 
        font-size: 0.9rem;
    }

    .filter-text-box::after {
        display: none; 
    }

    .filter-text-box span, .filter-text-box input {
        font-size: 0.9rem;
    }

    #areaFilterBox, #offersAreaFilterBox, #bestDocsAreaFilterBox {
        padding: 14px 5px;
    }

    .offer-card {
        min-width: 180px;
        width: 180px;
        height: 200px;
    }
    
    .offers-grid {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 20px;
    }

    .offer-grid-card {
        flex-direction: column; 
        align-items: flex-start;
        border-right: 1px solid rgba(13, 148, 136, 0.1);
        border-top: 4px solid var(--primary); 
        padding: 20px 15px;
    }

    .offer-grid-card .discount-badge-floating {
        right: -10px; 
    }

    .offer-grid-card .offer-doc-row {
        width: 100%;
        margin-bottom: 15px;
    }

    .offer-grid-card .discount-duration-rect {
        margin: 0;
        margin-bottom: 15px;
    }

    .offer-grid-card .book-text-btn {
        width: 100%;
    }

    .appt-details-grid {
        grid-template-columns: 1fr; 
        gap: 10px;
    }

    .detail-box {
        padding: 12px;
    }

    .action-change, .action-cancel, .action-goto {
        min-width: 100%; 
    }
    
    .discount-badge-floating {
        padding: 3px 8px; 
        font-size: 0.7rem; 
    }
    .offer-img-circle {
        width: 45px; 
        height: 45px; 
        font-size: 1.2rem; 
    }
    .offer-doc-row {
        gap: 10px; 
    }
    .offer-doc-text .doc-name {
        font-size: 0.8rem; 
    }
    .offer-doc-text .discount-scope {
        font-size: 0.7rem;
    }
    .discount-duration-rect {
        padding: 3px 6px;
        font-size: 0.65rem;
        margin-bottom: auto;
    }
    .book-text-btn {
        padding: 6px;
        font-size: 0.8rem;
        border-radius: 8px;
        margin-top: 5px;
    }
    
    .book-text-btn-small {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}
/* ========================================================
   14. قسم الملف الشخصي (Profile Section)
======================================================== */
.profile-container {
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.profile-image-circle {
    width: 100px;
    height: 100px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    box-shadow: 0 5px 15px rgba(13, 148, 136, 0.15);
    border: 3px solid var(--white);
    margin-bottom: 15px;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 5px;
}

.profile-phone {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.profile-info-section {
    width: 100%;
    background: var(--white);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(13, 148, 136, 0.1);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    border-right: 4px solid var(--primary);
    padding-right: 10px;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.profile-input {
    width: 100%;
    padding: 14px 15px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: var(--bg-color);
    font-size: 0.95rem;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
    font-family: 'Tajawal', sans-serif;
}

.profile-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    background: var(--white);
}

.profile-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.save-changes-btn {
    background: var(--primary-light);
    color: var(--primary);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid rgba(13, 148, 136, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: fit-content;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.save-changes-btn:hover {
    background: var(--primary);
    color: var(--white);
}

.book-new-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), #0f766e);
    color: var(--white);
    padding: 16px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.2);
    border: none;
    transition: all 0.3s ease;
}

.book-new-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.3);
}

.logout-wrapper {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.logout-square-btn {
    background: #fff0f0;
    color: #ef4444;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(239, 68, 68, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.logout-square-btn:hover {
    background: #ef4444;
    color: var(--white);
}

/* ========================================================
   15. نافذة تسجيل الدخول (Login Modal)
======================================================== */
.login-modal {
    background: var(--white);
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(13, 148, 136, 0.1);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 1.2rem;
    color: var(--text-muted);
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-modal-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.modal-content-pad {
    padding: 30px 25px;
}

.otp-instruction {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
    font-weight: 500;
}

.otp-inputs-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    direction: ltr;
}

.otp-input {
    width: 50px;
    height: 55px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    background: var(--bg-color);
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    background: var(--white);
    outline: none;
}

.resend-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
}

.resend-text a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: underline;
    margin-right: 5px;
}

/* ========================================================
   16. زر الإضافة للمفضلة (القلب)
======================================================== */
.card-heart-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.card-heart-btn:hover, .card-heart-btn.active {
    background: #ef4444;
    color: #ffffff;
}

/* إزاحة تقييم النجوم لتجنب التداخل مع القلب */
.doc-rating {
    position: absolute;
    top: 20px;
    left: 55px; 
    color: #f59e0b;
    font-size: 0.7rem;
    letter-spacing: 2px;
}

/* ========================================================
   إصلاح تداخل الشريط العلوي في الشاشات الصغيرة
======================================================== */
@media (max-width: 768px) {
    .header-center h1 {
        font-size: 1.3rem; 
        white-space: nowrap;
    }
    
    .header-left {
        max-width: 35%; 
        display: flex;
        justify-content: flex-end;
    }
    
    .user-card {
        max-width: 100%;
    }
    
    .user-name {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px; 
    }
}

@media (max-width: 380px) {
    .user-name {
        display: none; 
    }
    .header-center h1 {
        font-size: 0.95rem;
    }
}