/* Private Chef Booking - Frontend Styles */

/* 
 * Mobile Optimization Note:
 * Ensure your theme has this meta tag for proper mobile display:
 * <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
 */

/* Universal box-sizing fix */
.pcb-frontend-calendar-wrapper *,
.pcb-frontend-calendar-wrapper *::before,
.pcb-frontend-calendar-wrapper *::after {
    box-sizing: border-box;
}

/* iOS Safari specific fixes */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 480px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

.pcb-frontend-calendar-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
}

/* Date Range Selector */
.pcb-date-range-section {
    margin-bottom: 25px;
    text-align: center;
}

#pcb-toggle-date-range {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#pcb-toggle-date-range:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.pcb-date-range-form {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 25px;
    margin-top: 15px;
    text-align: left;
}

.pcb-date-range-form h3 {
    margin-top: 0;
    color: #333;
    font-size: 20px;
}

.pcb-date-range-form p {
    color: #666;
    margin-bottom: 20px;
}

.pcb-range-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.pcb-range-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.pcb-range-field input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
}

.pcb-range-slots {
    margin-bottom: 20px;
}

.pcb-range-slots > label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.pcb-slot-checkboxes {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.pcb-slot-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
}

.pcb-slot-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#pcb-apply-date-range {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

#pcb-apply-date-range:hover {
    background: #0056b3;
}

.pcb-date-range-form .description {
    margin-top: 12px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Success Page */
.pcb-success-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease-out;
}

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

.pcb-success-icon {
    width: 80px;
    height: 80px;
    background: white;
    color: #28a745;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    margin: 0 auto 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: scaleIn 0.6s ease-out 0.2s both;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.pcb-success-title {
    font-size: 36px;
    font-weight: bold;
    margin: 0 0 20px 0;
    color: white;
}

.pcb-success-message-large {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.95);
}

.pcb-success-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.85);
}

.pcb-button-large {
    padding: 15px 40px !important;
    font-size: 18px !important;
    background: white !important;
    color: #667eea !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.pcb-button-large:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
    background: #f8f9fa !important;
}

.pcb-calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pcb-current-month-display {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.pcb-nav-button {
    background: #007bff;
    color: white !important;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
    display: inline-block;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.pcb-nav-button:hover,
.pcb-nav-button:active {
    background: #0056b3;
    text-decoration: none;
    transform: scale(0.98);
}

.pcb-nav-button:focus {
    outline: 2px solid #0056b3;
    outline-offset: 2px;
}

.pcb-booking-selection {
    background: #f8f9fa;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.pcb-booking-selection h3 {
    margin-top: 0;
    color: #333;
}

#pcb-selected-items {
    margin: 15px 0;
}

.pcb-selected-item {
    background: white;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pcb-selected-item-info {
    flex: 1;
}

.pcb-selected-item-date {
    font-weight: bold;
    color: #333;
}

.pcb-selected-item-slot {
    color: #666;
    font-size: 14px;
}

.pcb-selected-item-price {
    color: #007bff;
    font-weight: bold;
    margin-right: 15px;
}

.pcb-remove-selection {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.pcb-remove-selection:hover {
    background: #c82333;
}

.pcb-calendar-month {
    margin-bottom: 40px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.pcb-month-name {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 24px;
}

.pcb-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 100%;
}

.pcb-calendar-header {
    text-align: center;
    font-weight: bold;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
}

.pcb-calendar-cell {
    min-height: 100px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    background: white;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    overflow: hidden;
}

.pcb-calendar-cell.pcb-cell-clickable {
    cursor: pointer;
}

.pcb-calendar-cell.pcb-cell-clickable:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
    transform: translateY(-2px);
}

.pcb-calendar-cell.pcb-cell-clickable:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 123, 255, 0.3);
}

.pcb-calendar-cell:active:not(.empty):not(.past):not(.unavailable) {
    transform: scale(0.98);
}

.pcb-calendar-cell.empty {
    background: #f8f9fa;
    border-color: transparent;
}

.pcb-calendar-cell.past {
    background: #f8f9fa;
    opacity: 0.5;
}

.pcb-calendar-cell.available {
    border-color: #28a745;
    background: #f0fff4;
}

.pcb-calendar-cell.partially-available {
    border-color: #ffc107;
    background: #fffef0;
}

.pcb-calendar-cell.unavailable {
    border-color: #dc3545;
    background: #fff5f5;
}

