/* =============================================================================
   YogaRabble — app.css overlay (v2)

   Loads AFTER app.css. Adds:
   - Pill buttons for primary CTAs (Option B: primaries pilled, utilities rounded).
   - Mobile hamburger nav with slide-in drawer.
   - New utility classes that replace common inline-style patterns.
   - Generous corner radii on cards and stat tiles.
   - Fixes the cramped mobile nav on phones.

   Removable: deleting the <link> to this file restores the previous look exactly.
   ============================================================================= */

/* Token additions ------------------------------------------------------------*/
:root {
    --radius-pill: 999px;
    --radius-card: 16px;
    --radius-card-lg: 18px;

    --color-bg-warm: #FBFAF7;          /* slight warm tint for hero/empty cards */
    --color-border-soft: #EFEDE6;      /* warmer border than --color-border */

    --color-success-bg: #D1FAE5;
    --color-success-fg: #065F46;
    --color-warning-bg: #FEF3C7;
    --color-warning-fg: #92400E;

    --shadow-elev-1: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-elev-2: 0 4px 14px rgba(15, 23, 42, 0.06);
}

/* Buttons — pill everything (Airbnb-style uniform rounding). */
.btn,
.btn-accent,
.btn-outline,
.btn-hero,
.btn-ghost {
    border-radius: var(--radius-pill);
    padding: .7rem 1.4rem;
}
.btn-hero { padding: .9rem 1.85rem; font-size: 1.05rem; }

.btn-sm,
.btn-ghost.btn-sm {
    border-radius: var(--radius-pill);
    padding: .4rem .9rem;
    font-size: .875rem;
}

/* Form controls — slightly rounder, but never pilled (pill inputs read awkward) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    border-radius: 10px;
}

/* Cards — softer corners overall ---------------------------------------------*/
.card,
.section-card {
    border-radius: var(--radius-card);
    border-color: var(--color-border-soft);
}

/* Nav: hamburger + drawer for mobile -----------------------------------------
   The PHP partials add: <button class="nav-toggle" ...> and wrap the existing
   .nav-links in <div class="nav-drawer"> (markup change is minimal — see diffs).
   On desktop the drawer is a flex row; on mobile it slides in from the right. */

.site-nav {
    position: relative;
    z-index: 50;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: .5rem;
    cursor: pointer;
    color: var(--color-text);
    border-radius: 8px;
}
.nav-toggle:hover  { background: var(--color-bg); }
.nav-toggle svg    { width: 24px; height: 24px; display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.nav-drawer {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nav-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 40;
    opacity: 0;
    transition: opacity 200ms ease;
}
.nav-drawer-backdrop.is-open {
    display: block;
    opacity: 1;
}

@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .nav-drawer {
        position: fixed;
        top: 0;
        right: 0;
        /* Size to the content (a short nav stack) instead of stretching
           full-height. Capped at the small viewport height so a longer
           link list can still scroll. */
        height: auto;
        max-height: 100svh;
        width: min(210px, 72vw);
        background: var(--color-card);
        border-left: 1px solid var(--color-border-soft);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 1rem 1.25rem;
        padding-bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + .75rem));
        transform: translateX(100%);
        transition: transform 220ms ease;
        z-index: 45;
        box-shadow: -8px 8px 24px rgba(15, 23, 42, 0.08);
        border-radius: 0 0 0 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .nav-drawer.is-open { transform: translateX(0); }

    .nav-drawer a {
        padding: .85rem .5rem;
        font-size: 1rem;
        color: var(--color-text);
        font-weight: 500;
    }
    .nav-drawer a:not(:last-child):not(.btn):not(.btn-sm) {
        border-bottom: 1px solid var(--color-border-soft);
    }
    .nav-drawer a:hover {
        color: var(--color-primary);
        text-decoration: none;
    }
    .nav-drawer a.btn,
    .nav-drawer a.btn-sm {
        margin-top: .75rem;
        text-align: center;
    }
    .nav-drawer .yr-lang-picker-slot {
        display: block;
        margin-top: 1rem;
    }

    /* Re-show the brand text on mobile — it was hidden by app.css. The drawer
       solves the wrap problem; no need to amputate the brand. */
    .site-nav .brand-text { display: inline; }

    /* Tighten the nav bar itself on phones. */
    .site-nav { padding: .5rem 0; }
    .site-nav .brand img { height: 28px; }
}

