﻿html {
    position: relative;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}



/* -------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------- */
.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 30px;
    line-height: 30px;
    background-color: #523C76; /* brand purple — unchanged */
    color: #ffffff;
}

/* -------------------------------------------------------------
   LOGO
   ------------------------------------------------------------- */
.logo {
    height: 32px; /* FIX: was width:200px which made logo too large
                      in the new navbar. Height:32px matches Tabler POC. */
    width: auto;
}

/* -------------------------------------------------------------
   CONTAINER
   FIX: Removed old padding: 60px 15px 0 on .container.
   The 60px top padding was needed in BS4 to clear the fixed
   navbar, but now main.cp-page-body uses margin-top for that.
   Restoring it here would push the white card too far down.
   Bootstrap's own .container padding is sufficient.
   ------------------------------------------------------------- */

/* -------------------------------------------------------------
   NAVBAR TEXT COLOURS — kept, still referenced in markup
   ------------------------------------------------------------- */
.title-color {
    color: #4A3E6F;
}

.welcome-color {
    color: #9933CC;
}

/* FIX: Removed .navbar-light prefix — BS5 dropped navbar-light.
   Selectors now work without the variant class. */

/* -------------------------------------------------------------
   BUTTONS
   ------------------------------------------------------------- */
.normal-btn {
    background-color: #E34111;
    border: none;
    color: #ffffff;
    padding: 12px 16px;
    font-size: 16px;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif; /* FIX: PT Sans → Open Sans */
    border-radius: 10px;
}

    .normal-btn:hover {
        background-color: #A42F0E;
        color: white;
    }

.box-shadow-4dp {
    box-shadow: 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12), 0 2px 4px -1px rgba(0,0,0,.2);
}

/* -------------------------------------------------------------
   bg-primary OVERRIDE
   FIX: Old rule overrode Bootstrap's .bg-primary with #007aeb.
   The ASPX <style> block now sets --bs-primary to brand purple
   (#2f1854) via CSS variable. This hard-coded colour override
   fought that and turned the date nav bar blue instead of purple.
   Removed entirely — Bootstrap's variable-driven bg-primary is correct.
   ------------------------------------------------------------- */

/* -------------------------------------------------------------
   ALERT / ERROR OVERLAY
   ------------------------------------------------------------- */
#AlertDiv {
    left: 40%;
    top: 40%;
    position: absolute;
    padding: 12px;
    border: #000000 1px solid;
    background-color: white;
    text-align: left;
    visibility: hidden;
    z-index: 900009 !important;
}

#AlertButtons {
    position: absolute;
    bottom: 5%;
}

/* -------------------------------------------------------------
   SCHEDULE DATA CONTAINER
   FIX: Old .divSchDataMobileW had height:350px + overflow:auto
   which clipped the appointment card list with a scrollbar.
   Now uses min-height so cards expand naturally, matching the
   Tabler POC full-page scroll behaviour.
   ------------------------------------------------------------- */
.divSchDataMobileW {
    position: relative;
    width: 100%;
    height: auto !important;
}

/* -------------------------------------------------------------
   SECTION PADDING
   FIX: Old rule set section { padding: 0.5rem } which added
   unwanted spacing around the date nav bar section. Removed.
   Spacing is handled by mb-4 Bootstrap utility on the element.
   ------------------------------------------------------------- */

/* -------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------- */


@media screen and (max-width: 768px) {
    /* Appointment card: stack time above details on small screens */
    .cp-appointment-card {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cp-appt-time {
        border-right: none;
        border-bottom: none;
        padding-bottom: 6px;
        min-width: 100%;
    }
}

/* ============================================================
           DESIGN TOKENS — from custom.css
           ============================================================ */
:root {
    --cp-primary: #2f1854; /* brand dark purple */
    --cp-primary-light: #523c76; /* brand light purple */
    --cp-text-dark: #030204;
    --cp-text-muted: #59585B;
    --cp-border: #D7D6DA;
    --cp-bg: #f0f0f0;
    --cp-card-bg: #ffffff;
    --cp-card-radius: 12px;
    --font-family-body: 'Open Sans', system-ui, sans-serif;
    --font-family-serif: 'Roboto Slab', Georgia, serif;
    --text-ui-xsmall: 12px;
    --text-ui-small: 14px;
    --text-ui-medium: 16px;
    --text-ui-large: 18px;
    --text-heading-md: 24px;
    --font-weight-400: 400;
    --font-weight-500: 500;
    --font-weight-600: 600;
    --font-weight-700: 700;
    /* Override Bootstrap primary with brand purple */
    --bs-primary: #2f1854;
    --bs-primary-rgb: 47, 24, 84;
}

/* ============================================================
           GLOBAL
           ============================================================ */
body {
    background-color: var(--cp-bg);
    font-family: var(--font-family-body);
    color: var(--cp-text-dark);
}

/* ============================================================
           NAVBAR — from custom.css .cp-navbar
           Practice name left, logo right (matches Tabler POC layout)
           ============================================================ */
.cp-navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid var(--cp-border);
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    padding-bottom: 0.75rem;
    padding-left: 0;
    padding-right: 0;
}