.pcb-day-number {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.pcb-price {
    font-size: 14px;
    color: #007bff;
    font-weight: 600;
    margin-bottom: 8px;
}

.pcb-tap-hint {
    font-size: 11px;
    color: #007bff;
    text-align: center;
    padding: 4px;
    margin-top: auto;
    font-weight: 600;
    opacity: 0.8;
}

.pcb-unavailable-label {
    font-size: 12px;
    color: #dc3545;
    text-align: center;
    padding: 5px;
}

.pcb-button-primary {
    background: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 12px 24px !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    transition: background 0.3s, transform 0.2s !important;
    min-height: 44px !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
}

.pcb-button-primary:hover,
.pcb-button-primary:active {
    background: #0056b3 !important;
    transform: scale(0.98) !important;
}

.pcb-button-primary:focus {
    outline: 2px solid #0056b3 !important;
    outline-offset: 2px !important;
}

.pcb-enquiry-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 30px;
    margin-top: 30px;
}

.pcb-enquiry-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
}

.pcb-selected-dates-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #007bff;
}

.pcb-selected-dates-display h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

#pcb-dates-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pcb-date-summary-item {
    background: white;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
    border: 1px solid #e9ecef;
}

.pcb-date-summary-item strong {
    color: #007bff;
    margin-right: 8px;
}

.pcb-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.pcb-form-field {
    margin-bottom: 20px;
}

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

.pcb-form-field .required {
    color: #dc3545;
}

.pcb-form-field input[type="text"],
.pcb-form-field input[type="email"],
.pcb-form-field input[type="tel"],
.pcb-form-field select,
.pcb-form-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.pcb-form-field select {
    background-color: white;
    cursor: pointer;
}

.pcb-form-field textarea {
    resize: vertical;
}

.pcb-checkbox-field {
    margin: 25px 0;
}

.pcb-checkbox-field label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.pcb-checkbox-field input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.pcb-checkbox-field span {
    flex: 1;
    line-height: 1.5;
}

.pcb-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

#pcb-form-messages {
    margin-top: 20px;
}

.pcb-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

.pcb-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
}

/* Slot Selection Modal */
.pcb-slot-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.pcb-slot-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.pcb-slot-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.pcb-slot-modal-close:hover {
    color: #000;
}

