/**
 * CompliChef Reservations - Public Booking Widget Styles
 * Clean, modern, mobile-responsive design
 */

:root {
    /* Theme colors - will be overridden by inline styles */
    --theme-primary: #2563eb;
    --theme-primary-dark: #1e40af;
    --theme-primary-darker: #1e3a8a;

    /* Use theme colors as primary */
    --primary: var(--theme-primary);
    --primary-dark: var(--theme-primary-dark);
    --primary-darker: var(--theme-primary-darker);

    /* Other colors */
    --success: #10b981;
    --danger: #ef4444;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 0.5rem;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

.booking-widget {
    max-width: 600px;
    margin: 2rem auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.booking-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.booking-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.venue-address {
    font-size: 0.95rem;
    opacity: 0.9;
}

.booking-form {
    padding: 2rem;
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.form-step h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-step h2 i {
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.required {
    color: var(--danger);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.time-slot {
    padding: 0.75rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.time-slot:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

.time-slot.selected {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.time-slot.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--gray-600);
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Party Size */
.party-size-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.party-size-input label {
    text-align: center;
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.875rem;
}

.number-input {
    display: flex;
    align-items: center;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.number-input button {
    flex: 1;
    padding: 0.75rem;
    background: var(--gray-100);
    border: none;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
}

.number-input button:hover {
    background: var(--gray-200);
}

.number-input input {
    flex: 1;
    text-align: center;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    padding: 0.5rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn-block {
    width: 100%;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions button {
    flex: 1;
}

/* Booking Summary */
.booking-summary {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.summary-item {
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item i {
    color: var(--primary);
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.summary-item div {
    flex: 1;
}

.summary-item strong {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.summary-item span {
    color: var(--gray-800);
    font-size: 1rem;
}

/* Terms */
.terms {
    margin: 1.5rem 0;
}

.checkbox-label {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 3rem 2rem;
}

.success-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 1rem;
}

.success-message h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.success-message p {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.success-message strong {
    color: var(--gray-800);
}

.small-text {
    font-size: 0.875rem !important;
}

.success-message .btn-primary {
    margin-top: 1.5rem;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-message i {
    font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 640px) {
    .booking-widget {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .booking-header {
        padding: 1.5rem;
    }
    
    .booking-header h1 {
        font-size: 1.5rem;
    }
    
    .booking-form {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .party-size-grid {
        grid-template-columns: 1fr;
    }
    
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
}

/* iframe adjustments */
body.iframe-mode {
    background: transparent;
}

body.iframe-mode .booking-widget {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}
