/* Availability Checker Frontend Styles */

.ac-booking-widget {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Google Places Autocomplete styling */
.pac-container {
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Datepicker styling */
.ac-datepicker {
    cursor: pointer;
    background: white;
}

.ac-step {
    display: none;
}

.ac-step.active {
    display: block;
}

/* Intro text and helper text */
.ac-intro-text, .ac-availability-intro, .ac-confirm-intro {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.ac-greeting {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.ac-greeting strong {
    color: #4CAF50;
}

.ac-help-text {
    display: block;
    font-size: 12px;
    color: #999;
    font-weight: normal;
    margin-top: 4px;
}

.ac-address-note {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
    margin-bottom: 0;
    padding: 10px 12px;
    background: #f9f9f9;
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
    line-height: 1.5;
}

.ac-required {
    color: #e74c3c;
}

.ac-error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fee;
    border-left: 3px solid #e74c3c;
    border-radius: 4px;
}

.ac-warning-message {
    font-size: 14px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fff8e1;
    border-left: 4px solid #f9a825;
    border-radius: 4px;
    color: #5d4037;
    line-height: 1.5;
}

.ac-btn-primary:disabled,
.ac-btn-primary[disabled] {
    background-color: #b0bec5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ac-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.ac-checkbox-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.ac-checkbox-option:hover {
    color: #4CAF50;
}

.ac-package-description {
    margin-top: 12px;
    padding: 12px;
    background: #f0f8ff;
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.ac-package-select {
    font-size: 16px;
    line-height: 1.4;
    padding: 14px 12px;
}

.ac-form-group {
    margin-bottom: 20px;
}

.ac-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.ac-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.ac-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.ac-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.ac-btn-icon {
    margin-right: 8px;
}

.ac-btn-primary {
    background-color: #4CAF50;
    color: white;
}

.ac-btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.ac-btn-large {
    font-size: 18px;
    padding: 16px 32px;
}

.ac-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    margin-right: 10px;
}

.ac-btn-secondary:hover {
    background-color: #e0e0e0;
}

.ac-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* Controls wrapper */
.ac-controls-wrapper {
    margin-bottom: 20px;
}

.ac-quick-filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.ac-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.ac-filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}

.ac-filter-item label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.ac-input-small {
    padding: 8px 12px;
    font-size: 14px;
}

.ac-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 6px;
}

#ac-period-label {
    font-weight: 600;
    font-size: 18px;
}

.ac-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.ac-view-toggle {
    display: flex;
    gap: 10px;
}

.ac-view-toggle .ac-btn.active {
    background-color: #4CAF50;
    color: white;
}

.ac-day-filter {
    display: flex;
    align-items: center;
}

.ac-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.ac-toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Loading spinner */
.ac-loading {
    text-align: center;
    padding: 40px;
}