.pcb-slot-option {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.pcb-slot-option:hover,
.pcb-slot-option:active {
    border-color: #007bff;
    background: #f0f8ff;
    transform: scale(0.98);
}

.pcb-slot-option.selected {
    border-color: #007bff;
    background: #e7f3ff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.pcb-slot-option.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
}

.pcb-slot-option.unavailable:hover,
.pcb-slot-option.unavailable:active {
    transform: none;
    border-color: #dee2e6;
    background: #f8f9fa;
}

.pcb-slot-name {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.pcb-slot-price {
    color: #007bff;
    font-weight: 600;
}

.pcb-slot-status {
    font-size: 12px;
    color: #dc3545;
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .pcb-frontend-calendar-wrapper {
        padding: 12px;
        max-width: 100%;
        width: 100%;
    }
    
    .pcb-success-page {
        padding: 40px 20px;
    }
    
    .pcb-success-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
        margin-bottom: 20px;
    }
    
    .pcb-success-title {
        font-size: 28px;
    }
    
    .pcb-success-message-large {
        font-size: 16px;
    }
    
    .pcb-button-large {
        padding: 12px 30px !important;
        font-size: 16px !important;
    }
    
    .pcb-calendar-navigation {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .pcb-current-month-display {
        order: -1;
        font-size: 18px;
    }
    
    .pcb-nav-button {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
    
    .pcb-calendar-month {
        width: 100%;
    }
    
    .pcb-calendar-grid {
        gap: 3px;
        width: 100%;
    }
    
    .pcb-calendar-header {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    .pcb-calendar-cell {
        min-height: 80px;
        padding: 5px 3px;
    }
    
    .pcb-day-number {
        font-size: 15px;
        margin-bottom: 3px;
    }
    
    .pcb-price {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .pcb-tap-hint {
        font-size: 10px;
        padding: 3px;
    }
    
    .pcb-unavailable-label {
        font-size: 10px;
        padding: 4px;
    }
    
    .pcb-form-row {
        grid-template-columns: 1fr;
    }
    
    .pcb-form-field input,
    .pcb-form-field textarea {
        font-size: 16px;
        padding: 12px;
        width: 100%;
    }
    
    .pcb-slot-modal-content {
        width: 95%;
        margin: 15% auto;
        padding: 20px;
    }
    
    .pcb-slot-option {
        padding: 18px;
        margin-bottom: 12px;
    }
    
    .pcb-slot-name {
        font-size: 17px;
    }
    
    .pcb-slot-price {
        font-size: 16px;
    }
    
    /* Date Range Mobile */
    .pcb-date-range-form {
        padding: 20px 15px;
    }
    
    .pcb-range-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pcb-slot-checkboxes {
        flex-direction: column;
        gap: 12px;
    }
}

/* iPhone and Small Mobile (Portrait) */
@media (max-width: 480px) {
    .pcb-frontend-calendar-wrapper {
        padding: 8px;
        max-width: 100%;
        width: 100%;
    }
    
    .pcb-success-page {
        padding: 30px 15px;
        border-radius: 12px;
    }
    
    .pcb-success-icon {
        width: 50px;
        height: 50px;
        font-size: 30px;
    }
    
    .pcb-success-title {
        font-size: 24px;
    }
    
    .pcb-success-message-large {
        font-size: 15px;
    }
    
    .pcb-success-subtitle {
        font-size: 14px;
    }
    
    .pcb-calendar-navigation {
        padding: 10px;
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .pcb-current-month-display {
        font-size: 16px;
        font-weight: 700;
    }
    
    .pcb-nav-button {
        padding: 12px 16px;
        font-size: 14px;
        border-radius: 8px;
    }
    
    .pcb-calendar-month {
        margin-bottom: 20px;
        width: 100%;
    }
    
    .pcb-month-name {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .pcb-calendar-grid {
        gap: 1px;
        width: 100%;
        margin-bottom: 0;
    }
    
    .pcb-calendar-header {
        font-size: 9px;
        padding: 4px 1px;
        font-weight: 700;
        border-radius: 2px;
    }
    
    .pcb-calendar-cell {
        min-height: 65px;
        padding: 2px 1px;
        border-radius: 3px;
        border-width: 1px;
    }
    
    .pcb-calendar-cell.pcb-cell-clickable:active {
        transform: scale(0.96);
        border-color: #007bff;
    }
    
    .pcb-day-number {
        font-size: 13px;
        margin-bottom: 2px;
        font-weight: 700;
    }
    
    .pcb-price {
        font-size: 9px;
        margin-bottom: 2px;
        font-weight: 600;
        line-height: 1.2;
    }
    
    .pcb-tap-hint {
        font-size: 8px;
        padding: 2px 1px;
        line-height: 1;
        font-weight: 700;
    }
    
    .pcb-unavailable-label {
        font-size: 8px;
        padding: 2px;
        line-height: 1.2;
    }
    
    /* Booking Selection */
    .pcb-booking-selection {
        padding: 12px;
        margin-bottom: 15px;
        border-radius: 6px;
    }
    
    .pcb-booking-selection h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .pcb-selected-item {
        padding: 12px;
        margin-bottom: 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .pcb-selected-item-date {
        font-size: 15px;
    }
    
    .pcb-selected-item-slot {
        font-size: 13px;
    }
    
    .pcb-selected-item-price {
        font-size: 16px;
        margin-right: 0;
        margin-top: 4px;
    }
    
    .pcb-remove-selection {
        padding: 6px 12px;
        font-size: 12px;
        width: 100%;
        margin-top: 8px;
    }
    
    #pcb-proceed-to-form {
        width: 100%;
        padding: 14px 20px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
    }
    
    /* Form Styles */
    .pcb-enquiry-form {
        padding: 15px 10px;
        border-radius: 6px;
    }
    
    .pcb-enquiry-form h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .pcb-form-field {
        margin-bottom: 14px;
    }
    
    .pcb-form-field label {
        font-size: 14px;
        margin-bottom: 6px;
        font-weight: 600;
    }
    
    .pcb-form-field input[type="text"],
    .pcb-form-field input[type="email"],
    .pcb-form-field input[type="tel"],
    .pcb-form-field textarea {
        font-size: 16px;
        padding: 12px 10px;
        border-radius: 6px;
        -webkit-appearance: none;
        width: 100%;
    }
    
    .pcb-form-field textarea {
        min-height: 100px;
    }
    
    .pcb-form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }
    
    .pcb-form-actions .button {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
        border-radius: 8px;
        text-align: center;
    }
    
    /* Slot Modal */
    .pcb-slot-modal-content {
        width: 95%;
        max-width: none;
        margin: 10% auto;
        padding: 20px 15px;
        border-radius: 8px;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .pcb-slot-modal-content h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .pcb-slot-option {
        padding: 16px;
        margin-bottom: 10px;
        border-radius: 6px;
        border-width: 2px;
    }
    
    .pcb-slot-name {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .pcb-slot-price {
        font-size: 15px;
        font-weight: 700;
    }
    
    .pcb-slot-status {
        font-size: 12px;
        margin-top: 4px;
    }
    
    #pcb-confirm-slots {
        width: 100%;
        padding: 14px 20px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        margin-top: 10px;
    }
    
    .pcb-slot-modal-close {
        font-size: 32px;
        line-height: 1;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
