/* ==========================================================================
   KBS Event Fittings — Frontend Styles (Mobile-First)
   ========================================================================== */

/* CSS Variables (overridden by inline styles from plugin settings) */
:root {
    --kbs-fe-primary: #1a1a2e;
    --kbs-fe-accent: #e94560;
}

/* ==========================================================================
   Booking Form Wrapper
   ========================================================================== */

.kbs-booking-wrapper,
.kbs-contest-wrapper {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    position: relative;
}

.kbs-booking-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--kbs-fe-primary);
    text-align: center;
    margin: 0 0 8px;
    line-height: 1.3;
}

.kbs-booking-subheading {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ==========================================================================
   Progress Steps (Circle/Square/Rounded — default)
   ========================================================================== */

.kbs-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 8px;
}

.kbs-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: opacity .3s ease;
}

.kbs-step.active,
.kbs-step.completed {
    opacity: 1;
}

.kbs-step-num {
    width: var(--kbs-step-size, 32px);
    height: var(--kbs-step-size, 32px);
    border-radius: var(--kbs-step-radius, 50%);
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--kbs-step-size, 32px) * 0.44);
    font-weight: 600;
    transition: all .3s ease;
    line-height: 1;
}

.kbs-step-num i {
    font-size: calc(var(--kbs-step-size, 32px) * 0.44);
    line-height: 1;
}

.kbs-step-num svg {
    width: calc(var(--kbs-step-size, 32px) * 0.5);
    height: calc(var(--kbs-step-size, 32px) * 0.5);
}

.kbs-step.active .kbs-step-num {
    background: var(--kbs-step-active, var(--kbs-fe-accent));
    color: #fff;
}

.kbs-step.completed .kbs-step-num {
    background: var(--kbs-step-completed, var(--kbs-fe-primary));
    color: #fff;
}

.kbs-step-label {
    font-size: 11px;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kbs-step.active .kbs-step-label {
    color: var(--kbs-step-active, var(--kbs-fe-accent));
}

.kbs-step-line {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 8px;
    margin-bottom: 18px;
    max-width: 40px;
}

.kbs-step.completed + .kbs-step-line {
    background: var(--kbs-step-completed, var(--kbs-fe-primary));
}

/* ==========================================================================
   Progress Bar Style
   ========================================================================== */

.kbs-progress-bar-wrap {
    margin-bottom: 28px;
    padding: 0 8px;
}

.kbs-progress-bar-track {
    width: 100%;
    height: var(--kbs-bar-height, 6px);
    background: #e9ecef;
    border-radius: calc(var(--kbs-bar-height, 6px) / 2);
    overflow: hidden;
}

.kbs-progress-bar-fill {
    height: 100%;
    background: var(--kbs-step-active, var(--kbs-fe-accent));
    border-radius: calc(var(--kbs-bar-height, 6px) / 2);
    transition: width .4s ease;
}

.kbs-progress-bar-label {
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
    margin-top: 8px;
}

/* ==========================================================================
   Minimal Dots Style
   ========================================================================== */

.kbs-steps-minimal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 8px;
}

.kbs-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    transition: opacity .3s ease;
}

.kbs-step-dot.active,
.kbs-step-dot.completed {
    opacity: 1;
}

.kbs-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ced4da;
    transition: all .3s ease;
}

.kbs-step-dot.active .kbs-dot {
    width: 12px;
    height: 12px;
    background: var(--kbs-step-active, var(--kbs-fe-accent));
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.kbs-step-dot.completed .kbs-dot {
    background: var(--kbs-step-completed, var(--kbs-fe-primary));
}

.kbs-step-dot .kbs-step-label {
    font-size: 10px;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kbs-step-dot.active .kbs-step-label {
    color: var(--kbs-step-active, var(--kbs-fe-accent));
}

.kbs-step-line-minimal {
    flex: 1;
    height: 2px;
    background: #e9ecef;
    margin: 0 10px;
    margin-bottom: 20px;
    max-width: 36px;
}

.kbs-step-dot.completed + .kbs-step-line-minimal {
    background: var(--kbs-step-completed, var(--kbs-fe-primary));
}

/* ==========================================================================
   Step Title
   ========================================================================== */

.kbs-step-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--kbs-fe-primary);
    margin: 0 0 16px;
}

/* ==========================================================================
   Date Pills
   ========================================================================== */

.kbs-date-pills {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kbs-date-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.kbs-date-pill:hover {
    border-color: var(--kbs-fe-accent);
}

.kbs-date-pill.selected {
    border-color: var(--kbs-fe-accent);
    background: rgba(233, 69, 96, 0.04);
}

.kbs-date-pill-date {
    font-weight: 600;
    font-size: 15px;
    color: #212529;
}

.kbs-date-pill-time {
    font-size: 13px;
    color: #6c757d;
}

.kbs-date-pill-arrow {
    font-size: 18px;
    color: #ced4da;
    transition: color .2s ease;
}

.kbs-date-pill:hover .kbs-date-pill-arrow,
.kbs-date-pill.selected .kbs-date-pill-arrow {
    color: var(--kbs-fe-accent);
}

/* ==========================================================================
   Hold Timer
   ========================================================================== */

.kbs-hold-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f0f7ff;
    border: 1px solid #b3d4fc;
    border-radius: 10px;
    font-size: 14px;
    color: #004085;
    margin-bottom: 16px;
    text-align: center;
    animation: kbs-hold-fadein 0.3s ease;
}

.kbs-hold-timer .kbs-hold-icon {
    font-size: 18px;
}

.kbs-hold-timer .kbs-hold-time {
    font-variant-numeric: tabular-nums;
    font-size: 16px;
    color: #004085;
}