/* Body lock when drawer is open (set by nav.js) */
body.nav-drawer-open { overflow: hidden; }

/* Page title pattern ---------------------------------------------------------
   Replaces the very common inline <h1 style="margin:0 0 .15rem;
   font-size:1.75rem;letter-spacing:-.01em"> ... pattern. */
.yr-page-title {
    margin: 0 0 .25rem;
    font-size: 1.75rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.yr-page-title.is-centered { text-align: center; }

.yr-page-subtitle {
    margin: 0 0 1.5rem;
    color: var(--color-text-muted);
}
.yr-page-subtitle.is-centered { text-align: center; }

.yr-page-header {
    margin-bottom: 1.75rem;
}

/* Narrow content container ---------------------------------------------------
   Replaces the very common inline style="max-width:820px;margin:0 auto" pattern
   used across bookings, packages, profile, checkout. */
.yr-narrow {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}
.yr-narrow-sm { max-width: 560px; margin-left: auto; margin-right: auto; }

/* Stat tile pattern ----------------------------------------------------------
   Replaces the inline-styled "stat box with colored top border" pattern from
   dashboard.php. */
.yr-stat-tile {
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-card);
    padding: 1rem 1.25rem;
    border-top: 3px solid var(--color-primary);
}
.yr-stat-tile.is-purple { border-top-color: #8B5CF6; }
.yr-stat-tile.is-amber  { border-top-color: #F59E0B; }
.yr-stat-tile.is-coral  { border-top-color: var(--color-accent); }
.yr-stat-tile.is-teal   { border-top-color: var(--color-primary); }

.yr-stat-tile .yr-stat-label {
    font-size: .85rem;
    color: var(--color-text-muted);
    margin-bottom: .25rem;
}
.yr-stat-tile .yr-stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
}

.yr-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* "Next up" hero card --------------------------------------------------------
   Replaces dashboard.php's inline gradient. Subtler than the original — the
   horizontal teal-to-pink gradient was reading as a render glitch. Now it's
   a calm warm-white card with a teal accent stripe. */
.yr-feature-card {
    background: var(--color-bg-warm);
    border: 1px solid var(--color-border-soft);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-card);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-elev-1);
}
.yr-feature-card .yr-feature-eyebrow {
    margin: 0 0 .25rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .72rem;
    font-weight: 600;
    color: var(--color-primary);
}
.yr-feature-card h2 {
    margin: 0 0 .25rem;
    font-size: 1.5rem;
    letter-spacing: -.01em;
}
.yr-feature-card.is-empty {
    text-align: center;
    padding: 2rem 1.5rem;
}

/* Empty state card ----------------------------------------------------------*/
.yr-empty-card {
    background: var(--color-card);
    border: 1px solid var(--color-border-soft);
    border-radius: var(--radius-card);
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}
.yr-empty-card p { margin: 0 0 .75rem; color: var(--color-text-muted); }

/* Quick actions row (used on dashboard, profile, etc.) ----------------------*/
.yr-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
}
.yr-action-row .btn { margin: 0; }

/* Section card refinements --------------------------------------------------*/
.section-card { box-shadow: var(--shadow-elev-1); }
.section-card.is-elevated { box-shadow: var(--shadow-elev-2); }

/* Pills (additional variants beyond admin.css) ------------------------------*/
.pill { padding: .2rem .65rem; }   /* slightly more breathing room */

/* Footer — tighter mobile layout --------------------------------------------*/
.site-footer .footer-links a { white-space: nowrap; }
@media (max-width: 540px) {
    .site-footer .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }
    .site-footer .footer-links {
        /* Generous row gap so wrapped link lines don't visually run into
           each other on narrow phones. white-space: nowrap above also
           keeps each label on a single line. */
        gap: .65rem 1.1rem;
    }
}

