/**
 * Sally's OpenTable Booking Widget Styles
 * Designed to match site aesthetic: dark colors, red accents, Avenir/Bebas fonts
 */

/* ========================================
   Booking Button Trigger - Uses Site Button Classes
   ======================================== */
/* Trigger button inherits from site .btn class */

/* ========================================
   Modal Overlay & Container
   ======================================== */
.sallys-opentable-modal {
    background-color: rgba(0, 0, 0, 0.9);
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
    font-family: "Avenir LT Pro", sans-serif;
    font-size: 14px;
}

.sallys-opentable-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.sallys-opentable-modal__wrap {
    position: relative;
    width: 90%;
    max-width: 800px;
    background: black;
    border: 2px solid white;
    padding: 40px;
    margin: 100px auto;
    color: white;
}

.sallys-opentable-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: color 0.2s ease;
}

.sallys-opentable-modal__close:hover {
    color: var(--cs-primary);
}

/* ========================================
   Powered by OpenTable
   ======================================== */
.sallys-opentable-modal__powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    margin-top: 30px;
    padding-top: 20px;
}

.sallys-opentable-modal__powered-by span {
    white-space: nowrap;
    color: white;
    opacity: 0.7;
    font-size: 13px;
}

.sallys-opentable-modal__opentable-logo {
    height: 20px;
    width: auto;
    display: block;
}

/* ========================================
   Widget Container
   ======================================== */
.sallys-opentable-widget {
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: "Avenir LT Pro", sans-serif;
}

#booking-results {
    background: black;
}

.sallys-opentable-widget h3 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 2.5em;
    margin: 0 0 30px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ========================================
   Form Elements
   ======================================== */
#opentable-booking-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#opentable-booking-form .form-group {
    margin-bottom: 0;
}

#opentable-booking-form #find-times-btn {
    grid-column: 1 / -1;
}

.sallys-opentable-widget .form-group {
    margin-bottom: 20px;
}

.sallys-opentable-widget .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: white;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sallys-opentable-widget .form-group input,
.sallys-opentable-widget .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #525252;
    border-radius: 0;
    font-size: 14px;
    font-family: "Avenir LT Pro", sans-serif;
    transition: border-color 0.2s ease-in-out;
    box-sizing: border-box;
    background: #141414;
    color: white;
}

/* Make date input consistent size and calendar icon white */
.sallys-opentable-widget .form-group input[type="date"] {
    height: 40px;
    line-height: normal;
}

.sallys-opentable-widget .form-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(100);
    cursor: pointer;
    opacity: 1;
}

.sallys-opentable-widget .form-group input:focus,
.sallys-opentable-widget .form-group select:focus {
    outline: none;
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 2px rgba(78, 199, 105, 0.2);
}

.sallys-opentable-widget .form-group select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 40px;
}

/* Button styling inherits from site .btn class */
.sallys-opentable-widget .btn {
    width: 100%;
    display: block;
}

.sallys-opentable-widget .btn:disabled {
    background: #525252;
    border-color: #525252;
    cursor: not-allowed;
    opacity: 0.5;
}

.sallys-opentable-widget .btn:disabled:hover {
    background: #525252;
    color: white;
}

/* ========================================
   Error Messages
   ======================================== */
.opentable-error,
.sallys-opentable-widget .error-message {
    color: var(--cs-primary);
    padding: 15px;
    border: 1px solid var(--cs-primary);
    border-radius: 0;
    background: rgba(228, 30, 37, 0.1);
    font-weight: 500;
    margin-top: 15px;
}

/* ========================================
   Loading Spinner
   ======================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #525252;
    border-top: 2px solid var(--cs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.loading-container p {
    margin-top: 15px;
    color: #f5f5f7;
    font-size: 14px;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--cs-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* ========================================
   Availability Results
   ======================================== */
.availability-results {
    border: none;
    background: black;
    border-radius: 0;
    padding: 0px;
    margin-top: 25px;
}

.availability-results h4 {
    margin-top: 0;
    color: white;
    font-size: 20px;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 1px;
}

.availability-results h5 {
    color: var(--cs-primary);
    margin-bottom: 20px;
    font-size: 16px;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 1px;
}

.time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Time buttons - green background with white text */
.time-btn {
    flex: 0 0 auto;
    width: auto !important;
    min-width: auto;
    background: rgb(28, 28, 28) !important;
    color: var(--cs-primary) !important;
    /* border: 2px solid var(--cs-primary) !important; */
    border-radius: 3px;
    border: 0 !important;
    font-size: 0.95em !important;
    padding: 0.55em 0.75em 0.45em !important;
}

.time-btn:hover {
    background: var(--cs-primary) !important;
    color: black !important;
    /* border-color: var(--cs-primary) !important; */
}

