/* --- HOSPITAL CMS ENTERPRISE THEME (v2.0) --- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    /* --- CORE PALETTE --- */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --accent: #3b82f6;
    
    /* --- NEUTRALS --- */
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-light: #e2e8f0;
    
    /* --- DIMENSIONS --- */
    --sidebar-width: 280px;
    --header-height: 70px;
    --container-width: 1280px;
    --radius: 10px;
    
    /* --- SHADOWS --- */
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
    --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
html { scroll-behavior: smooth; font-size: 15px; }
body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* --- UTILITIES --- */
.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.85rem; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }

/* Grids */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- COMPONENTS --- */

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 8px; font-weight: 600;
    font-size: 0.95rem; border: 1px solid transparent; transition: all 0.2s; gap: 8px;
}
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.btn-outline { background: white; border-color: var(--border-light); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--bg-body); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }

/* Cards */
.card {
    background: var(--bg-white); border-radius: var(--radius);
    box-shadow: var(--shadow-card); border: 1px solid var(--border-light);
    overflow: hidden; transition: transform 0.2s;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-header {
    padding: 16px 24px; border-bottom: 1px solid var(--border-light);
    background: #ffffff; font-weight: 700; font-size: 1.1rem;
    display: flex; justify-content: space-between; align-items: center;
}
.card-body { padding: 24px; }

/* Forms & Inputs */
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.form-control {
    width: 100%; padding: 12px 16px; border: 1px solid var(--border-light);
    border-radius: 8px; font-size: 0.95rem; transition: 0.2s; background: #fff;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
textarea.form-control { min-height: 100px; resize: vertical; }

/* Search Box */
.search-box { position: relative; max-width: 300px; }
.search-box input { padding-left: 40px; }
.search-box i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Badges */
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* Tables */
.table-wrapper { overflow-x: auto; width: 100%; border-radius: var(--radius); border: 1px solid var(--border-light); }
.table { width: 100%; border-collapse: collapse; min-width: 700px; background: white; }
.table th { 
    text-align: left; padding: 16px 20px; background: #f8fafc; 
    font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); 
    font-weight: 700; border-bottom: 1px solid var(--border-light); 
}
.table td { padding: 16px 20px; border-bottom: 1px solid var(--border-light); vertical-align: middle; font-size: 0.95rem; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background-color: #fcfcfc; }
.table-thumb { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #f1f5f9; }

/* Pagination */
.pagination { display: flex; gap: 5px; justify-content: flex-end; margin-top: 15px; }
.page-link { padding: 6px 12px; border: 1px solid var(--border-light); border-radius: 6px; cursor: pointer; font-size: 0.9rem; background: white; }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); }

/* --- ADMIN LAYOUT --- */
.admin-container { display: flex; height: 100vh; overflow: hidden; background: var(--bg-body); }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width); background: var(--secondary); color: white;
    display: flex; flex-direction: column; flex-shrink: 0; z-index: 50;
    transition: margin-left 0.3s ease; box-shadow: 4px 0 10px rgba(0,0,0,0.1);
}
.sidebar-brand {
    height: var(--header-height); display: flex; align-items: center;
    padding: 0 24px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.2);
}
.sidebar-menu { flex: 1; overflow-y: auto; padding: 20px 12px; }
.nav-item {
    display: flex; align-items: center; padding: 12px 16px; color: #94a3b8;
    border-radius: 8px; margin-bottom: 4px; font-weight: 500; cursor: pointer; transition: 0.2s;
}
.nav-item i { width: 24px; margin-right: 10px; font-size: 1.1rem; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: white; }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.nav-section { padding: 20px 16px 8px; font-size: 0.7rem; text-transform: uppercase; color: #64748b; font-weight: 700; letter-spacing: 1px; }

/* Main Admin Content */
.admin-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; position: relative; }
.top-bar {
    height: var(--header-height); background: var(--bg-white);
    border-bottom: 1px solid var(--border-light); display: flex;
    align-items: center; justify-content: space-between; padding: 0 30px;
    position: sticky; top: 0; z-index: 40;
}
.content-area { padding: 30px; max-width: 1600px; margin: 0 auto; width: 100%; }