/* Auth wrap — tighter on mobile so card edges aren't pinned to the viewport */
@media (max-width: 540px) {
    .auth-wrap { margin: 1rem auto; }
    .auth-wrap .card { padding: 1.25rem; }
}

/* Schedule day card — soften the corners and modernize the day header.
   Skipped on /student/bookings.php (body.bookings-page) because the v2
   tweaks were judged to harm the bookings list organization there. */
body:not(.bookings-page) .yr-day-card {
    border-radius: 14px;
    border-color: var(--color-border-soft);
}
body:not(.bookings-page) .yr-day-header {
    padding-bottom: .6rem;
}

/* Tap target sizing for buttons inside dense rows on mobile ----------------*/
@media (max-width: 540px) {
    .yr-class-row .btn-sm,
    .yr-class-row .btn-ghost {
        min-height: 36px;
    }
}

/* ============================================================
   Schedule week-grid view — used by /admin/schedule.php (admin
   weekly calendar) AND public /studio/{slug} (studio profile
   page's embedded week view). Shared so both surfaces look
   identical and CSS lives in one place.
   ============================================================ */

.yr-week-card { padding: 1.25rem 1.25rem 1.5rem; }
.yr-week-card > h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin: 0 0 1rem;
}

/* All widths: stack days vertically (one full-width card per day) instead
   of the old 7-column grid. The mobile design read more cleanly than the
   cramped desktop grid, so we lifted it to the base. */
.yr-week-grid {
    display: block;
}

.yr-week-day {
    background: #fff;
    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    padding: .85rem 1rem;
    margin-bottom: .6rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-elev-1);
    position: relative;
}
.yr-week-day:last-child { margin-bottom: 0; }
.yr-week-day.is-today {
    border-color: var(--color-primary);
    border-width: 2px;
    /* Compensate for the +1px border so total card size stays identical. */
    padding: calc(.85rem - 1px) calc(1rem - 1px);
}
.yr-week-day.is-empty {
    background: #fff;
}

.yr-week-day-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0 2px;
    /* Let the TODAY pill drop to a new line on narrow desktop columns
       rather than pushing past the column's right edge. */
    flex-wrap: wrap;
}
.yr-week-day-name {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-muted);
}
.yr-week-day-date {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1;
    letter-spacing: -0.01em;
}
.yr-week-day.is-today .yr-week-day-name { color: var(--color-primary); }
.yr-week-day.is-today .yr-week-day-date { color: var(--color-primary-dark); }

.yr-week-day-today {
    margin-left: auto;
    background: var(--color-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 2px 7px;
    border-radius: 999px;
    line-height: 1.4;
    flex-shrink: 0;
}

.yr-week-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #C4C2B8;
    font-size: 13px;
    text-align: center;
    gap: 4px;
    padding: 1rem 0;
}
.yr-week-empty-add,
.yr-week-day-add {
    color: var(--color-primary);
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
}
.yr-week-empty-add:hover,
.yr-week-day-add:hover { text-decoration: underline; }
.yr-week-day-add {
    display: block;
    text-align: center;
    margin-top: .35rem;
    padding: .25rem .35rem;
    border: 1px dashed var(--color-border-soft);
    border-radius: 6px;
}

.yr-week-sessions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.yr-session {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 8px 7px 9px;
    border-radius: 0 8px 8px 0;
    border-left: 3px solid var(--color-text-muted);
    background: #F1EFE8;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 80ms ease, box-shadow 120ms ease;
    position: relative;
}
.yr-session:hover {
    text-decoration: none;
    transform: translateX(1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .08);
}
.yr-session-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    line-height: 1.2;
}
.yr-session-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.3;
    /* Was 2-line clamped on desktop while mobile let it grow — kept long
       titles tidy on the 7-col grid but made cards inconsistent across
       breakpoints. Now both let the title wrap naturally — break mid-word
       if needed so single long words don't overflow the day cell. */
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
}
.yr-session-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 2px;
}
.yr-session-count {
    font-weight: 500;
    flex-shrink: 0;
}

/* Heat variants — color-band on the left, tinted background. (Legacy;
   the alternating green/red override below typically wins for
   non-canceled sessions.) */