/* Legacy time-slot styling (if still used elsewhere) */
.time-slot {
    border: 1px solid #525252;
    padding: 15px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0;
    transition: all 0.2s ease-in-out;
}

.time-slot:hover {
    border-color: var(--cs-primary);
    background: rgba(78, 199, 105, 0.1);
}

.time-slot > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.time-slot strong {
    font-size: 18px;
    color: white;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 1px;
}

.time-slot span {
    font-size: 12px;
    opacity: 0.7;
    color: #f5f5f7;
}

/* Book Now button inherits from site .btn class */
.book-now-btn {
    white-space: nowrap;
}

/* ========================================
   Guest Info Form
   ======================================== */
.guest-info-container {
    /* border: 1px solid #525252;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0;
    padding: 25px;
    margin-top: 20px; */
}

.guest-info-container h4 {
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.8em;
    margin: 0 0 20px;
    color: white;
    letter-spacing: 1px;
}

.guest-info-container .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.guest-info-container textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #525252;
    border-radius: 0;
    font-size: 14px;
    font-family: "Avenir LT Pro", sans-serif;
    background: #141414;
    color: white;
    resize: vertical;
    min-height: 80px;
}

.guest-info-container textarea:focus {
    outline: none;
    border-color: var(--cs-primary);
    box-shadow: 0 0 0 2px rgba(78, 199, 105, 0.2);
}

.guest-info-container .checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.guest-info-container .checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.guest-info-container .checkbox-group label {
    margin: 0;
    font-size: 13px;
    text-transform: none;
    cursor: pointer;
}

/* ========================================
   Success/Info Messages
   ======================================== */
.sallys-opentable-widget .info-message {
    color: #f5f5f7;
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
}

.sallys-opentable-widget .success-message {
    color: #4EC769;
    padding: 20px;
    border: 1px solid #4EC769;
    background: rgba(78, 199, 105, 0.1);
    margin-top: 15px;
    text-align: center;
}

/* ========================================
   Progress Indicator
   ======================================== */
.booking-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #525252;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    transition: all 0.3s ease;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #525252;
    z-index: 0;
    transition: background 0.3s ease;
}

.progress-step.active:not(:last-child)::after,
.progress-step.completed:not(:last-child)::after {
    background: var(--cs-primary);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #525252;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Bebas Neue", sans-serif;
    font-size: 16px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background: var(--cs-primary);
    color: black;
}

.progress-step.clickable {
    cursor: pointer;
}

.progress-step.clickable:hover .step-number {
    transform: scale(1.1);
}

.step-label {
    font-size: 11px;
    color: #f5f5f7;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: var(--cs-primary);
}

/* ========================================
   Confirmation Screen
   ======================================== */
.confirmation-container {
    padding: 15px;
    margin-top: 15px;
    text-align: center;
    font-family: "Avenir LT Pro", sans-serif;
}

.confirmation-icon {
    margin-bottom: 10px;
}

.confirmation-heading {
    color: var(--cs-primary);
    margin: 0 0 5px 0;
    font-size: 2em;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 2px;
}

.confirmation-subtitle {
    color: white;
    font-size: 13px;
    margin: 0 0 15px 0;
}

.confirmation-details {
    text-align: left;
    margin-bottom: 10px;
}

.details-heading {
    margin: 0 0 10px 0;
    color: white;
    border-bottom: 1px solid var(--cs-primary);
    padding-bottom: 8px;
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.4em;
    letter-spacing: 1px;
}

.details-heading #confirmation-code-value {
    color: var(--cs-primary);
}

.detail-row {
    margin-bottom: 10px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    color: white;
    font-size: 11px;
    display: block;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 14px;
    color: #f5f5f7;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.confirmation-notice {
    border: 1px solid var(--cs-primary);
    border-radius: 0;
    padding: 10px;
    margin-bottom: 10px;
    text-align: left;
}

.confirmation-notice strong {
    color: var(--cs-primary);
    display: block;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 11px;
}

.confirmation-notice p {
    margin: 0;
    color: white;
    font-size: 12px;
}

.confirmation-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.confirmation-footer {
    padding-top: 10px;
    border-top: 1px solid #525252;
}

.confirmation-footer p {
    color: #f5f5f7;
    font-size: 12px;
    margin: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .sallys-opentable-modal__wrap {
        width: 95%;
        padding: 30px 20px;
        margin: 50px auto;
    }

    .sallys-opentable-widget h3 {
        font-size: 2em;
    }

    #opentable-booking-form {
        grid-template-columns: 1fr;
    }

    .guest-info-container .form-row {
        grid-template-columns: 1fr;
    }

    .step-label {
        font-size: 9px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .sallys-booking-trigger {
        padding: 12px 25px;
        font-size: 20px;
        width: 100%;
        text-align: center;
    }

    .time-slot > div {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .book-now-btn {
        width: 100%;
        padding: 12px 20px;
    }
}
