@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

:root {
    --primary: #22d3ee;
    --primary-dim: rgba(34, 211, 238, 0.12);
    --primary-glow: rgba(34, 211, 238, 0.25);
    --accent: #34d399;
    --accent-dim: rgba(52, 211, 153, 0.12);
    --rose: #fb7185;
    --amber: #fbbf24;
    --bg: #0d0f14;
    --surface: #13161d;
    --surface-2: #1a1e28;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(34, 211, 238, 0.35);
    --text: #e2e8f0;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --sidebar-w: 280px;
    --radius: 20px;
    --radius-sm: 12px;
    --radius-pill: 100px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Background Atmosphere ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 10% 0%, rgba(34, 211, 238, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(52, 211, 153, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(15, 20, 35, 0.8) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

/* ── Typography ── */
h1, h2, h3, .font-display {
    font-family: 'Syne', sans-serif;
    letter-spacing: -0.02em;
}

/* ── Glassmorphism ── */
.glass {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Sidebar ── */
#sidebar {
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar .brand {
    padding: 28px 24px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

#sidebar .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

#sidebar .brand-name {
    font-family: 'Syne', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 40%, var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-card {
    margin: 16px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #475569, #64748b);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-card .name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card .role-badge {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    letter-spacing: 0.04em;
}

/* Nav links */
#sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    user-select: none;
}

.nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
    border-color: var(--border);
    transform: translateX(3px);
}

.nav-link.active-nav {
    color: var(--primary);
    background: var(--primary-dim);
    border-color: rgba(34, 211, 238, 0.2);
    font-weight: 600;
}

.nav-link.active-nav i { color: var(--primary); }

.nav-section-label {
    padding: 12px 16px 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Logout */
.logout-btn {
    margin: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--rose);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(251, 113, 133, 0.1);
    border-color: rgba(251, 113, 133, 0.2);
}

/* ── Main Content ── */
#main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 40px 44px;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s, transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s;
}

.card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.card-hover {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

/* ── Stat Cards ── */
.stat-card {
    padding: 28px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    position: relative;
    overflow: hidden;
    transition: all 0.25s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
}

.stat-card.cyan::before { background: linear-gradient(90deg, var(--primary), transparent); }
.stat-card.green::before { background: linear-gradient(90deg, var(--accent), transparent); }
.stat-card.amber::before { background: linear-gradient(90deg, var(--amber), transparent); }
.stat-card.rose::before { background: linear-gradient(90deg, var(--rose), transparent); }

.stat-card:hover { transform: translateY(-4px); border-color: rgba(255,255,255,0.12); }

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
}

.stat-icon.cyan { background: var(--primary-dim); color: var(--primary); }
.stat-icon.green { background: var(--accent-dim); color: var(--accent); }
.stat-icon.amber { background: rgba(251,191,36,0.12); color: var(--amber); }
.stat-icon.rose { background: rgba(251,113,133,0.12); color: var(--rose); }

.stat-value {
    font-family: 'Syne', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label { font-size: 13px; color: var(--text-muted); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--primary);
    color: #000;
}
.btn-primary:hover {
    background: #38e3ff;
    box-shadow: 0 0 20px rgba(34,211,238,0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(34, 211, 238, 0.3);
}
.btn-outline:hover {
    background: var(--primary-dim);
    border-color: var(--primary);
}

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}

.btn-danger {
    background: rgba(251,113,133,0.1);
    color: var(--rose);
    border: 1px solid rgba(251,113,133,0.25);
}
.btn-danger:hover {
    background: rgba(251,113,133,0.2);
    box-shadow: 0 0 15px rgba(251,113,133,0.2);
}

/* ── Form Inputs ── */
.input {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    color: var(--text);
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input::placeholder { color: var(--text-muted); }
.input:focus {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ── Badges / Status ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
}

.badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-pending { background: rgba(251,191,36,0.12); color: var(--amber); }
.badge-pending::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }

.badge-confirmed { background: var(--primary-dim); color: var(--primary); }
.badge-confirmed::before { background: var(--primary); box-shadow: 0 0 6px var(--primary); }

.badge-completed { background: var(--accent-dim); color: var(--accent); }
.badge-completed::before { background: var(--accent); }

.badge-cancelled { background: rgba(251,113,133,0.12); color: var(--rose); }
.badge-cancelled::before { background: var(--rose); }

/* ── Doctor Cards ── */
.doctor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    cursor: pointer;
}

.doctor-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(34,211,238,0.15);
}

.doctor-card .accent-bar {
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.doctor-avatar {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, #1e3a5f, #0e4d6e);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    border: 2px solid rgba(34,211,238,0.2);
    flex-shrink: 0;
}

/* ── Appointment Row ── */
.appt-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.2s;
    animation: slideUp 0.3s ease forwards;
}

.appt-row:hover {
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
}

.appt-icon {
    width: 44px; height: 44px;
    background: var(--primary-dim);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

/* ── Time Slots ── */
.timeslot {
    padding: 12px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: var(--surface-2);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-family: 'DM Sans', sans-serif;
}

.timeslot:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-dim);
    transform: scale(1.04);
}

.timeslot.selected, .timeslot.booked-slot {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    font-weight: 700;
    box-shadow: 0 0 16px rgba(34,211,238,0.4);
}

/* ── Page Transitions ── */
#main-content > div {
    animation: fadeSlide 0.28s ease both;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes countUp {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ── Login Page ── */
#login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 44px;
}

/* ── Live Clock ── */
.live-clock {
    font-family: 'Syne', sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

/* ── Search Bar ── */
.search-wrap {
    position: relative;
}

.search-wrap .search-icon {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.search-wrap .input {
    padding-left: 44px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p { color: var(--text-muted); font-size: 15px; }

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* ── Skeleton Loader ── */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,0.04) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── Toast Notification ── */
#toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 3px solid var(--accent); }
.toast.error   { border-left: 3px solid var(--rose); }
.toast.info    { border-left: 3px solid var(--primary); }

/* ── Responsive ── */
@media (max-width: 768px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #main-content { margin-left: 0; padding: 20px; }
}

/* Tailwind-override helpers */
.rounded-3xl { border-radius: var(--radius) !important; }
.rounded-2xl { border-radius: var(--radius-sm) !important; }