:root {
    --primary: #0066cc;
    --primary-dark: #004d99;
    --primary-light: #e6f2ff;
    --cyan: #00bcd4;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --whatsapp: #25d366;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
    --header-h: 64px;
    --bottom-nav-h: 64px;
    --font: 'Cairo', 'Inter', system-ui, sans-serif;
}

[data-theme="dark"] {
    --white: #1e293b;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-500: #94a3b8;
    --gray-700: #e2e8f0;
    --gray-900: #f8fafc;
    --primary-light: #1e3a5f;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: var(--bottom-nav-h);
}

body.ltr { font-family: 'Inter', 'Cairo', system-ui, sans-serif; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    height: var(--header-h); backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--gray-900); font-size: 1.1rem; }
.logo-icon {
    width: 42px; height: 42px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    box-shadow: 0 2px 8px rgb(0 102 204 / 0.25);
}
.main-nav { display: none; gap: 0.25rem; }
.main-nav a {
    padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); color: var(--gray-700);
    font-size: 0.9rem; font-weight: 500;
}
.main-nav a:hover, .main-nav a.active { background: var(--primary-light); color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.625rem 1.25rem; border-radius: var(--radius-sm); font-weight: 600;
    font-size: 0.9rem; border: 2px solid transparent; cursor: pointer;
    transition: all var(--transition); font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-whatsapp { background: var(--whatsapp); color: white; }
.btn-whatsapp:hover { background: #1da851; color: white; }
.btn-sm { padding: 0.4rem 0.875rem; font-size: 0.85rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon {
    background: none; border: none; cursor: pointer; padding: 0.5rem;
    color: var(--gray-700); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--gray-100); }

[data-theme="light"] .icon-moon, [data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon, [data-theme="light"] .icon-sun { display: block; }

.lang-switch {
    padding: 0.4rem 0.75rem; border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--gray-700);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #0088cc 50%, var(--cyan) 100%);
    color: white; padding: 3rem 0; overflow: hidden;
}
.hero-inner { display: grid; gap: 2rem; align-items: center; }
.hero-badge {
    display: inline-block; background: rgba(255,255,255,0.2);
    padding: 0.35rem 1rem; border-radius: 2rem; font-size: 0.85rem; margin-bottom: 1rem;
}
.hero h1 { font-size: 2rem; font-weight: 700; line-height: 1.3; margin-bottom: 1rem; }
.hero p { opacity: 0.9; margin-bottom: 1.5rem; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-actions .btn-outline { border-color: white; color: white; }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,0.15); }
.hero-card {
    background: rgba(255,255,255,0.15); backdrop-filter: blur(10px);
    border-radius: var(--radius); padding: 2rem; text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}
.hero-card-photo {
    width: 140px; height: 140px; border-radius: var(--radius);
    object-fit: cover; margin: 0 auto 1rem;
    border: 4px solid rgba(255,255,255,0.85);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.15);
    background: white;
}
.hero-stats { display: flex; justify-content: center; gap: 2rem; margin-top: 1.5rem; }
.hero-stats strong { display: block; font-size: 1.5rem; }
.hero-stats span { font-size: 0.85rem; opacity: 0.85; }

/* Sections */
.section { padding: 3rem 0; }
.section-alt { background: var(--white); }
.section-header { text-align: center; margin-bottom: 2rem; }
.section-header h2 { font-size: 1.75rem; margin-bottom: 0.5rem; color: var(--gray-900); }
.section-header p { color: var(--gray-500); max-width: 600px; margin: 0 auto; }
.flex-header { display: flex; justify-content: space-between; align-items: center; text-align: start; }
.flex-header h2 { margin: 0; }

.page-hero {
    background: var(--primary); color: white; padding: 2.5rem 0; text-align: center;
}
.page-hero h1 { font-size: 2rem; }
.page-hero-sm { padding: 1.5rem 0; }
.page-hero-sm h1 { font-size: 1.5rem; }
.back-link { color: rgba(255,255,255,0.8); font-size: 0.9rem; display: inline-block; margin-bottom: 0.5rem; }

/* Cards */
.about-cards { display: grid; gap: 1.5rem; }
.about-card {
    background: var(--white); padding: 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow); text-align: center;
}
.about-card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.about-card h3 { margin-bottom: 0.5rem; color: var(--primary); }

.services-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.service-card {
    background: var(--white); padding: 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition);
    color: inherit; display: block;
}
.service-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); color: inherit; }
.service-icon {
    width: 48px; height: 48px; background: var(--primary-light); color: var(--primary);
    border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}
.service-icon svg { width: 24px; height: 24px; flex-shrink: 0; }
.service-icon-lg { width: 64px; height: 64px; }
.service-icon-lg svg { width: 32px; height: 32px; }
.service-card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.service-card p { color: var(--gray-500); font-size: 0.9rem; }

