/**
 * Gorilla Form Tracking - Booking Widget Styles
 * Branded with #136800 - Visual Calendar Picker
 */

.gft-booking-widget {
    font-family: inherit;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gft-booking-widget * {
    box-sizing: border-box;
}

/* Personalised Message */
.gft-personalised-message {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #136800;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    font-size: 1.1em;
    line-height: 1.6;
    color: #1f2937;
}

.gft-personalised-message strong {
    color: #136800;
}

/* Calendar Container */
.gft-booking-calendar-section {
    margin-bottom: 24px;
}

.gft-booking-label {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding-top: 30px;
    text-align: left;
}

/* Calendar Grid */
.gft-calendar {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
}

.gft-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #136800;
    color: #fff;
}

.gft-calendar-nav {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 20px;
    font-weight: bold;
}

.gft-calendar-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.gft-calendar-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gft-calendar-month-year {
    font-size: 1.3em;
    font-weight: 600;
}

.gft-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.gft-calendar-weekday {
    padding: 12px 8px;
    text-align: center;
    font-size: 0.85em;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gft-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 12px;
}

.gft-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    color: #1f2937;
    min-height: 48px;
}

.gft-calendar-day:hover:not(.gft-day-disabled):not(.gft-day-empty) {
    background: #f0fdf4;
    border-color: #136800;
}

.gft-calendar-day.gft-day-empty {
    cursor: default;
}

.gft-calendar-day.gft-day-disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
}

.gft-calendar-day.gft-day-weekend {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
}

.gft-calendar-day.gft-day-today {
    border-color: #136800;
    font-weight: 700;
}

.gft-calendar-day.gft-day-selected {
    background: #136800;
    color: #fff;
    border-color: #136800;
    font-weight: 700;
}

.gft-calendar-day.gft-day-available {
    background: #f0fdf4;
}

/* Selected Date Display (collapsed state) */
.gft-selected-date-display {
    background: #fff;
    border: 2px solid #136800;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s;
}

.gft-selected-date-display:hover {
    background: #f0fdf4;
}

.gft-selected-date-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gft-selected-date-icon {
    width: 48px;
    height: 48px;
    background: #136800;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.gft-selected-date-text {
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
}

.gft-selected-date-sub {
    font-size: 0.9em;
    color: #6b7280;
    margin-top: 2px;
}

.gft-selected-date-change {
    color: #136800;
    font-weight: 500;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Time Section */
.gft-booking-time-section {
    margin-bottom: 24px;
}

.gft-booking-time-select {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.15em;
    font-family: inherit;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23136800'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 56px;
}

.gft-booking-time-select:hover {
    border-color: #136800;
}

.gft-booking-time-select:focus {
    outline: none;
    border-color: #136800;
    box-shadow: 0 0 0 4px rgba(19, 104, 0, 0.15);
}

.gft-booking-time-select:disabled {
    background-color: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

.gft-booking-help {
    margin: 12px 0 0;
    font-size: 0.95em;
    color: #6b7280;
    text-align: center;
}

/* Loading */
.gft-booking-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: #f0fdf4;
    border-radius: 12px;
    color: #136800;
    font-size: 1.05em;
}

.gft-booking-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(19, 104, 0, 0.2);
    border-top-color: #136800;
    border-radius: 50%;
    animation: gft-spin 0.8s linear infinite;
}

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

/* Error */
.gft-booking-error-message {
    padding: 16px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
    font-size: 1em;
    text-align: center;
}

/* No slots */
.gft-booking-no-slots {
    padding: 20px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    color: #92400e;
    font-size: 1em;
    text-align: center;
}

/* Confirmation */
.gft-booking-confirmation {
    text-align: center;
    padding: 40px 32px;
    background: #f0fdf4;
    border: 2px solid #136800;
    border-radius: 16px;
}

.gft-booking-confirmed-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: #136800;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
}

.gft-booking-confirmed-text {
    margin: 0;
    font-size: 1.1em;
    color: #1f2937;
    line-height: 1.7;
}

.gft-booking-error {
    padding: 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #dc2626;
    text-align: center;
}

/* Mobile */
@media (max-width: 480px) {
    .gft-calendar-header {
        padding: 16px;
    }
    
    .gft-calendar-nav {
        width: 40px;
        height: 40px;
    }
    
    .gft-calendar-month-year {
        font-size: 1.1em;
    }
    
    .gft-calendar-days {
        padding: 8px;
        gap: 2px;
    }
    
    .gft-calendar-day {
        font-size: 0.95em;
        min-height: 40px;
    }
    
    .gft-booking-time-select {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .gft-selected-date-display {
        padding: 16px;
    }
    
    .gft-selected-date-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .gft-selected-date-text {
        font-size: 1.05em;
    }
}

/* Standalone Book Button (thank-you page) */
.gft-standalone-book {
    margin-top: 20px;
}

.gft-standalone-book-btn {
    width: 100%;
    padding: 18px 32px;
    font-size: 1.15em;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: #136800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.gft-standalone-book-btn:hover {
    background: #0f5200;
}

.gft-standalone-book-btn:active {
    transform: scale(0.98);
}

.gft-standalone-book-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Dark theme overrides (when inside .gm-ty wrapper) */
.gm-ty .gft-booking-label {
    color: #fff !important;
}

.gm-ty .gft-personalised-message {
    background: linear-gradient(135deg, rgba(19,104,0,.15), rgba(19,104,0,.05));
    border-color: rgba(19,104,0,.4);
    color: #f0f0f0;
}

.gm-ty .gft-personalised-message strong {
    color: #2ca215;
}

.gm-ty .gft-booking-loading {
    background: rgba(19,104,0,.1);
    color: #2ca215;
}

.gm-ty .gft-standalone-book-btn {
    background: linear-gradient(135deg, #136800, #2ca215);
    font-size: 1.1em;
}

.gm-ty .gft-standalone-book-btn:hover {
    background: linear-gradient(135deg, #0f5200, #1e8a10);
}

.gm-ty .gft-booking-confirmed-icon { color: #F5C614; }