/* =========================================================
   MediBook - Global Professional UI
   Doctor Appointment & Healthcare Management System
   ========================================================= */

:root {
    /* Brand Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;

    --secondary: #0f766e;
    --secondary-light: #ecfdf5;

    /* Text */
    --text-primary: #172033;
    --text-secondary: #526176;
    --text-muted: #7b8798;

    /* Background */
    --bg: #f7f9fc;
    --surface: #ffffff;
    --surface-soft: #f8fbff;

    /* Border */
    --border: #e5eaf1;
    --border-light: #edf1f6;

    /* Status */
    --success: #15803d;
    --success-bg: #ecfdf3;

    --warning: #b45309;
    --warning-bg: #fffbeb;

    --danger: #dc2626;
    --danger-bg: #fef2f2;

    --info: #0369a1;
    --info-bg: #eff6ff;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    /* Shadow */
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.10);

    /* Transition */
    --transition: all 0.2s ease;
}


/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;

    background: var(--bg);
    color: var(--text-primary);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    transition: var(--transition);
}

::selection {
    background: var(--primary);
    color: #ffffff;
}


/* =========================================================
   Typography
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

h1 {
    letter-spacing: -0.035em;
}

h2,
h3 {
    letter-spacing: -0.02em;
}

p {
    color: var(--text-secondary);
}


/* =========================================================
   Navbar
   ========================================================= */

.app-navbar {
    min-height: 72px;

    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid var(--border-light) !important;

    box-shadow: 0 2px 15px rgba(15, 23, 42, 0.04);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    color: var(--text-primary) !important;

    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.navbar-brand:hover {
    color: var(--text-primary) !important;
}

.navbar-brand > span:last-child > span {
    color: var(--primary);
}

.brand-mark {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background: linear-gradient(
        135deg,
        var(--primary),
        #38bdf8
    );

    color: #ffffff;

    font-size: 1.1rem;

    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.20);
}

.navbar-nav {
    gap: 4px;
}

.nav-link {
    padding: 9px 12px !important;

    color: var(--text-secondary) !important;

    font-size: 0.94rem;
    font-weight: 600;

    border-radius: 9px;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary) !important;
}

.navbar-toggler {
    padding: 7px 9px;

    border: 1px solid var(--border);

    border-radius: 10px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* =========================================================
   Buttons
   ========================================================= */

.btn {
    min-height: 42px;

    padding: 9px 17px;

    border-radius: 10px;

    font-weight: 600;

    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);

    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: #b9d1fb;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-outline-secondary {
    border-color: #d8dee8;
    color: var(--text-secondary);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}


/* =========================================================
   Main Layout
   ========================================================= */

main.container {
    min-height: calc(100vh - 145px);
}

.section-title {
    margin-bottom: 6px;

    color: var(--text-primary);

    font-weight: 800;
    letter-spacing: -0.025em;
}

.section-subtitle {
    margin-bottom: 0;

    color: var(--text-muted);
}


/* =========================================================
   Hero
   ========================================================= */

.hero {
    position: relative;
    overflow: hidden;

    padding: clamp(32px, 5vw, 64px);

    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(37, 99, 235, 0.09),
            transparent 32%
        ),
        radial-gradient(
            circle at 70% 90%,
            rgba(20, 184, 166, 0.08),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #eff6ff 0%,
            #f8fbff 52%,
            #f0fdfa 100%
        );

    border: 1px solid #dce8f7;
    border-radius: var(--radius-xl);

    box-shadow: var(--shadow-md);
}

.hero h1 {
    margin-bottom: 18px;

    font-size: clamp(2.25rem, 5vw, 4.1rem);
    line-height: 1.04;
}

.hero p {
    max-width: 680px;

    font-size: 1.05rem;
    line-height: 1.7;
}


/* =========================================================
   Eyebrow / Badge
   ========================================================= */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 18px;

    padding: 7px 13px;

    background: #eaf3ff;
    color: var(--primary);

    border: 1px solid #d7e8ff;
    border-radius: 999px;

    font-size: 0.78rem;
    font-weight: 800;
}


/* =========================================================
   Cards
   ========================================================= */

.card,
.surface {
    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: #ffffff;

    border-bottom: 1px solid var(--border-light);

    font-weight: 700;
}

.card-body {
    padding: 22px;
}


/* =========================================================
   Feature Cards
   ========================================================= */

.feature-card {
    height: 100%;
    padding: 24px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    margin-bottom: 18px;

    background: var(--primary-light);
    color: var(--primary);

    border-radius: 14px;

    font-size: 1.2rem;
}


/* =========================================================
   Doctor Cards
   ========================================================= */

.doctor-card {
    height: 100%;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.doctor-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;

    display: grid;
    place-items: center;

    background: linear-gradient(
        135deg,
        #eaf3ff,
        #ecfdf5
    );

    color: var(--primary);

    border: 1px solid #dceafa;
    border-radius: 18px;

    font-weight: 800;
    font-size: 1.05rem;
}


/* =========================================================
   Dashboard Statistics
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 18px;
}

.stat-card {
    padding: 22px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);

    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    margin-bottom: 16px;

    background: var(--primary-light);
    color: var(--primary);

    border-radius: 13px;

    font-size: 1.1rem;
}

.stat-value {
    margin-bottom: 3px;

    color: var(--text-primary);

    font-size: 1.7rem;
    font-weight: 800;
}

.stat-label {
    color: var(--text-muted);

    font-size: 0.88rem;
    font-weight: 600;
}


/* =========================================================
   Forms
   ========================================================= */

