/* ===============================================
   TAKTIMIZE BOOKING MODAL STYLES
   Add this to your main CSS or include as separate file
   =============================================== */

/* Modal Overlay */
.booking-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.booking-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.booking-modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.booking-modal-overlay.active .booking-modal {
    transform: scale(1);
}

/* Modal Header */
.booking-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.booking-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.booking-modal-close:hover {
    background: rgba(81, 45, 168, 0.1);
    color: var(--primary);
}

.booking-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.booking-modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Dark-mode contrast tuning */
html.dark .booking-modal {
    background: #1e293b;
    border: 1px solid #475569;
}

html.dark .booking-modal-header {
    background: linear-gradient(180deg, rgba(81, 45, 168, 0.25), rgba(81, 45, 168, 0.08));
    border-bottom-color: #475569;
}

html.dark .booking-modal-title {
    color: #f8fafc;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}

html.dark .booking-modal-subtitle {
    color: #cbd5e1;
}

html.dark .booking-modal-close {
    color: #94a3b8;
}

html.dark .booking-modal-close:hover {
    background: rgba(81, 45, 168, 0.2);
    color: #a78bfa;
}

/* Progress steps */
html.dark .progress-circle {
    background: #0f172a;
    border-color: #475569;
    color: #94a3b8;
}

html.dark .progress-step::before {
    background: #475569;
}

html.dark .progress-label {
    color: #94a3b8;
}

html.dark .progress-step.active .progress-label {
    color: #a78bfa;
}

html.dark .progress-step.active .progress-circle {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #ffffff;
}

/* Form elements */
html.dark .form-label {
    color: #e2e8f0;
}

html.dark .form-input,
html.dark .form-select,
html.dark .form-textarea {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
    color-scheme: dark;
}

html.dark .form-input::placeholder,
html.dark .form-textarea::placeholder {
    color: #64748b;
}

html.dark .form-input:focus,
html.dark .form-select:focus,
html.dark .form-textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

html.dark .form-hint {
    color: #64748b;
}

/* Checkbox items */
html.dark .checkbox-item {
    border-color: #475569;
    background: #0f172a;
    color: #e2e8f0;
}

html.dark .checkbox-item:hover,
html.dark .checkbox-item.checked {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.15);
}

/* Footer */
html.dark .booking-modal-footer {
    border-top-color: #475569;
}

html.dark .btn-back {
    border-color: #475569;
    color: #94a3b8;
}

html.dark .btn-back:hover {
    border-color: #7c3aed;
    color: #a78bfa;
}

/* Success details */
html.dark .success-details {
    background: rgba(124, 58, 237, 0.08);
    border-color: #475569;
}

html.dark .success-detail-row {
    border-bottom-color: #475569;
}

html.dark .success-detail-label {
    color: #94a3b8;
}

html.dark .success-detail-value {
    color: #f1f5f9;
}

/* Time slots */
html.dark .time-slot {
    background: #0f172a;
    border-color: #475569;
    color: #e2e8f0;
}

html.dark .time-slot:hover,
html.dark .time-slot.selected {
    border-color: #7c3aed;
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

/* Progress Indicator */
.booking-progress {
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
    margin-top: 20px;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.progress-step:last-child::before {
    display: none;
}

.progress-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.progress-step.active .progress-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.progress-step.completed .progress-circle {
    background: #10B981;
    border-color: #10B981;
    color: white;
}

.progress-step.completed .progress-circle::before {
    content: '✓';
    font-size: 16px;
}

.progress-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-step.active .progress-label {
    color: var(--primary);
    font-weight: 600;
}

/* Modal Body */
.booking-modal-body {
    padding: 32px 24px;
}

/* Form Steps */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label .required {
    color: #EF4444;
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(81, 45, 168, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-error {
    font-size: 13px;
    color: #EF4444;
    margin-top: 4px;
    display: none;
}

.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
    border-color: #EF4444;
}

.form-group.error .form-error {
    display: block;
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: rgba(81, 45, 168, 0.05);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-item.checked {
    border-color: var(--primary);
    background: rgba(81, 45, 168, 0.1);
}

/* Date & Time Picker */
.datetime-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Success Screen */
.success-content {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 24px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.success-details {
    background: rgba(81, 45, 168, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 24px 0;
    text-align: left;
}

.success-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.success-detail-row:last-child {
    border-bottom: none;
}

.success-detail-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.success-detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Modal Footer */
.booking-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.btn-modal {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-back {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-back:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-next,
.btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    flex: 1;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(81, 45, 168, 0.3);
}

.btn-next:disabled,
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 640px) {
    .booking-modal {
        width: 95%;
        max-height: 95vh;
    }

    .booking-modal-body {
        padding: 24px 16px;
    }

    .datetime-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .booking-modal-footer {
        flex-direction: column-reverse;
    }

    .btn-modal {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .booking-modal {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .booking-modal-overlay.active {
        align-items: stretch;
    }

    .booking-modal-header {
        padding: 16px 16px 12px;
    }

    .booking-modal-title {
        font-size: 20px;
        padding-right: 32px;
    }

    .booking-modal-subtitle {
        font-size: 13px;
    }

    .booking-modal-close {
        top: 14px;
        right: 14px;
    }

    .booking-progress {
        padding: 0 16px;
        margin-top: 16px;
    }

    .progress-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .progress-label {
        font-size: 11px;
    }

    .booking-modal-body {
        padding: 20px 16px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 14px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .checkbox-item {
        padding: 10px;
    }

    .booking-modal-footer {
        padding: 16px;
    }

    .btn-modal {
        padding: 14px 20px;
        font-size: 16px;
    }

    .success-icon {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }

    .success-title {
        font-size: 22px;
    }

    .success-message {
        font-size: 14px;
    }

    .success-details {
        padding: 16px;
    }

    .success-detail-row {
        flex-direction: column;
        gap: 4px;
        padding: 10px 0;
    }
}