.ac-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Target date highlighting */
.ac-target-date {
    animation: highlight-pulse 1.5s ease-out;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(76, 175, 80, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Calendar View - Desktop (Horizontal) */
@media (min-width: 768px) {
    .ac-calendar-view {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
    }
    
    .ac-day-column {
        border: 2px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
        transition: all 0.3s;
    }
    
    .ac-day-column.ac-target-date {
        border-color: #4CAF50;
        background: #f0fdf4;
    }
    
    .ac-day-header {
        font-weight: 700;
        font-size: 16px;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 2px solid #4CAF50;
        text-align: center;
    }
    
    .ac-date-display {
        font-size: 14px;
        color: #666;
    }
    
    .ac-time-slot {
        padding: 10px 8px;
        margin: 5px 0;
        background: #f0f0f0;
        border-radius: 4px;
        cursor: pointer;
        text-align: center;
        transition: all 0.2s;
    }
    
    .ac-time-slot:hover {
        background: #4CAF50;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    .ac-slot-time {
        font-weight: 500;
    }
}

/* Calendar View - Mobile (Vertical) */
@media (max-width: 767px) {
    .ac-calendar-view {
        display: block;
    }
    
    .ac-day-column {
        border: 2px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
        background: #fff;
    }
    
    .ac-day-column.ac-target-date {
        border-color: #4CAF50;
        background: #f0fdf4;
    }
    
    .ac-day-header {
        font-weight: 700;
        font-size: 18px;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 2px solid #4CAF50;
    }
    
    .ac-date-display {
        font-size: 14px;
        color: #666;
        display: block;
        margin-top: 4px;
    }
    
    .ac-time-slots-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .ac-time-slot {
        padding: 12px;
        background: #f0f0f0;
        border-radius: 4px;
        cursor: pointer;
        text-align: center;
        transition: all 0.2s;
    }
    
    .ac-time-slot:hover {
        background: #4CAF50;
        color: white;
    }
}

/* List View */
.ac-list-view {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.ac-list-day {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.ac-list-day:last-child {
    border-bottom: none;
}

.ac-list-day.ac-target-date {
    background: #f0fdf4;
    padding: 15px;
    border-radius: 8px;
    margin: -5px -5px 25px -5px;
}

.ac-list-day-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
}

.ac-list-times {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Tooltip for desktop */
@media (min-width: 769px) {
    .ac-tooltip {
        visibility: hidden;
        opacity: 0;
        position: absolute;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        background: #333;
        color: white;
        padding: 10px 15px;
        border-radius: 6px;
        font-size: 13px;
        line-height: 1.4;
        white-space: normal;
        width: 300px;
        text-align: center;
        z-index: 1000;
        transition: opacity 0.3s, visibility 0.3s;
        pointer-events: none;
    }
    
    .ac-tooltip::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: #333 transparent transparent transparent;
    }
    
    .ac-list-time-slot:hover .ac-tooltip {
        visibility: visible;
        opacity: 1;
    }
    
    .ac-list-time-slot {
        position: relative;
        padding: 10px 20px;
        background: #f0f0f0;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 500;
    }
}

@media (max-width: 768px) {
    .ac-list-time-slot {
        position: relative;
        padding: 12px 16px; /* Slightly more padding for mobile */
        background: #f0f0f0;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: 500;
        font-size: 15px; /* Slightly larger for readability */
    }
}

.ac-list-time-slot:hover {
    background: #4CAF50;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Mobile info message */
.ac-mobile-info {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 12px;
    border-left: 3px solid #4CAF50;
}

.ac-no-availability, .ac-no-slots {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 16px;
}

/* Period sections (Morning / Afternoon / Early Evening / Night) */
.ac-period-section {
    margin-bottom: 16px;
}

.ac-period-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* Weekend separator */
.ac-weekend-separator {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    padding: 0 10px;
}

.ac-separator-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
}

.ac-separator-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.ac-weekdays-hidden {
    color: #999;
}

.ac-show-weekdays-link {
    background: none;
    border: none;
    color: #4CAF50;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    font-weight: 600;
}

.ac-show-weekdays-link:hover {
    color: #45a049;
    text-decoration: none;
}

.ac-no-slots {
    padding: 20px;
    font-size: 14px;
}

/* Booking Summary */
.ac-booking-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
}

.ac-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.ac-summary-row:last-of-type {
    border-bottom: none;
}

.ac-summary-label {
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

.ac-summary-value {
    color: #212529;
    font-size: 15px;
    text-align: right;
}

.ac-summary-note {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: center;
    color: #28a745;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .ac-booking-widget {
        padding: 15px;
    }
    
    .ac-package-select {
        font-size: 15px;
        padding: 16px 12px;
        line-height: 1.6;
        min-height: 50px;
    }
    
    /* Make select options more readable on mobile */
    .ac-package-select option {
        padding: 12px;
        line-height: 1.6;
    }
    
    .ac-quick-filters {
        padding: 12px;
    }
    
    .ac-filter-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .ac-filter-item {
        width: 100%;
        min-width: unset;
    }
    
    .ac-controls-wrapper {
        margin-bottom: 15px;
    }
    
    .ac-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .ac-navigation button {
        width: 100%;
    }
    
    #ac-period-label {
        order: -1;
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    .ac-view-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ac-view-toggle {
        justify-content: center;
    }
    
    .ac-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .ac-btn-secondary {
        margin-right: 0;
    }
    
    .ac-summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .ac-summary-value {
        text-align: left;
    }
}


.ac-form-group {
    margin-bottom: 20px;
}

.ac-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.ac-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.ac-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.ac-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.ac-btn-primary {
    background-color: #4CAF50;
    color: white;
}

.ac-btn-primary:hover {
    background-color: #45a049;
}

.ac-btn-secondary {
    background-color: #f0f0f0;
    color: #333;
    margin-right: 10px;
}

.ac-btn-secondary:hover {
    background-color: #e0e0e0;
}

.ac-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.ac-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 6px;
}

#ac-period-label {
    font-weight: 600;
    font-size: 18px;
}