.form-label {
    margin-bottom: 7px;

    color: var(--text-primary);

    font-size: 0.9rem;
    font-weight: 650;
}

.form-control,
.form-select {
    min-height: 46px;

    padding: 10px 13px;

    background: #ffffff;

    border: 1px solid #d9e1eb;
    border-radius: 10px;

    color: var(--text-primary);

    transition: var(--transition);
}

.form-control::placeholder {
    color: #9aa5b5;
}

.form-control:hover,
.form-select:hover {
    border-color: #b9c7d8;
}

.form-control:focus,
.form-select:focus {
    border-color: #76a8f7;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.10);

    outline: none;
}

textarea.form-control {
    min-height: 110px;
    resize: vertical;
}


/* =========================================================
   Search / Filter Area
   ========================================================= */

.filter-panel {
    padding: 20px;

    background: #ffffff;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}

.filter-grid {
    display: grid;

    grid-template-columns:
        2fr
        repeat(3, 1fr);

    gap: 12px;
}


/* =========================================================
   Tables
   ========================================================= */

.table-responsive {
    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.table {
    margin-bottom: 0;

    color: var(--text-primary);
}

.table > thead > tr > th {
    padding: 14px 16px;

    background: #f8fafc;

    border-bottom: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 0.76rem;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.045em;

    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 14px 16px;

    border-bottom: 1px solid var(--border-light);

    vertical-align: middle;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.table > tbody > tr:hover {
    background: #fafcff;
}


/* =========================================================
   Status Badges
   ========================================================= */

.status-pill {
    display: inline-flex;
    align-items: center;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 0.74rem;
    font-weight: 800;
}


/* =========================================================
   Appointment Slots
   ========================================================= */

.slot {
    min-width: 112px;

    border-radius: 10px !important;

    font-weight: 600;
}

.slot.available {
    background: var(--secondary-light);

    border-color: #b7eee1;

    color: var(--secondary);
}

.slot.available:hover {
    background: #d9f8f0;
}

.slot.booked {
    opacity: 0.65;
}


/* =========================================================
   Sidebar
   ========================================================= */

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 12px;

    color: var(--text-secondary);

    border-radius: 10px;

    text-decoration: none;

    font-size: 0.92rem;
    font-weight: 600;
}

.sidebar-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);

    font-weight: 700;
}


/* =========================================================
   Alerts
   ========================================================= */

.alert {
    border-radius: 12px;

    border-width: 1px;

    font-size: 0.92rem;
}


/* =========================================================
   Empty State
   ========================================================= */

.empty-state {
    padding: 55px 20px;

    text-align: center;

    color: var(--text-muted);
}

.empty-state i {
    display: block;

    margin-bottom: 14px;

    color: #a8b4c4;

    font-size: 2.5rem;
}


/* =========================================================
   Small Labels
   ========================================================= */

.mini-label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 0.74rem;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* =========================================================
   Footer
   ========================================================= */

.app-footer {
    margin-top: auto;

    background: #ffffff;

    border-top: 1px solid var(--border);

    color: var(--text-muted);
}

.app-footer strong {
    color: var(--text-primary);
}


/* =========================================================
   Links
   ========================================================= */

.text-primary {
    color: var(--primary) !important;
}

a.text-primary:hover {
    color: var(--primary-dark) !important;
}


/* =========================================================
   Utility
   ========================================================= */

.soft-bg {
    background: var(--surface-soft);
}

.shadow-soft {
    box-shadow: var(--shadow-md);
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}


/* =========================================================
   Responsive - Tablet
   ========================================================= */

@media (max-width: 992px) {

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .navbar-collapse {
        margin-top: 12px;

        padding: 12px;

        background: #ffffff;

        border: 1px solid var(--border);
        border-radius: 14px;

        box-shadow: var(--shadow-md);
    }

    .navbar-nav {
        gap: 3px;
    }

    .nav-link {
        padding: 10px 12px !important;
    }
}


/* =========================================================
   Responsive - Mobile
   ========================================================= */

@media (max-width: 576px) {

    body {
        font-size: 0.94rem;
    }

    main.container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .app-navbar {
        min-height: 64px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 28px 20px;

        border-radius: 20px;
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .hero p {
        font-size: 0.98rem;
    }

    .feature-card,
    .stat-card {
        padding: 18px;
    }

    .card-body {
        padding: 18px;
    }

    .btn {
        min-height: 44px;
    }

    .table {
        min-width: 650px;
    }

    .table-responsive {
        border-radius: 13px;
    }

    .slot {
        min-width: 100px;
    }
}


/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}


/* =========================================================
   MediBook - Scroll Reveal Animation
   ========================================================= */

.reveal {
    opacity: 0;
    transform: translateY(65px);
    transition:
        opacity 0.85s ease,
        transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation */
.reveal-delay-1 {
    transition-delay: 0.12s;
}

.reveal-delay-2 {
    transition-delay: 0.24s;
}

.reveal-delay-3 {
    transition-delay: 0.36s;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}