/* CRP Booking Form V2 Styles - Clean Single Page Layout */

/* Datepicker Styles for Blocked Dates - Same as V1 */
.ui-datepicker-calendar .crp-blocked-date a {
    background-color: #ffcccc !important; /* Light red background */
    color: #880000 !important; /* Darker red text */
    text-decoration: line-through !important;
}

.ui-datepicker-calendar .ui-state-disabled.crp-blocked-date .ui-state-default {
    background-color: #ffcccc !important;
    color: #880000 !important;
}

/* V2 Specific Datepicker Styles */
.ui-datepicker-calendar .blocked a {
    background-color: #ffcccc !important; /* Light red background */
    color: #880000 !important; /* Darker red text */
    text-decoration: line-through !important;
}

.ui-datepicker-calendar .holiday a {
    background-color: #ffcccc !important; /* Light red background */
    color: #880000 !important; /* Darker red text */
    text-decoration: line-through !important;
}

.ui-datepicker-calendar .ui-state-disabled.blocked .ui-state-default,
.ui-datepicker-calendar .ui-state-disabled.holiday .ui-state-default {
    background-color: #ffcccc !important;
    color: #880000 !important;
}

/* Overall Container */
.crp-booking-v2-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Override any theme constraints */
#crp-booking-v2 {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Header */
.crp-booking-v2-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.crp-booking-v2-header h3 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

.crp-booking-v2-header p {
    font-size: 16px;
    color: #7f8c8d;
    margin: 0;
}

/* Form Layout */
.crp-booking-v2-form {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Section Headers */
.crp-personal-info-section h4,
.crp-date-selection-section h4 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

/* Form Rows and Groups */
.crp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Field validation states */
.crp-form-group input.crp-field-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25) !important;
}

.crp-form-group input.crp-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25) !important;
}

.crp-field-error-message {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 500;
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced select styling for guests dropdown */
.crp-form-group select#crp-v2-guests {
    cursor: pointer;
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2C197.3L159.1%2C69.4c-3.1-3.1-8.2-3.1-11.3,0L5.4%2C197.3c-3.1,3.1-3.1,8.2,0,11.3l11.3,11.3c3.1,3.1,8.2,3.1,11.3,0l11.3-11.3C290.1,205.5,290.1,200.4,287,197.3z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 35px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.crp-form-group select#crp-v2-guests:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.crp-form-group select#crp-v2-guests option {
    padding: 8px 12px;
    background: #fff;
    color: #333;
}

.crp-form-group select#crp-v2-guests option:hover {
    background: #f8f9fa;
}

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

.crp-form-group label {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
}

.crp-form-group input,
.crp-form-group textarea,
.crp-form-group select {
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.crp-form-group input:focus,
.crp-form-group textarea:focus,
.crp-form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.crp-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Validation Styles - STEP 1 ADDED */
.crp-field-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1) !important;
}

.crp-field-success {
    border-color: #27ae60 !important;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1) !important;
}

.crp-error-message {
    color: #e74c3c;
    font-size: 0.85em;
    margin-top: 5px;
    display: block;
    font-weight: 500;
}

/* Date Selection Section */
.crp-date-selection-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

/* Availability Section */
.crp-availability-section {
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    overflow: visible;
    width: 100%;
}

/* Availability Summary */
.crp-availability-summary {
    background: #ecf0f1;
    padding: 15px 20px;
    border-bottom: 1px solid #d5dbdb;
}

