/*
 * RC Racer Hwb Bookings - theme bridge stylesheet
 * This file deliberately avoids heavy fixed colours so the active theme can own the look.
 * Override the variables below in the theme stylesheet if required.
 */

:root {
    --rcrhwb-bookings-accent: var(--rcrhwb-accent, var(--rcrhwb-orange, #ff6a00));
    --rcrhwb-bookings-accent-contrast: var(--rcrhwb-accent-contrast, #111827);
    --rcrhwb-bookings-bg: var(--rcrhwb-surface, var(--rcrhwb-card-bg, rgba(255,255,255,.045)));
    --rcrhwb-bookings-bg-strong: var(--rcrhwb-surface-strong, var(--rcrhwb-card-bg-strong, rgba(255,255,255,.075)));
    --rcrhwb-bookings-text: var(--rcrhwb-text, currentColor);
    --rcrhwb-bookings-muted: var(--rcrhwb-muted, #9ca3af);
    --rcrhwb-bookings-border: var(--rcrhwb-border, var(--rcrhwb-line, rgba(148,163,184,.26)));
    --rcrhwb-bookings-radius: var(--rcrhwb-radius, 18px);
    --rcrhwb-bookings-radius-sm: var(--rcrhwb-radius-sm, 12px);
    --rcrhwb-bookings-shadow: var(--rcrhwb-shadow, 0 12px 30px rgba(0,0,0,.14));
    --rcrhwb-bookings-success: var(--rcrhwb-success, #22c55e);
    --rcrhwb-bookings-warn: var(--rcrhwb-warn, #f59e0b);
    --rcrhwb-bookings-danger: var(--rcrhwb-danger, #ef4444);
}

.rcrhwb-bookings,
.rcrhwb-bookings * {
    box-sizing: border-box;
}

.rcrhwb-bookings {
    color: var(--rcrhwb-bookings-text);
    font-family: inherit;
}

.rcrhwb-bookings a {
    color: inherit;
}

.rcrhwb-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.rcrhwb-event-card,
.rcrhwb-booking-form-wrap,
.rcrhwb-entry-list,
.rcrhwb-my-booking-card,
.rcrhwb-form-card,
.rcrhwb-calendar-widget {
    background: var(--rcrhwb-bookings-bg);
    border: 1px solid var(--rcrhwb-bookings-border);
    border-radius: var(--rcrhwb-bookings-radius);
    box-shadow: var(--rcrhwb-bookings-shadow);
    padding: 1.25rem;
}

.rcrhwb-event-card h3,
.rcrhwb-booking-header h2,
.rcrhwb-entry-list h3,
.rcrhwb-my-bookings h2,
.rcrhwb-calendar-head h2,
.rcrhwb-calendar-list h3 {
    color: inherit;
    margin: .25rem 0 .5rem;
    line-height: 1.1;
}

.rcrhwb-event-card__topline,
.rcrhwb-kicker,
.rcrhwb-entry-table th,
.rcrhwb-calendar-day-name,
.rcrhwb-calendar-event strong {
    color: var(--rcrhwb-bookings-accent);
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .78rem;
}

.rcrhwb-event-meta,
.rcrhwb-event-status {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    color: var(--rcrhwb-bookings-muted);
    margin: .8rem 0;
}

.rcrhwb-event-meta span,
.rcrhwb-event-status span:not(.rcrhwb-pill),
.rcrhwb-calendar-count {
    background: var(--rcrhwb-bookings-bg-strong);
    border: 1px solid var(--rcrhwb-bookings-border);
    border-radius: 999px;
    padding: .35rem .65rem;
}

.rcrhwb-event-notes {
    color: inherit;
    opacity: .86;
    font-size: .95rem;
    border-top: 1px solid var(--rcrhwb-bookings-border);
    margin-top: 1rem;
    padding-top: 1rem;
}

.rcrhwb-event-actions {
    margin-top: 1rem;
}

.rcrhwb-button,
.rcrhwb-button:visited,
.rcrhwb-bookings button.rcrhwb-button,
.rcrhwb-bookings input[type="submit"].rcrhwb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid color-mix(in srgb, var(--rcrhwb-bookings-accent) 70%, transparent);
    background: color-mix(in srgb, var(--rcrhwb-bookings-accent) 14%, transparent);
    color: inherit;
    border-radius: 999px;
    padding: .7rem 1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.2;
}

.rcrhwb-button:hover,
.rcrhwb-button:focus,
.rcrhwb-button--primary {
    background: var(--rcrhwb-bookings-accent);
    color: var(--rcrhwb-bookings-accent-contrast);
    text-decoration: none;
}

.rcrhwb-booking-header,
.rcrhwb-calendar-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    border-bottom: 1px solid var(--rcrhwb-bookings-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.rcrhwb-booking-header p,
.rcrhwb-payment-note,
.rcrhwb-calendar-list-item span:not(.rcrhwb-pill) {
    color: var(--rcrhwb-bookings-muted);
    margin: 0;
}

.rcrhwb-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
}

.rcrhwb-booking-form label,
.rcrhwb-class-picker legend,
.rcrhwb-booking-type legend {
    color: inherit;
    font-weight: 700;
}

.rcrhwb-booking-form input,
.rcrhwb-booking-form textarea,
.rcrhwb-booking-form select {
    width: 100%;
    border: 1px solid var(--rcrhwb-bookings-border);
    background: var(--rcrhwb-input-bg, var(--rcrhwb-bookings-bg-strong));
    color: inherit;
    border-radius: var(--rcrhwb-bookings-radius-sm);
    padding: .75rem;
    margin-top: .35rem;
    font: inherit;
}

.rcrhwb-booking-form input:focus,
.rcrhwb-booking-form textarea:focus,
.rcrhwb-booking-form select:focus {
    outline: 2px solid color-mix(in srgb, var(--rcrhwb-bookings-accent) 45%, transparent);
    outline-offset: 2px;
}

.rcrhwb-booking-form textarea {
    display: block;
    margin-bottom: .9rem;
}

.rcrhwb-class-picker,
.rcrhwb-booking-type {
    border: 1px solid var(--rcrhwb-bookings-border);
    border-radius: var(--rcrhwb-bookings-radius);
    padding: 1rem;
    margin: 1rem 0;
}

.rcrhwb-class-picker p {
    color: var(--rcrhwb-bookings-muted);
    margin-top: .2rem;
}

.rcrhwb-class-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .7rem;
}

.rcrhwb-class-options label,
.rcrhwb-booking-type label {
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--rcrhwb-bookings-border);
    border-radius: var(--rcrhwb-bookings-radius-sm);
    padding: .75rem;
    background: var(--rcrhwb-bookings-bg-strong);
}

.rcrhwb-class-options input,
.rcrhwb-checks input,
.rcrhwb-booking-type input {
    width: auto;
    margin: 0;
}

.rcrhwb-class-options small {
    color: var(--rcrhwb-bookings-muted);
    margin-left: auto;
}

.rcrhwb-class-options .is-disabled {
    opacity: .45;
}

.rcrhwb-checks {
    display: grid;
    gap: .6rem;
    margin: 1rem 0;
}

.rcrhwb-checks label {
    display: flex;
    gap: .45rem;
    align-items: flex-start;
}

.rcrhwb-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .28rem .6rem;
    background: var(--rcrhwb-bookings-bg-strong);
    border: 1px solid var(--rcrhwb-bookings-border);
    color: inherit;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.rcrhwb-pill--open,
.rcrhwb-pill--confirmed,
.rcrhwb-pill--paid {
    background: color-mix(in srgb, var(--rcrhwb-bookings-success) 16%, transparent);
    border-color: color-mix(in srgb, var(--rcrhwb-bookings-success) 45%, transparent);
}

.rcrhwb-pill--soon,
.rcrhwb-pill--reserve,
.rcrhwb-pill--unpaid {
    background: color-mix(in srgb, var(--rcrhwb-bookings-warn) 16%, transparent);
    border-color: color-mix(in srgb, var(--rcrhwb-bookings-warn) 45%, transparent);
}

.rcrhwb-pill--closed,
.rcrhwb-pill--full,
.rcrhwb-pill--cancelled,
.rcrhwb-pill--error {
    background: color-mix(in srgb, var(--rcrhwb-bookings-danger) 16%, transparent);
    border-color: color-mix(in srgb, var(--rcrhwb-bookings-danger) 45%, transparent);
}

.rcrhwb-entry-list {
    margin-top: 1.25rem;
}

.rcrhwb-entry-table-wrap {
    overflow-x: auto;
}

.rcrhwb-entry-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}

.rcrhwb-entry-table th,
.rcrhwb-entry-table td {
    border-bottom: 1px solid var(--rcrhwb-bookings-border);
    padding: .75rem;
    text-align: left;
    vertical-align: top;
}

.rcrhwb-empty,
.rcrhwb-alert {
    border-radius: var(--rcrhwb-bookings-radius-sm);
    padding: 1rem;
    background: var(--rcrhwb-bookings-bg-strong);
    border: 1px solid var(--rcrhwb-bookings-border);
    color: inherit;
}

.rcrhwb-alert {
    margin: 1rem 0;
}

.rcrhwb-alert--success {
    background: color-mix(in srgb, var(--rcrhwb-bookings-success) 14%, transparent);
    border-color: color-mix(in srgb, var(--rcrhwb-bookings-success) 35%, transparent);
}

.rcrhwb-alert--error {
    background: color-mix(in srgb, var(--rcrhwb-bookings-danger) 14%, transparent);
    border-color: color-mix(in srgb, var(--rcrhwb-bookings-danger) 35%, transparent);
}

.rcrhwb-my-bookings {
    display: grid;
    gap: 1rem;
}

.rcrhwb-my-booking-card {
    display: grid;
    gap: .35rem;
}

.rcrhwb-child-field {
    position: relative;
}

.rcrhwb-child-field::after {
    content: "Child booking only";
    display: inline-block;
    margin-top: .35rem;
    color: var(--rcrhwb-bookings-muted);
    font-size: .78rem;
    font-weight: 600;
}

.rcrhwb-calendar-nav {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.rcrhwb-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .45rem;
}

.rcrhwb-calendar-cell {
    min-height: 112px;
    border: 1px solid var(--rcrhwb-bookings-border);
    border-radius: var(--rcrhwb-bookings-radius-sm);
    background: var(--rcrhwb-bookings-bg-strong);
    padding: .55rem;
    overflow: hidden;
}

.rcrhwb-calendar-cell--empty {
    opacity: .25;
}

.rcrhwb-calendar-cell.is-today {
    border-color: color-mix(in srgb, var(--rcrhwb-bookings-accent) 75%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rcrhwb-bookings-accent) 25%, transparent);
}

.rcrhwb-calendar-cell.is-past {
    opacity: .55;
}

.rcrhwb-calendar-date {
    font-weight: 900;
    margin-bottom: .45rem;
}

.rcrhwb-calendar-event,
.rcrhwb-calendar-event:visited {
    display: grid;
    gap: .08rem;
    margin-top: .35rem;
    padding: .45rem;
    border-radius: var(--rcrhwb-bookings-radius-sm);
    border: 1px solid var(--rcrhwb-bookings-border);
    background: color-mix(in srgb, var(--rcrhwb-bookings-accent) 14%, transparent);
    color: inherit;
    text-decoration: none;
    font-size: .82rem;
    line-height: 1.2;
}

.rcrhwb-calendar-event:hover {
    background: color-mix(in srgb, var(--rcrhwb-bookings-accent) 28%, transparent);
    text-decoration: none;
}

.rcrhwb-calendar-list {
    margin-top: 1.25rem;
    border-top: 1px solid var(--rcrhwb-bookings-border);
    padding-top: 1rem;
}

.rcrhwb-calendar-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: .75rem;
    border: 1px solid var(--rcrhwb-bookings-border);
    border-radius: var(--rcrhwb-bookings-radius-sm);
    padding: .8rem;
    background: var(--rcrhwb-bookings-bg-strong);
    margin-bottom: .65rem;
}

.rcrhwb-calendar-list-item strong {
    display: block;
}

.rcrhwb-calendar-count {
    white-space: nowrap;
}

/* Admin keeps WordPress native styling rather than inheriting dark theme variables. */
.rcrhwb-admin .rcrhwb-form-card {
    color: #1d2327;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    box-shadow: none;
    max-width: 1100px;
    margin-top: 1rem;
}

.rcrhwb-admin .rcrhwb-admin-actions {
    margin: 1rem 0;
}

.rcrhwb-admin .rcrhwb-inline-form {
    display: inline;
}

@media (max-width: 900px) {
    .rcrhwb-calendar-grid {
        display: block;
    }

    .rcrhwb-calendar-day-name,
    .rcrhwb-calendar-cell--empty {
        display: none;
    }

    .rcrhwb-calendar-cell {
        min-height: auto;
        margin-bottom: .55rem;
    }

    .rcrhwb-calendar-cell:not(:has(.rcrhwb-calendar-event)) {
        display: none;
    }

    .rcrhwb-calendar-date::before {
        content: "Day ";
        color: var(--rcrhwb-bookings-muted);
        font-weight: 700;
    }

    .rcrhwb-calendar-list-item {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .rcrhwb-calendar-head,
    .rcrhwb-booking-header {
        display: block;
    }

    .rcrhwb-calendar-nav {
        justify-content: flex-start;
        margin-top: .75rem;
    }
}

@media (max-width: 720px) {
    .rcrhwb-form-grid {
        display: block;
    }

    .rcrhwb-booking-header .rcrhwb-pill {
        margin-top: .75rem;
    }

    .rcrhwb-event-card,
    .rcrhwb-booking-form-wrap,
    .rcrhwb-entry-list,
    .rcrhwb-calendar-widget {
        padding: 1rem;
        border-radius: var(--rcrhwb-bookings-radius-sm);
    }
}

/* v0.4.0 primary entrant + child booking form */
.rcrhwb-form-section {
    border: 1px solid var(--rcrhwb-bookings-border, rgba(148, 163, 184, .25));
    border-radius: 18px;
    padding: clamp(1rem, 2vw, 1.35rem);
    margin: 1rem 0;
    background: var(--rcrhwb-bookings-bg, transparent);
}

.rcrhwb-section-head,
.rcrhwb-child-entry__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.rcrhwb-section-head h3 {
    margin: .15rem 0 .25rem;
}

.rcrhwb-section-head p {
    margin: 0;
    color: var(--rcrhwb-bookings-muted, inherit);
}

.rcrhwb-form-grid--booking-core {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rcrhwb-form-grid select {
    width: 100%;
    min-height: 42px;
}

.rcrhwb-login-nudge,
.rcrhwb-save-profile {
    display: block;
    margin-top: 1rem;
    padding: .85rem 1rem;
    border-radius: 14px;
    border: 1px dashed var(--rcrhwb-bookings-border, rgba(148, 163, 184, .35));
}

.rcrhwb-child-entry {
    border: 1px solid var(--rcrhwb-bookings-border, rgba(148, 163, 184, .25));
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
}

.rcrhwb-button--ghost {
    background: transparent;
}

.rcrhwb-button--small {
    min-height: 32px;
    padding: .35rem .7rem;
    font-size: .9rem;
}

@media (max-width: 900px) {
    .rcrhwb-form-grid--booking-core {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .rcrhwb-form-grid--booking-core {
        grid-template-columns: 1fr;
    }
    .rcrhwb-section-head,
    .rcrhwb-child-entry__head {
        display: block;
    }
    .rcrhwb-section-head .rcrhwb-button,
    .rcrhwb-child-entry__head .rcrhwb-button {
        margin-top: .75rem;
    }
}