.yr-session-full    { background: #FDEBE6; border-left-color: var(--color-accent); }
.yr-session-full .yr-session-time  { color: #B03A1E; }
.yr-session-full .yr-session-count { color: #B03A1E; }

.yr-session-hot     { background: #FEF2EE; border-left-color: #F58A6E; }
.yr-session-hot .yr-session-time { color: #C9462C; }

.yr-session-healthy { background: #E1F0F1; border-left-color: var(--color-primary); }
.yr-session-healthy .yr-session-time { color: #0F6E56; }

.yr-session-low     { background: #F5F4ED; border-left-color: #B4B2A9; }

.yr-session-empty   { background: #FBFAF7; border-left: 3px dashed #D3D1C7; border-radius: 0 8px 8px 0; }

/* "CANCELED" badge — scoped to descendants of .yr-session so the same
   class name on the parent card (the heat classification) doesn't pick
   up these absolute-position + tiny-font styles and squash the card. */
.yr-session .yr-session-canceled {
    position: absolute;
    top: 4px; right: 6px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #991B1B;
    background: #FEE2E2;
    padding: 1px 5px;
    border-radius: 4px;
}
/* Parent-card canceled state — full card greyed, title struck through,
   same layout as an active card. */
.yr-session.yr-session-canceled {
    opacity: .55;
    background: #F1EFE8;
    border-left-color: #D3D1C7;
}
.yr-session.yr-session-canceled .yr-session-title {
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    color: var(--color-text-muted);
}

/* Mobile-only tweaks (layout is now stacked at every width — see the
   base .yr-week-grid / .yr-week-day rules above). What's left here is
   spacing + font-size tightening + the empty-day flex layout. */
@media (max-width: 900px) {
    .yr-week-card { padding: 1rem; }

    .yr-week-day-head { margin-bottom: .65rem; gap: 10px; padding: 0; }
    .yr-week-day-name { font-size: 14px; }
    .yr-week-day-date { font-size: 26px; }
    .yr-week-day-today { font-size: 12px; padding: 4px 10px; }

    .yr-week-day.is-empty { min-height: 0; padding: .55rem 1rem; }
    .yr-week-day.is-empty .yr-week-empty {
        flex-direction: row; gap: 10px; padding: 0;
        font-size: 14px; justify-content: flex-start;
    }
    .yr-week-day.is-empty .yr-week-empty-add { font-size: 14px; }
    .yr-week-day.is-empty .yr-week-day-head { margin-bottom: 0; }

    /* Empty days on mobile — single flex row that wraps cleanly. Drops the
       grid so the Today pill never gets squeezed into a fixed-width column
       and forced onto a second line that overlaps "No classes". */
    .yr-week-day.is-empty {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px 12px;
    }
    .yr-week-day.is-empty .yr-week-day-head {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .yr-week-day.is-empty .yr-week-day-today { margin-left: 0; }
    .yr-week-day.is-empty .yr-week-empty {
        flex: 1 1 0;
        min-width: 0;
        text-align: left;
    }

    .yr-session { padding: 11px 14px 11px 16px; }
    .yr-session-time  { font-size: 15px; }
    .yr-session-title { font-size: 18px; -webkit-line-clamp: unset; overflow: visible; }
    .yr-session-meta  { font-size: 14px; margin-top: 3px; }
}

/* Alternating session colors — teal / orange / purple rotation (3n), to
   match the student-dashboard palette and feel less alarm-bell than the
   previous green/red. Overrides the heat tints for non-canceled rows. */
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n+1) {
    background: #E1F0F1; /* soft teal */
    border-left-color: var(--color-primary);
}
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n+1) .yr-session-time,
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n+1) .yr-session-count {
    color: #0F6E56;
}
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n+2) {
    background: #FEEAD9; /* soft orange */
    border-left-color: #F08A3C;
}
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n+2) .yr-session-time,
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n+2) .yr-session-count {
    color: #9A4A0F;
}
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n) {
    background: #ECE4F5; /* soft purple */
    border-left-color: #7C5AC2;
}
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n) .yr-session-time,
.yr-week-sessions .yr-session:not(.yr-session-canceled):nth-child(3n) .yr-session-count {
    color: #4C2E8B;
}