.doctors-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.doctor-card {
    background: var(--white); padding: 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow); text-align: center;
}
.doctor-card img {
    width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
    margin: 0 auto 1rem; background: var(--gray-100); border: 3px solid var(--primary-light);
}
.doctor-card h3 { margin-bottom: 0.25rem; }
.doctor-card .specialty { color: var(--primary); font-weight: 500; font-size: 0.9rem; }
.doctor-card .experience { color: var(--gray-500); font-size: 0.85rem; margin: 0.5rem 0 1rem; }
.info-list { list-style: none; padding: 0; margin: 1rem 0; }
.info-list li {
    padding: 0.75rem 1rem; margin-bottom: 0.5rem; background: var(--white);
    border-radius: var(--radius-sm); box-shadow: var(--shadow);
    border-right: 4px solid var(--primary);
}
.ltr .info-list li { border-right: none; border-left: 4px solid var(--primary); }
.doctor-profile-hero { padding-top: 2rem; }
.doctor-profile-header {
    display: grid; gap: 2rem; align-items: center;
    background: var(--white); padding: 2rem; border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.doctor-profile-photos {
    display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; align-items: center;
}
.doctor-profile-photo {
    width: 220px; height: 220px; border-radius: var(--radius);
    object-fit: cover; margin: 0 auto; border: 5px solid var(--primary-light);
    box-shadow: var(--shadow-lg);
}
.doctor-profile-photo-alt {
    width: 180px; height: 180px; border-radius: var(--radius);
}
.doctor-profile-badge {
    display: inline-block; background: var(--primary-light); color: var(--primary);
    padding: 0.35rem 1rem; border-radius: 2rem; font-size: 0.85rem; font-weight: 600;
    margin-bottom: 0.75rem;
}
.doctor-profile-intro h2 { font-size: 1.75rem; margin-bottom: 0.75rem; color: var(--gray-900); }
.doctor-profile-qualifications { color: var(--primary); font-weight: 600; margin-bottom: 1rem; }
.doctor-profile-text { color: var(--gray-700); line-height: 1.8; margin-bottom: 1rem; }
.doctor-profile-stats { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; }
.doctor-stat { text-align: center; min-width: 120px; }
.doctor-stat strong { display: block; font-size: 1.5rem; color: var(--primary); }
.doctor-stat span { font-size: 0.85rem; color: var(--gray-500); }
.doctor-profile-grid {
    display: grid; gap: 1.5rem; grid-template-columns: 1fr;
}
.doctor-profile-block {
    background: var(--white); padding: 1.5rem; border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.doctor-profile-block h3 {
    color: var(--primary); margin-bottom: 1rem; font-size: 1.25rem;
    padding-bottom: 0.5rem; border-bottom: 2px solid var(--primary-light);
}
.info-list-hours li { font-weight: 500; }
.doctor-contact-bar {
    display: flex; flex-direction: column; gap: 1.5rem;
    background: linear-gradient(135deg, var(--primary), #0088cc);
    color: white; padding: 2rem; border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.doctor-contact-bar h3 { margin-bottom: 0.75rem; }
.doctor-contact-bar p { margin-bottom: 0.35rem; opacity: 0.95; }
.doctor-contact-bar a { color: white; font-weight: 600; }
.doctor-contact-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.doctor-contact-actions .btn-outline { border-color: white; color: white; }
.doctor-contact-actions .btn-outline:hover { background: rgba(255,255,255,0.15); color: white; }
.doctor-single-card {
    display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
    background: var(--white); padding: 2rem; border-radius: var(--radius);
    box-shadow: var(--shadow); text-align: center; max-width: 800px; margin: 0 auto;
}
.doctor-single-card img {
    width: 160px; height: 160px; border-radius: var(--radius); object-fit: cover;
    border: 4px solid var(--primary-light);
}
@media (min-width: 768px) {
    .doctor-profile-header { grid-template-columns: 220px 1fr; }
    .doctor-profile-photo { margin: 0; }
    .doctor-profile-grid { grid-template-columns: 1fr 1fr; }
    .doctor-contact-bar { flex-direction: row; align-items: center; justify-content: space-between; }
}

.articles-grid { display: grid; gap: 1.25rem; }
.article-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden;
}
.article-content { padding: 1.5rem; }
.article-content time { color: var(--gray-500); font-size: 0.85rem; }
.article-content h3 { margin: 0.5rem 0; font-size: 1.1rem; }
.article-content h3 a { color: var(--gray-900); }
.article-content p { color: var(--gray-500); font-size: 0.9rem; margin-bottom: 0.75rem; }
.read-more { font-weight: 600; font-size: 0.9rem; }

.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    color: white; text-align: center; padding: 3rem 1rem;
}
.cta-section h2 { margin-bottom: 0.5rem; }
.cta-section p { opacity: 0.9; margin-bottom: 1.5rem; }

/* Forms */
.form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group-full { grid-column: 1 / -1; }
.form-group label { font-weight: 600; font-size: 0.9rem; color: var(--gray-700); }
.form-group input, .form-group select, .form-group textarea {
    padding: 0.75rem 1rem; border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 1rem; background: var(--white); color: var(--gray-900);
    transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.appointment-form, .contact-form, .auth-form { max-width: 700px; margin: 0 auto; }
.auth-form-wrap { max-width: 450px; margin: 0 auto; }
.auth-link { text-align: center; margin-top: 1rem; color: var(--gray-500); }

.alert {
    padding: 1rem 1.25rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem;
    max-width: 700px; margin-left: auto; margin-right: auto;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Contact */
.contact-grid { display: grid; gap: 2rem; margin-bottom: 2rem; }
.contact-card {
    background: var(--white); padding: 1.25rem; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 1rem;
}
.contact-card h3 { color: var(--primary); margin-bottom: 0.5rem; font-size: 1rem; }
.map-container { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* FAQ */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    background: var(--white); border-radius: var(--radius-sm); margin-bottom: 0.75rem;
    box-shadow: var(--shadow); overflow: hidden;
}
.faq-item summary {
    padding: 1rem 1.25rem; cursor: pointer; font-weight: 600;
    list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.25rem; color: var(--primary); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 1.25rem 1rem; color: var(--gray-500); }

/* Doctor detail */
.doctor-detail { display: grid; gap: 2rem; align-items: start; }
.doctor-detail-photo {
    width: 200px; height: 200px; border-radius: 50%; object-fit: cover;
    margin: 0 auto; border: 4px solid var(--primary-light);
}
.info-row { margin-bottom: 0.75rem; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: 0.875rem 1rem; text-align: start; border-bottom: 1px solid var(--gray-200); }
.data-table th { background: var(--gray-100); font-weight: 600; font-size: 0.85rem; }
.status-badge { padding: 0.25rem 0.75rem; border-radius: 2rem; font-size: 0.8rem; font-weight: 600; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-completed { background: #dbeafe; color: #1e40af; }

.content-page { max-width: 800px; margin: 0 auto; }
.content-block { margin-bottom: 2rem; }
.article-content-full { line-height: 1.8; }
.text-center { text-align: center; }
.empty-state { text-align: center; color: var(--gray-500); margin-bottom: 1rem; }

/* Footer */
.site-footer { background: var(--gray-900); color: var(--gray-300); padding: 3rem 0 1rem; margin-bottom: var(--bottom-nav-h); }
[data-theme="dark"] .site-footer { background: #0a0f1a; }
.footer-grid { display: grid; gap: 2rem; margin-bottom: 2rem; }
.footer-col h3, .footer-col h4 { color: white; margin-bottom: 0.75rem; }
.footer-col p { font-size: 0.9rem; margin-bottom: 0.35rem; }
.social-links { display: flex; gap: 1rem; margin-top: 0.75rem; }
.social-links a { color: var(--cyan); font-size: 0.85rem; }
.footer-bottom { border-top: 1px solid var(--gray-700); padding-top: 1rem; text-align: center; font-size: 0.85rem; }

/* Bottom Nav (Mobile App Feel) */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--white); border-top: 1px solid var(--gray-200);
    display: flex; justify-content: space-around; align-items: center;
    height: var(--bottom-nav-h); padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 10px rgb(0 0 0 / 0.05);
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    color: var(--gray-500); font-size: 0.65rem; font-weight: 500; padding: 0.35rem;
    transition: color var(--transition); flex: 1;
}
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--primary); }
.bottom-nav-item svg { transition: transform var(--transition); }
.bottom-nav-item.active svg { transform: scale(1.1); }

.hide-mobile { display: none; }
.mobile-menu-btn { display: flex; }

/* Responsive */
@media (min-width: 768px) {
    .hero h1 { font-size: 2.75rem; }
    .hero-inner { grid-template-columns: 1fr 1fr; }
    .about-cards { grid-template-columns: repeat(3, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .services-grid-lg { grid-template-columns: repeat(3, 1fr); }
    .doctors-grid { grid-template-columns: repeat(2, 1fr); }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .articles-grid-lg { grid-template-columns: repeat(3, 1fr); }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr 1.5fr; }
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
    .doctor-detail { grid-template-columns: auto 1fr; }
    .main-nav { display: flex; }
    .mobile-menu-btn { display: none; }
    .hide-mobile { display: inline-flex; }
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .site-footer { margin-bottom: 0; }
}

@media (min-width: 1024px) {
    .doctors-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
    .main-nav.open {
        display: flex; flex-direction: column; position: absolute;
        top: var(--header-h); left: 0; right: 0;
        background: var(--white); border-bottom: 1px solid var(--gray-200);
        padding: 1rem; box-shadow: var(--shadow-lg);
    }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.site-main > section { animation: fadeIn 0.4s ease; }