.cp-practice-name {
    font-size: var(--text-ui-medium);
    font-weight: var(--font-weight-400);
    color: var(--cp-text-dark);
    letter-spacing: -0.01em;
}

/* ============================================================
           PAGE LAYOUT — white card panel below navbar
           Mirrors: .page-body .container-xl from custom.css
           ============================================================ */
.cp-page-body {
    background-color: var(--cp-card-bg);
    border-radius: var(--cp-card-radius);
    margin-top: 0;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 1.25rem 1.25rem 1.5rem;
    padding-top: calc(56px + env(safe-area-inset-top) + 1rem);
    max-width: 680px;
}

/* ============================================================
           PAGE TITLE — from custom.css .cp-page-title
           ============================================================ */
.cp-page-title {
    font-family: var(--font-family-serif);
    font-size: var(--text-heading-md);
    font-weight: var(--font-weight-700);
    color: var(--cp-primary);
    margin-bottom: 1rem;
}

/* ============================================================
           LOCATION FILTER — from custom.css .cp-filter-label / .cp-location-select
           ============================================================ */
.cp-filter-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-500);
    color: var(--cp-text-muted);
    white-space: nowrap;
}

.cp-location-select {
    border: 1px solid var(--cp-border);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--cp-text-dark);
    background-color: #ffffff;
}

    .cp-location-select:focus {
        border-color: var(--cp-primary);
        box-shadow: 0 0 0 3px rgba(47, 24, 84, 0.12);
    }

/* ============================================================
           DATE NAVIGATION BAR — from custom.css .cp-date-nav
           Replaces old .date-nav-bar / .nav-arrow styles
           ============================================================ */
.cp-date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--cp-primary);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
}

.cp-date-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--cp-primary);
    color: #ffffff;
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s;
    flex-shrink: 0;
}

    .cp-date-nav-btn:hover {
        background-color: var(--cp-primary-light);
        color: #ffffff;
    }

.cp-date-nav-label {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.cp-date-text {
    font-size: var(--text-ui-medium);
    font-weight: var(--font-weight-600);
    color: #ffffff;
    letter-spacing: -0.01em;
}

.cp-date-icon {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    line-height: 1;
}

    .cp-date-icon:hover {
        color: #ffffff;
    }

/* ============================================================
           APPOINTMENT CARD LIST — from custom.css .cp-appointment-*
           Used when tblSchData renders slot rows as cards (JS-generated)
           ============================================================ */
.cp-appointment-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cp-appointment-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--cp-card-bg);
    border: 1px solid var(--cp-border);
    border-radius: var(--cp-card-radius);
    padding: 16px 20px;
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}

    .cp-appointment-card:hover {
        border-color: var(--cp-primary-light);
        box-shadow: 0 2px 8px rgba(155, 133, 181, 0.12);
    }

.cp-appt-time {
    font-size: var(--text-ui-medium);
    font-weight: var(--font-weight-400);
    color: var(--cp-text-dark);
    white-space: nowrap;
    text-align: left;
    min-width: 88px;
    padding-left: 16px;
}

.cp-appt-details {
    flex: 1;
}

.cp-appt-provider {
    font-size: var(--text-ui-small);
    font-weight: var(--font-weight-400);
    color: var(--cp-text-dark);
    line-height: 1.3;
}

.cp-appt-location {
    font-size: var(--text-ui-small);
    color: var(--cp-text-dark);
    margin-top: 0.125rem;
}

/* ============================================================
           EXISTING FIXES — kept unchanged
           ============================================================ */
/* FIX #1 — jQuery UI / Bootstrap conflict reset */
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
    font-family: inherit;
    font-size: inherit;
}
/* Ensure jQuery UI datepicker z-index sits above BS5 modals (z-index: 1055) */
.ui-datepicker {
    z-index: 1060 !important;
}

/*
         * FIX #3 — asp:Table inline attribute reset.
         * ASP.NET renders border/cellpadding/cellspacing as HTML attributes
         * which have higher specificity than class selectors.
         * These attribute selectors override them cleanly without !important on .table.
         */
table[border],
table[cellpadding],
table[cellspacing] {
    border: 0;
    border-collapse: collapse;
}

    table[cellpadding] > tbody > tr > td,
    table[cellpadding] > tbody > tr > th {
        padding: 0;
    }

/*
         * FIX #5 — UpdatePanel renders a <span> which breaks grid flow.
         * Make the UpdatePanel span behave like a block so col-* children
         * stack correctly instead of collapsing inline.
         */
.upd-panel-block {
    display: block;
    width: 100%;
}

/* Hidden datepicker input inside date nav */
.cp-datepicker-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    bottom: 0;
    left: 50%;
}

/* ============================================================
           RESPONSIVE
           ============================================================ */
@media (max-width: 576px) {
    main.cp-page-body {
        border-radius: 0;
        box-shadow: none;
        margin-top: 0;
        max-width: 100%;
        padding-top: calc(56px + env(safe-area-inset-top) + 1rem);
    }

    .cp-page-title {
        font-size: 1.4rem;
    }
}

@media (min-width: 768px) {
    .cp-appt-time {
        text-align: center;
        min-width: 200px;
        padding-right: 8px;
        border-right: 1px solid var(--cp-border);
    }

    .cp-appt-details {
        padding-left: 16px;
    }
}
