/* ==================== MStar Healthcare ==================== */
:root {
    --bg: #fbfffe;
    --surface: #ffffff;
    --border: #d1cfcf;
    --text: #1e2a38;
    --muted: #4d5661;
    --primary: #05965e;
    --primary-dark: #065f46;
    --glow: #d97706;
    --success: #2e7d32;
    --warning: #f57c00;
    --danger: #c62828;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ==================== HEADER ==================== */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000;
}
.header-inner {
    max-width: 1280px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; padding: 0 1.5rem;
}
.header-logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.header-logo h1 { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.header-logo span { font-size: 0.625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--primary); display: block; }
.header-nav { display: flex; gap: 0.25rem; }
.header-nav a {
    color: var(--muted); text-decoration: none; font-size: 0.8125rem;
    font-weight: 500; padding: 0.4rem 0.75rem; border-radius: 8px; transition: var(--transition);
}
.header-nav a:hover, .header-nav a.active { color: var(--primary); background: #ecfdf5; }

/* Mobile Menu Button */
.mobile-menu-btn { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.mobile-menu-btn span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

/* Mobile Menu (hidden by default) */
.mobile-menu {
    display: none;
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--surface); padding: 0.75rem; z-index: 999;
    flex-direction: column; box-shadow: var(--shadow-md); border-top: 1px solid var(--border);
    transform: translateY(-10px); opacity: 0; pointer-events: none;
    transition: all 0.25s ease;
}
.mobile-menu.open {
    display: flex;
    transform: translateY(0); opacity: 1; pointer-events: all;
}
.mobile-menu a {
    color: var(--text); padding: 0.75rem 1rem; border-radius: 8px;
    text-decoration: none; font-size: 0.9375rem;
}
.mobile-menu a:hover { background: #ecfdf5; color: var(--primary); }

/* ==================== MOBILE QUICK LINKS ==================== */
.mobile-quick-links {
    display: none;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0 0.25rem;
}
.mobile-quick-links::-webkit-scrollbar { display: none; }
.mobile-quick-chip {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    transition: all 0.2s;
    white-space: nowrap;
}
.mobile-quick-chip:hover, .mobile-quick-chip.active {
    color: var(--primary-dark);
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.65rem 1.25rem; border: none; border-radius: 10px;
    font-size: 0.875rem; font-weight: 600; cursor: pointer;
    transition: var(--transition); font-family: inherit; text-decoration: none;
}
.btn-lg { padding: 0.8rem 1.5rem; font-size: 0.9375rem; border-radius: 12px; }
.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(5,150,94,0.25); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-white { background: white; color: var(--primary); }
.btn-white:hover { background: #f0fdf4; }
.btn-glow { background: var(--glow); color: white; }
.btn-glow:hover { background: #b45309; }

/* ==================== MAIN ==================== */
.main-content { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }
.main-content.no-top-padding { padding-top: 0; }

/* ==================== SECTION HEADERS ==================== */
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-tag {
    display: inline-block; background: #ecfdf5; color: var(--primary-dark);
    padding: 0.3rem 0.875rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.75rem;
}
.section-header h2 { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 0.5rem; }
.section-header p { font-size: 0.9375rem; color: var(--muted); max-width: 500px; margin: 0 auto; }

/* ==================== FOOTER ==================== */
.footer { background: var(--text); color: white; padding: 3rem 1.5rem 0; border-top: 3px solid var(--primary); }
.footer-content { max-width: 1280px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr; gap: 2rem; padding-bottom: 2rem; }
.footer-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.footer-logo h3 { font-size: 1.125rem; font-weight: 700; }
.footer-about p { font-size: 0.8125rem; color: #9ca3af; margin-bottom: 0.75rem; }
.footer-social { display: flex; gap: 0.5rem; }
.footer-social a {
    width: 34px; height: 34px; background: rgba(255,255,255,0.08);
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    text-decoration: none; font-size: 0.9375rem; transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); }
.footer-col h4 { font-size: 0.875rem; font-weight: 700; margin-bottom: 0.75rem; color: #6ee7b7; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { color: #9ca3af; text-decoration: none; font-size: 0.8125rem; transition: var(--transition); }
.footer-col ul li a:hover { color: white; }
.footer-contact li { color: #9ca3af; font-size: 0.75rem; margin-bottom: 0.375rem; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08); padding: 1rem 0;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.75rem;
    font-size: 0.75rem; color: #6b7280;
}
.footer-bottom-links { display: flex; gap: 1rem; }
.footer-bottom-links a { color: #6b7280; text-decoration: none; }
.footer-bottom-links a:hover { color: white; }

/* ==================== UTILITIES ==================== */
.loading-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(251,255,254,0.9); z-index: 3000; align-items: center; justify-content: center;
}
.loading-overlay.show { display: flex; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#toastContainer { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 4000; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.75rem 1.25rem; border-radius: 10px; font-size: 0.8125rem; font-weight: 600; color: white; animation: slideIn 0.25s ease; box-shadow: var(--shadow-md); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.fade-in { opacity: 0; transform: translateY(12px); transition: opacity 0.4s ease, transform 0.4s ease; }
.fade-in-visible { opacity: 1; transform: translateY(0); }

/* ==================== FORM ==================== */
.form-card { background: var(--surface); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow); max-width: 460px; margin: 0 auto; border: 1px solid var(--border); }
.form-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 1.25rem; text-align: center; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--muted); margin-bottom: 0.375rem; }
.form-group input { width: 100%; padding: 0.7rem 0.875rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.9375rem; font-family: inherit; transition: var(--transition); background: var(--surface); }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,94,0.06); }
.otp-group { display: flex; gap: 0.5rem; justify-content: center; }
.otp-group input { width: 44px; height: 50px; text-align: center; font-size: 1.25rem; font-weight: 700; }
.summary-card { background: #ecfdf5; border-radius: var(--radius); padding: 1rem; margin-bottom: 1.25rem; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.8125rem; margin-bottom: 0.375rem; }
.summary-row .value { font-weight: 600; }

/* ==================== BOOKING CARDS ==================== */
.booking-card { background: var(--surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 0.75rem; border-left: 4px solid var(--primary); }
.badge { display: inline-block; padding: 0.2rem 0.625rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 600; }
.badge-booked { background: #ecfdf5; color: var(--primary-dark); }
.badge-completed { background: #e8f5e9; color: var(--success); }
.badge-cancelled { background: #ffebee; color: var(--danger); }

/* ==================== MODAL ==================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 2000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 2rem; max-width: 400px; width: 100%; text-align: center; box-shadow: var(--shadow-md); animation: modalIn 0.25s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.modal-icon { font-size: 2.75rem; margin-bottom: 0.75rem; }

/* ==================== DOCTOR CARDS (for listing) ==================== */
.doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.doctor-card { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); cursor: pointer; border: 1.5px solid var(--border); transition: var(--transition); display: flex; gap: 1rem; }
.doctor-card:hover { border-color: #a7f3d0; box-shadow: var(--shadow-md); }
.doctor-avatar { width: 52px; height: 52px; border-radius: 50%; background: #ecfdf5; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary); flex-shrink: 0; font-size: 1.125rem; }
.doctor-name { font-weight: 700; }
.doctor-specialty { font-size: 0.75rem; color: var(--primary); font-weight: 600; }
.doctor-meta { font-size: 0.75rem; color: var(--muted); display: flex; gap: 0.75rem; margin-top: 0.25rem; }
.doctor-fee { font-weight: 700; margin-top: 0.25rem; font-size: 0.9375rem; }

/* ==================== PROFILE ==================== */
.profile-header { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; display: flex; gap: 1.25rem; flex-wrap: wrap; border: 1px solid var(--border); }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: #ecfdf5; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: var(--primary); }
.profile-name { font-size: 1.25rem; font-weight: 700; }

/* ==================== SLOTS ==================== */
.date-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.date-chip { padding: 0.5rem 0.75rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.75rem; font-weight: 600; cursor: pointer; background: var(--surface); text-align: center; transition: var(--transition); }
.date-chip.active { border-color: var(--primary); background: #ecfdf5; color: var(--primary-dark); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 0.5rem; }
.slot-chip { padding: 0.6rem; border: 1.5px solid var(--border); border-radius: 8px; text-align: center; font-size: 0.8125rem; font-weight: 600; cursor: pointer; background: var(--surface); transition: var(--transition); }
.slot-chip.selected { border-color: var(--primary); background: var(--primary); color: white; }
.slot-chip.full { background: #f3f4f6; color: #9ca3af; cursor: not-allowed; }

/* ==================== SEARCH BAR ==================== */
.search-bar { margin-bottom: 2rem; }
.search-bar input {
    width: 100%; padding: 1rem 1.25rem; border: 2px solid var(--border);
    border-radius: 12px; font-size: 1rem; background: var(--surface);
    font-family: inherit; transition: all 0.2s; box-shadow: var(--shadow);
}
.search-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,94,0.06); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .header { padding: 0; }
    .header-inner {
        padding: 0 0.5rem;
        height: auto;
        min-height: 56px;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .header-logo { padding: 0.5rem 0; }
    .header-nav { display: none; }
    .mobile-menu-btn { display: flex; padding: 0.5rem; }
    .mobile-quick-links {
        display: flex !important;
        flex: 1;
        justify-content: center;
    }
    .mobile-quick-chip {
        font-size: 0.65rem;
        padding: 0.3rem 0.55rem;
    }
    .mobile-menu { top: 56px; }
    .services-grid, .info-grid, .doctor-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .cta-card { flex-direction: column; text-align: center; padding: 1.75rem 1.5rem; }
    .cta-buttons { justify-content: center; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .slot-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .form-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .header-inner { padding: 0 0.25rem; }
    .mobile-quick-links { padding: 0 0.25rem; }
    .mobile-quick-chip { font-size: 0.5rem; }
    .slot-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 400px) {
    .mobile-quick-chip { font-size: 0.48rem; }
}