.kbs-hold-timer.kbs-hold-urgent {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.kbs-hold-timer.kbs-hold-urgent .kbs-hold-time {
    color: #e74c3c;
}

@keyframes kbs-hold-fadein {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Time Slot Grid
   ========================================================================== */

.kbs-time-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.kbs-time-slot {
    padding: 12px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.kbs-time-slot:hover:not(.unavailable) {
    border-color: var(--kbs-fe-accent);
}

.kbs-time-slot.selected {
    border-color: var(--kbs-fe-accent);
    background: rgba(233, 69, 96, 0.04);
}

.kbs-time-slot.unavailable {
    opacity: 0.35;
    cursor: not-allowed;
    text-decoration: line-through;
}

.kbs-time-slot-time {
    font-weight: 600;
    font-size: 15px;
    color: #212529;
}

.kbs-time-slot-avail {
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.kbs-fe-field {
    margin-bottom: 16px;
}

.kbs-fe-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.kbs-required {
    color: var(--kbs-fe-accent);
}

.kbs-fe-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS zoom */
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    color: #212529;
    transition: border-color .2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.kbs-fe-input:focus {
    border-color: var(--kbs-fe-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.kbs-fe-input.error {
    border-color: #e74c3c;
}

.kbs-field-error {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
    min-height: 0;
}

textarea.kbs-fe-input {
    min-height: 80px;
    resize: vertical;
}

/* ==========================================================================
   Contest Opt-in Checkbox
   ========================================================================== */

.kbs-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 14px 16px;
    background: #fffbf0;
    border: 2px solid #ffe69c;
    border-radius: 10px;
    font-size: 14px;
    color: #495057;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

.kbs-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--kbs-fe-accent);
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.kbs-fe-submit {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    background: var(--kbs-fe-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease;
    -webkit-tap-highlight-color: transparent;
    margin-top: 8px;
}

.kbs-fe-submit:hover {
    background: color-mix(in srgb, var(--kbs-fe-accent) 85%, #000);
}

.kbs-fe-submit:active {
    transform: scale(0.98);
}

.kbs-fe-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Back Button
   ========================================================================== */

.kbs-back-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    padding: 12px 0;
    margin-top: 8px;
    -webkit-tap-highlight-color: transparent;
}

.kbs-back-btn:hover {
    color: var(--kbs-fe-primary);
}

/* ==========================================================================
   Confirmation
   ========================================================================== */

.kbs-confirmation {
    text-align: center;
    padding: 16px 0;
}

.kbs-confirmation-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #d4edda;
    color: #155724;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.kbs-confirmation-text {
    font-size: 15px;
    color: #495057;
    margin: 0 0 20px;
}

.kbs-confirmation-details {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    text-align: left;
    margin: 0 0 16px;
}

.kbs-confirmation-details .kbs-cd-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
}

.kbs-confirmation-details .kbs-cd-row:last-child {
    border-bottom: none;
}

.kbs-confirmation-details .kbs-cd-label {
    color: #6c757d;
    font-weight: 500;
}

.kbs-confirmation-details .kbs-cd-value {
    color: #212529;
    font-weight: 600;
}

.kbs-confirmation-note {
    font-size: 13px;
    color: #6c757d;
}

/* ==========================================================================
   Loading
   ========================================================================== */

.kbs-loading {
    text-align: center;
    padding: 24px;
    color: #6c757d;
    font-size: 14px;
}

.kbs-booking-loading {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
}

.kbs-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e9ecef;
    border-top-color: var(--kbs-fe-accent);
    border-radius: 50%;
    animation: kbs-spin 0.7s linear infinite;
}

@keyframes kbs-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Event Info Widget
   ========================================================================== */

.kbs-event-info-wrapper {
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 16px;
    text-align: center;
}

.kbs-event-info-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--kbs-fe-primary);
    margin: 0 0 12px;
}

.kbs-event-info-desc {
    font-size: 15px;
    color: #495057;
    line-height: 1.6;
    margin: 0 0 16px;
}

.kbs-event-info-meta {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 20px;
}

.kbs-event-info-icon {
    margin-right: 4px;
}

.kbs-event-info-dates {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.kbs-event-info-date-pill {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 14px;
}

.kbs-event-info-date-pill strong {
    color: #212529;
}

.kbs-event-info-date-pill span {
    color: #6c757d;
    font-size: 13px;
}

/* Countdown */
.kbs-countdown {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.kbs-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kbs-countdown-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--kbs-fe-accent);
    line-height: 1;
}

.kbs-countdown-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-top: 4px;
}

/* ==========================================================================
   Contest Success
   ========================================================================== */

.kbs-contest-success {
    text-align: center;
    padding: 32px 16px;
}

.kbs-contest-success h3 {
    font-size: 22px;
    color: var(--kbs-fe-primary);
    margin: 0 0 8px;
}

.kbs-contest-success p {
    color: #6c757d;
    font-size: 15px;
}

/* ==========================================================================
   Tablet & Desktop Enhancements
   ========================================================================== */

@media (min-width: 480px) {
    .kbs-time-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .kbs-booking-wrapper,
    .kbs-contest-wrapper,
    .kbs-event-info-wrapper {
        padding: 32px 24px;
    }

    .kbs-booking-heading {
        font-size: 26px;
    }

    .kbs-date-pills {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .kbs-date-pill {
        flex: 1;
        min-width: 140px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
    }

    .kbs-date-pill-arrow {
        display: none;
    }

    .kbs-event-info-dates {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .kbs-event-info-date-pill {
        flex: 0 0 auto;
        min-width: 160px;
    }
}

@media (min-width: 1024px) {
    .kbs-time-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .kbs-countdown-value {
        font-size: 40px;
    }
}