/* Stats Widgets */
.stat-widget {
    background: white; padding: 24px; border-radius: var(--radius);
    border: 1px solid var(--border-light); display: flex; align-items: center; gap: 20px;
}
.stat-icon {
    width: 60px; height: 60px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 1.6rem;
}
.icon-bg-blue { background: #eff6ff; color: #2563eb; }
.icon-bg-green { background: #f0fdf4; color: #16a34a; }
.icon-bg-purple { background: #faf5ff; color: #9333ea; }
.icon-bg-orange { background: #fff7ed; color: #ea580c; }

/* Tabs */
.tab-pane { display: none; animation: fadeIn 0.3s ease-out; }
.tab-pane.active { display: block; }

/* --- PUBLIC WEBSITE --- */
.top-bar-public {
    background: var(--secondary); color: white; padding: 10px 0; font-size: 0.85rem;
}
.top-bar-content { display: flex; justify-content: space-between; align-items: center; }
.public-nav {
    height: 80px; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light); position: sticky; top: 0; z-index: 1000;
}
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-link { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }
.nav-link:hover { color: var(--primary); }

.hero-section {
    padding: 100px 0; background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    position: relative; overflow: hidden;
}
.hero-title { font-size: 3.5rem; font-weight: 800; line-height: 1.15; margin-bottom: 24px; color: var(--text-main); letter-spacing: -1px; }
.hero-text { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 32px; max-width: 600px; line-height: 1.7; }
.hero-img { border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; border: 8px solid rgba(255,255,255,0.5); }

.section { padding: 100px 0; }
.section-title { font-size: 2.5rem; font-weight: 800; text-align: center; margin-bottom: 16px; letter-spacing: -0.5px; }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 60px; font-size: 1.15rem; max-width: 700px; margin-left: auto; margin-right: auto; }

/* Feature Cards */
.feature-card { padding: 40px 30px; text-align: center; border: 1px solid var(--border-light); border-radius: var(--radius); background: white; transition: 0.3s; }
.feature-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.feature-icon { width: 80px; height: 80px; margin: 0 auto 24px; background: var(--primary-light); color: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; }

/* Doctor Cards */
.doc-card { text-align: center; overflow: hidden; }
.doc-img { height: 280px; width: 100%; object-fit: cover; background: #e2e8f0; }
.doc-info { padding: 24px; }
.doc-social { margin-top: 16px; display: flex; justify-content: center; gap: 10px; }
.social-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-body); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 0.9rem; transition: 0.2s; }
.social-icon:hover { background: var(--primary); color: white; }

/* Accordion (FAQ) */
.accordion-item { border: 1px solid var(--border-light); border-radius: 8px; margin-bottom: 10px; background: white; overflow: hidden; }
.accordion-header { padding: 20px; cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; align-items: center; background: #fff; }
.accordion-header:hover { background: #f8fafc; }
.accordion-body { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; color: var(--text-muted); line-height: 1.7; }
.accordion-item.active .accordion-body { padding: 0 20px 20px; max-height: 200px; }
.accordion-icon { transition: transform 0.3s; }
.accordion-item.active .accordion-icon { transform: rotate(180deg); }

/* Footer */
.footer { background: var(--secondary); color: #94a3b8; padding: 80px 0 30px; }
.footer-title { color: white; margin-bottom: 24px; font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.footer-link { display: block; margin-bottom: 12px; color: inherit; transition: 0.2s; }
.footer-link:hover { color: white; padding-left: 5px; }
.footer-bottom { margin-top: 60px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.9rem; }

/* FAB */
.fab {
    position: fixed; bottom: 30px; right: 30px; background: #ef4444; color: white;
    padding: 14px 28px; border-radius: 50px; font-weight: 700; box-shadow: 0 10px 20px rgba(239, 68, 68, 0.4);
    z-index: 2000; display: flex; align-items: center; gap: 12px; font-size: 1.1rem;
    animation: pulse 2s infinite; transition: transform 0.2s;
}
.fab:hover { transform: scale(1.05); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 3000;
    display: none; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.modal {
    background: white; width: 100%; max-width: 600px; border-radius: 16px;
    padding: 32px; position: relative; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); animation: slideUp 0.3s ease;
}
.close-btn { position: absolute; top: 20px; right: 20px; font-size: 1.5rem; color: #94a3b8; background: none; border: none; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Mobile */
@media (max-width: 1024px) {
    .container { padding: 0 20px; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { margin-left: -280px; position: absolute; height: 100%; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    .sidebar.active { margin-left: 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .nav-links { display: none; position: absolute; top: 80px; left: 0; right: 0; background: white; flex-direction: column; padding: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); align-items: flex-start; }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block !important; font-size: 1.5rem; background: none; border: none; }
    .hero-title { font-size: 2.5rem; }
    .top-bar-public { display: none; } /* Hide top bar on mobile */
    .table th, .table td { padding: 10px; font-size: 0.85rem; }
}