.crp-availability-summary p {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

/* Availability Table */
.crp-availability-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.crp-availability-table {
    width: 100%;
    table-layout: auto;
    border-collapse: collapse;
    background: #fff;
}

/* Table styles are now defined above */
.crp-availability-table th {
    background: #34495e;
    color: #fff;
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border-right: 1px solid #2c3e50;
}

.crp-availability-table th:first-child {
    text-align: left;
    min-width: 120px;
}

.crp-availability-table td {
    padding: 12px;
    border: 1px solid #ecf0f1;
    text-align: center;
    vertical-align: middle;
}

.crp-availability-table .crp-zone-name {
    background: #ecf0f1;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    min-width: 100px;
    width: auto;
}

/* Time Slots */
.crp-time-slot {
    position: relative;
    min-height: 60px;
    display: table-cell;
    text-align: center;
    vertical-align: middle;
    min-width: 120px;
    width: auto;
}

/* Slot Options */
.crp-slot-option {
    display: inline-block;
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 100%;
}

.crp-slot-option:hover {
    background: rgba(52, 152, 219, 0.1);
}

.crp-slot-option input[type="radio"] {
    display: none;
}

.crp-slot-option input[type="radio"]:checked + .crp-slot-text {
    background: #3498db;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
}

.crp-slot-text {
    font-size: 14px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Status Colors */
.crp-status-full .crp-slot-text {
    background: #e74c3c;
    color: #fff;
}

.crp-status-limited .crp-slot-text {
    background: #f39c12;
    color: #fff;
}

.crp-status-available .crp-slot-text {
    background: #27ae60;
    color: #fff;
}

.crp-status-closed .crp-slot-text {
    background: #95a5a6;
    color: #fff;
}

/* Submit Section */
.crp-submit-section {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #ecf0f1;
}

.crp-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.crp-btn-primary {
    background: #3498db;
    color: #fff;
}

.crp-btn-primary:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.crp-btn-primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Privacy Consent Styles for V2 */
.crp-privacy-consent-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.crp-privacy-consent {
    margin: 0;
}

.crp-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    margin: 0;
}

.crp-checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 3px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.crp-checkbox-text {
    flex: 1;
}

.crp-checkbox-text a,
.crp-checkbox-text .crp-privacy-link {
    color: #3498db;
    text-decoration: underline;
    font-weight: 500;
}

.crp-checkbox-text a:hover,
.crp-checkbox-text .crp-privacy-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

.crp-btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.crp-btn-secondary:hover {
    background: #7f8c8d;
}

/* Messages */
.crp-messages {
    margin-top: 20px;
}

.crp-message {
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 10px;
}

.crp-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.crp-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading and No Data States */
.crp-loading,
.crp-no-date-selected,
.crp-no-slots {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 16px;
}

.crp-loading {
    color: #3498db;
    font-weight: 600;
}

/* Popup Styles - STEP 2 ADDED */
.crp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(5px);
}

.crp-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 550px;
    width: 90%;
    z-index: 10000;
    text-align: center;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.crp-popup h3 {
    margin-top: 0;
    color: #27ae60;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.crp-popup p {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 20px;
}

.crp-popup .crp-popup-buttons {
    margin-top: 30px;
}

.crp-popup .crp-btn {
    margin: 0 10px;
    padding: 12px 25px;
    font-size: 1em;
}

/* Loading Spinner - STEP 3 ADDED */
.crp-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .crp-booking-v2-container {
        padding: 15px;
        margin: 10px;
        width: 100%;
        max-width: 100%;
    }
    
    .crp-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .crp-availability-table-wrapper {
        font-size: 12px;
        overflow-x: auto;
    }
    
    .crp-availability-table {
        min-width: 600px; /* Ensure minimum width on mobile */
    }
    
    .crp-availability-table th,
    .crp-availability-table td {
        padding: 6px 4px;
    }
    
    .crp-availability-table .crp-zone-name {
        min-width: 60px;
    }
    
    .crp-time-slot {
        min-width: 80px;
    }
    
    .crp-slot-text {
        font-size: 11px;
        padding: 3px 4px;
    }
    
    .crp-popup {
        padding: 25px;
        width: 95%;
    }
    
    .crp-popup h3 {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .crp-booking-v2-header h3 {
        font-size: 24px;
    }
    
    .crp-availability-table {
        font-size: 11px;
    }
    
    .crp-availability-table th,
    .crp-availability-table td {
        padding: 6px 4px;
    }
    
    .crp-slot-text {
        font-size: 11px;
        padding: 3px 4px;
    }
} 