/* ==========================================================================
   Szimetrik Sales Portal - Public Booking Page Styles (Calendar View)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap');

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

.booking-outer {
    padding: 2em 0;
}

body.szimetrik-booking-page {
    font-family: 'PT Sans', sans-serif;
    background: #f5f6fa;
    color: #2b2b2b;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

.booking-header {
    margin-bottom: 1.5em;
}

.booking-header h1 {
    font-size: 1.3em;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 0.4em;
}

.booking-subtitle {
    font-size: 0.85em;
    color: #666;
    line-height: 1.5;
}

.booking-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: start;
}

.booking-calendar-section {
    height: 100%;
    background: #fff;
    padding: 1.5em;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
}

.booking-calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1em;
    padding-bottom: 0.8em;
    border-bottom: 1px solid #e4e8ed;
}

.booking-calendar-title {
    font-size: 0.95em;
    font-weight: 700;
    color: #2b2b2b;
}

.booking-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f3f7;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.booking-nav-btn:hover {
    background: #e0e4ea;
}

.booking-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.booking-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    flex: 1 1 auto;
    padding-bottom: 1em;
}

.booking-week-grid:has(.booking-calendar-loading),
.booking-week-grid:has(.booking-empty) {
    display: block;
}

.booking-week-day {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 0.6em;
    border-right: 1px solid #e4e8ed;
}

.booking-week-day:last-child {
    border-right: none;
}

.booking-week-day-head {
    text-align: center;
    padding: 0.5em 0.2em;
    border-bottom: 1px solid #e4e8ed;
    margin-bottom: 0.8em;
}

.booking-week-day-name {
    font-size: clamp(8px, 0.9vw, 11px);
    font-weight: 700;
    color: #999;
    letter-spacing: 0.2px;
    margin-bottom: 0.2em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.booking-week-day-num {
    font-size: 1.05em;
    font-weight: 700;
    color: #2b2b2b;
}

.booking-week-day.is-today .booking-week-day-num {
    color: #d11d27;
}

.booking-week-day.is-past .booking-week-day-name,
.booking-week-day.is-past .booking-week-day-num {
    color: #ccc;
}

.booking-week-day-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.booking-week-day-empty {
    text-align: center;
    color: #ccc;
    font-size: 0.8em;
    padding: 0.4em 0;
}

.booking-calendar-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3em 1em;
    gap: 1em;
}

.booking-calendar-loading p {
    font-size: 0.85em;
    color: #999;
}

.booking-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f3f7;
    border-top-color: #d11d27;
    border-radius: 50%;
    animation: bookingSpinnerRotate 0.8s linear infinite;
}

@keyframes bookingSpinnerRotate {
    to { transform: rotate(360deg); }
}

.booking-form-section {
    background: #3a4a5c;
    padding: 1.5em;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    color: #fff;
}

@media (min-width: 901px) {
    .booking-form-section {
        align-self: stretch;
        padding: 0;
    }

    .booking-form-inner {
        position: sticky;
        top: 1rem;
        padding: 1.5em;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

.booking-form-header h2 {
    font-size: 0.95em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.booking-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2em;
    padding-top: 1em;
    border-top: 1px solid #e4e8ed;
}

.booking-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45em;
}

.booking-legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.booking-legend-swatch.is-available { background: #2e7d32; }
.booking-legend-swatch.is-selected  { background: #d11d27; }
.booking-legend-swatch.is-inactive  { background: #e6e8ec; }

.booking-legend-label {
    font-size: 0.72em;
    font-weight: 700;
    color: #666;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.booking-time-slot {
    padding: 0.45em 0.3em;
    font-size: 0.78em;
    font-weight: 700;
    text-align: center;
    color: #fff;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'PT Sans', sans-serif;
    width: 100%;
    display: block;
}

.booking-time-slot.is-available {
    background: #2e7d32;
    color: #fff;
}

.booking-time-slot.is-available:hover {
    background: #256528;
}

.booking-time-slot.is-inactive {
    background: #e6e8ec;
    color: #9a9da3;
    cursor: not-allowed;
}

.booking-time-slot.is-selected {
    background: #d11d27;
    border-color: #d11d27;
    color: #fff;
}

.booking-time-slot.is-selected:hover {
    background: #b5161f;
}

.booking-selected-time {
    font-size: 0.95em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.2em;
    padding: 0.6em 0.8em;
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #d11d27;
}

.booking-form-callback-note {
    display: block;
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 0.8em;
    padding: 0.5em 0.5em;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.15s ease;
}

.booking-form-callback-note:hover,
.booking-form-callback-note:focus {
    color: #d11d27;
    text-decoration: underline;
}

.booking-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8em;
    margin-bottom: 0.8em;
}

.booking-form-group {
    display: flex;
    flex-direction: column;
}

.booking-form-group.booking-form-full {
    margin-bottom: 0.8em;
}

.booking-form-group label {
    font-size: 0.8em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4em;
}

.booking-form-group input[type="text"],
.booking-form-group input[type="email"],
.booking-form-group input[type="tel"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    font-family: 'PT Sans', sans-serif;
    border: 1px solid #5a6a7c;
    background: #fff;
    color: #2b2b2b;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.booking-form-group input::placeholder {
    color: #999;
}

.booking-form-group input:focus {
    outline: none;
    border-color: #d11d27;
    background: #fff;
}

.booking-form-note {
    font-size: 0.7em;
    color: #fff;
    margin-bottom: 2.8em;
}

.booking-form-error {
    font-size: 0.75em;
    color: #ff6b6b;
    padding: 0.5em 0.7em;
    background: rgba(255, 107, 107, 0.1);
    margin-bottom: 0.8em;
    display: none;
}

.booking-form-acceptance {
    margin-bottom: 1em;
}

.booking-acceptance-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    font-size: 0.75em;
    color: #fff;
    cursor: pointer;
}

.booking-acceptance-label input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 0.1em;
    cursor: pointer;
    accent-color: #d11d27;
}

.booking-acceptance-label a {
    color: #fff;
    text-decoration: underline;
}

.booking-acceptance-label a:hover,
.booking-acceptance-label a:focus {
    color: #d11d27;
}

.booking-form-error.is-visible {
    display: block;
}

.booking-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    padding: 10px 20px;
    font-size: 0.8em;
    font-weight: 700;
    font-family: 'PT Sans', sans-serif;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.booking-btn-primary {
    background: #d11d27;
    color: #fff;
}

.booking-btn-primary:hover {
    background: #b5161f;
}

.booking-btn-secondary {
    background: #f0f3f7;
    color: #666;
}

.booking-btn-secondary:hover {
    background: #e0e4ea;
}

.booking-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.booking-success-overlay.booking-section-hidden {
    opacity: 0;
    pointer-events: none;
}

.booking-success-content {
    background: #fff;
    padding: 3em 2em;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.booking-success-icon {
    margin-bottom: 1em;
}

.booking-success-icon svg {
    color: #27ae60;
    stroke: #27ae60;
}

.booking-success-content h2 {
    font-size: 1.5em;
    color: #2b2b2b;
    margin-bottom: 0.5em;
}

.booking-success-content p {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 1.5em;
    line-height: 1.6;
}

.booking-success-content .booking-btn {
    max-width: 300px;
    margin: 0 auto;
}

.booking-loading {
    grid-column: 1 / -1;
    padding: 2em 1em;
    text-align: center;
    color: #fff;
    font-size: 0.85em;
}

.booking-empty {
    grid-column: 1 / -1;
    padding: 2em 1em;
    text-align: center;
    color: #fff;
    font-size: 0.85em;
}

@media (max-width: 900px) {
    .booking-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .booking-week-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .booking-week-day-head {
        padding: 0.4em 0.2em;
    }
}

@media (max-width: 600px) {
    .booking-header h1 {
        font-size: 1.4em;
    }

    .booking-form-row {
        grid-template-columns: 1fr;
    }

    .booking-week-grid {
        grid-template-columns: 1fr;
    }

    .booking-week-day {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 0.6em 0;
        border-right: none;
        border-bottom: 1px solid #e4e8ed;
    }

    .booking-week-day:last-child {
        border-bottom: none;
    }

    .booking-week-day-head {
        flex: 0 0 60px;
        margin-bottom: 0;
        border-bottom: none;
        border-right: 1px solid #e4e8ed;
    }

    .booking-week-day-slots {
        flex: 1;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .booking-time-slot {
        width: auto;
        min-width: 60px;
    }
}