.ac-view-toggle {
    text-align: center;
    margin: 20px 0;
}

.ac-view-toggle .ac-btn {
    margin: 0 5px;
}

.ac-view-toggle .ac-btn.active {
    background-color: #4CAF50;
    color: white;
}

.ac-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #666;
}

/* Calendar View - Desktop (Horizontal) */
@media (min-width: 768px) {
    .ac-calendar-view {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .ac-day-column {
        border: 2px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
    }
    
    .ac-day-header {
        font-weight: 700;
        font-size: 16px;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 2px solid #4CAF50;
        text-align: center;
    }
    
    .ac-time-slot {
        padding: 8px;
        margin: 5px 0;
        background: #f0f0f0;
        border-radius: 4px;
        cursor: pointer;
        text-align: center;
        transition: all 0.2s;
    }
    
    .ac-time-slot:hover {
        background: #4CAF50;
        color: white;
        transform: translateY(-2px);
    }
}

/* Calendar View - Mobile (Vertical) */
@media (max-width: 767px) {
    .ac-calendar-view {
        display: block;
    }
    
    .ac-day-column {
        border: 2px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
        background: #fff;
    }
    
    .ac-day-header {
        font-weight: 700;
        font-size: 18px;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 2px solid #4CAF50;
    }
    
    .ac-time-slots-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .ac-time-slot {
        padding: 12px;
        background: #f0f0f0;
        border-radius: 4px;
        cursor: pointer;
        text-align: center;
        transition: all 0.2s;
    }
    
    .ac-time-slot:hover {
        background: #4CAF50;
        color: white;
    }
}

/* List View */
.ac-list-view {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.ac-list-day {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.ac-list-day:last-child {
    border-bottom: none;
}

.ac-list-day-header {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: #333;
}

.ac-list-times {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ac-list-time-slot {
    padding: 10px 20px;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.ac-list-time-slot:hover {
    background: #4CAF50;
    color: white;
}

.ac-no-availability {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.ac-booking-summary {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ac-booking-summary p {
    margin: 10px 0;
    font-size: 16px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .ac-booking-widget {
        padding: 15px;
    }
    
    .ac-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .ac-navigation button {
        width: 100%;
    }
    
    #ac-period-label {
        order: -1;
        margin-bottom: 10px;
    }
    
    .ac-btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .ac-btn-secondary {
        margin-right: 0;
    }
}

/* Venue Fallback: auto-shown map confirmation + alternative options */
.ac-venue-fallback {
    margin-top: 16px;
    padding: 16px;
    background: #f0f8f0;
    border: 1px solid #c8e6c9;
    border-left: 4px solid #4CAF50;
    border-radius: 6px;
}

.ac-fallback-title {
    font-weight: 700;
    color: #1b5e20;
    font-size: 15px;
    margin: 0 0 4px 0;
}

.ac-fallback-subtitle {
    font-size: 13px;
    color: #555;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.ac-geocoded-address {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    min-height: 36px;
}

#ac-map-preview {
    height: 220px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #c8e6c9;
    margin-bottom: 8px;
}

.ac-pin-hint {
    font-size: 12px;
    color: #777;
    font-style: italic;
    margin-bottom: 12px;
    min-height: 16px;
}

.ac-map-confirm-buttons {
    display: flex;
    gap: 10px;
}

.ac-map-confirm-buttons .ac-btn {
    margin-right: 0;
}

.ac-alt-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #999;
    font-size: 13px;
    margin: 14px 0;
}

.ac-alt-divider::before,
.ac-alt-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #c8e6c9;
}

.ac-maps-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ac-maps-link-row .ac-input {
    flex: 1;
    font-size: 14px;
    padding: 8px 10px;
    width: auto;
}

.ac-maps-link-row .ac-btn {
    flex-shrink: 0;
    width: auto;
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .ac-map-confirm-buttons {
        flex-direction: column;
    }
    .ac-map-confirm-buttons .ac-btn {
        width: 100%;
    }
    .ac-maps-link-row {
        flex-direction: column;
        align-items: stretch;
    }
    .ac-maps-link-row .ac-input,
    .ac-maps-link-row .ac-btn {
        width: 100%;
    }
}
