/**
 * IVANOV.LAW Booking System - Frontend Styles
 * Premium Law Firm Design
 */

/* Modal Overlay & Container */
.ivanov-law-booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.booking-modal-container {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.booking-modal-header {
    padding: 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #fff;
    border-radius: 8px 8px 0 0;
}

.booking-modal-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.booking-modal-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.booking-modal-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.booking-modal-language-switcher {
    margin-left: auto;
    margin-right: 20px;
}

#booking-language-select {
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

#booking-language-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.booking-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.booking-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.booking-modal-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.booking-step {
    display: none;
}

.booking-step.active {
    display: block;
    animation: stepFadeIn 0.3s ease-in;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.booking-step h3 {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

/* Calendar */
.booking-calendar-container {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-month-year {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.calendar-nav-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav-btn:hover {
    background: #333;
    transform: scale(1.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.calendar-weekday {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    border: 2px solid transparent;
}

.calendar-day:not(.empty):not(.past):not(.disabled):hover {
    background: #f0f0f0;
    transform: scale(1.1);
}

.calendar-day.selected {
    background: #1a1a1a;
    color: #fff;
    font-weight: 600;
}

.calendar-day.past {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Days without availability should look the same as past/disabled days */
.calendar-day.disabled.no-availability {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.empty {
    cursor: default;
}

/* Availability Indicator */
.calendar-day.has-availability {
    position: relative;
    font-weight: 600;
}

.availability-indicator {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background-color: #4caf50;
    border-radius: 50%;
    display: block;
}

.calendar-day.selected .availability-indicator {
    background-color: #fff;
}

.calendar-day.past .availability-indicator,
.calendar-day.disabled .availability-indicator {
    display: none;
}

.booking-selected-date {
    text-align: center;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 6px;
    color: #2e7d32;
    font-size: 16px;
}

/* Time Slots */
.booking-slots-container {
    min-height: 200px;
}

.booking-slots-loading {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.booking-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.time-slot {
    padding: 15px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.time-slot:hover {
    border-color: #1a1a1a;
    background: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.time-slot.selected {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.booking-no-slots {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Form */
.booking-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
}

.required {
    color: #d32f2f;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1a1a1a;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Summary */
.booking-summary {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
}

.booking-summary h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
    border-bottom: none;
}

.form-error {
    background: #ffebee;
    border-left: 4px solid #d32f2f;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    color: #c62828;
}

/* Success/Error States */
.booking-step-success,
.booking-step-error {
    text-align: center;
    padding: 40px 20px;
}

.booking-success-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    color: #fff;
    font-size: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.booking-error-icon {
    width: 80px;
    height: 80px;
    background: #f44336;
    color: #fff;
    font-size: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* Modal Footer */
.booking-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Modal Footer Buttons - Inherit from theme, only add positioning */
.booking-modal-footer .btn {
    /* Theme's .btn class provides base styles */
    /* Only ensure proper cursor and transition for modal context */
    cursor: pointer;
    transition: all 0.2s;
}

.booking-modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.booking-modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.booking-modal-footer .btn-secondary {
    background: #f0f0f0;
    color: #1a1a1a;
    border: 1px solid #e0e0e0;
}

.booking-modal-footer .btn-secondary:hover {
    background: #e0e0e0;
}

/* Progress Indicator */
.booking-modal-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 30px;
    gap: 10px;
}

.progress-step {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
}

.progress-step.active {
    background: #1a1a1a;
    color: #fff;
}

.progress-line {
    width: 50px;
    height: 2px;
    background: #e0e0e0;
}

/* Booking Button */
/* All colors, padding, border-radius inherited from theme .btn and .btn-primary classes */
/* Dynamic colors applied via class-booking-frontend.php add_dynamic_styles() */
.ivanov-law-booking-button {
    /* Only add booking-specific enhancements - no hardcoded colors or sizes */
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: none;
}

.ivanov-law-booking-button:hover {
    /* Enhance theme hover with transform */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .booking-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .booking-modal-header {
        padding: 20px;
    }

    .booking-modal-header-left {
        gap: 10px;
    }

    .booking-modal-logo {
        height: 35px;
    }

    .booking-modal-title {
        font-size: 18px;
    }

    .booking-modal-body {
        padding: 20px;
    }

    .booking-slots-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .time-slot {
        padding: 12px 8px;
        font-size: 14px;
    }

    .booking-modal-footer .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Privacy Policy Checkbox */
.booking-privacy-checkbox {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #c9a961;
}

.booking-privacy-checkbox .checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
}

.booking-privacy-checkbox input[type="checkbox"] {
    margin: 4px 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.booking-privacy-checkbox .privacy-text {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.booking-privacy-checkbox a {
    color: #c9a961;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.booking-privacy-checkbox a:hover {
    color: #b08f4a;
    text-decoration: none;
}

.booking-privacy-checkbox .required {
    color: #e74c3c;
    margin-left: 3px;
}

/* Body lock when modal is open */
body.booking-modal-open {
    overflow: hidden;
}

/* Widget Button Wrapper Alignment */
.booking-button-wrapper {
    margin: 20px 0;
}

.booking-button-wrapper.align-left {
    text-align: left;
}

.booking-button-wrapper.align-center {
    text-align: center;
}

.booking-button-wrapper.align-right {
    text-align: right;
}

/* Ensure theme button styles work */
.ivanov-law-booking-button.btn {
    display: inline-block;
    cursor: pointer;
}

/* Field Help Text */
.field-help-text {
    display: block;
    font-size: 13px;
    color: #777;
    margin-top: 5px;
    margin-bottom: 8px;
    line-height: 1.4;
    font-style: italic;
}

/* Character Counter */
.character-counter {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    text-align: right;
    transition: color 0.3s ease;
}

.character-counter.invalid {
    color: #e74c3c;
    font-weight: 500;
}

.character-counter.valid {
    color: #27ae60;
    font-weight: 500;
}

.character-counter .current-count {
    font-weight: 600;
    font-size: 13px;
}

/* Navigation Button Styles */
.booking-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.booking-modal-footer-actions {
    display: flex;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.booking-modal-footer .btn {
    min-width: 120px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
}

.booking-modal-footer-actions .btn {
    flex: 1;
}

/* Back Button (Secondary) */
.booking-modal-footer .booking-btn-back {
    background: transparent;
    border: 2px solid #d0d0d0;
    color: #666;
}

.booking-modal-footer .booking-btn-back:hover:not(:disabled) {
    border-color: #999;
    color: #333;
    background: #f5f5f5;
}

/* Next Button (Primary) */
.booking-modal-footer .booking-btn-next {
    background: #c9a961;
    color: #fff;
    border: 2px solid #c9a961;
}

.booking-modal-footer .booking-btn-next:hover:not(:disabled) {
    background: #b08f4a;
    border-color: #b08f4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

/* Submit Button (Primary) */
.booking-modal-footer .booking-btn-submit {
    background: #c9a961;
    color: #fff;
    border: 2px solid #c9a961;
}

.booking-modal-footer .booking-btn-submit:hover:not(:disabled) {
    background: #b08f4a;
    border-color: #b08f4a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.3);
}

/* Disabled State for All Buttons */
.booking-modal-footer .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed !important;
    background: #e0e0e0 !important;
    border-color: #e0e0e0 !important;
    color: #999 !important;
    transform: none !important;
    box-shadow: none !important;
}

.booking-modal-footer .booking-btn-back:disabled {
    background: transparent !important;
    border-color: #e0e0e0 !important;
    color: #ccc !important;
}

/* Disabled State Tooltip */
.booking-modal-footer .btn:disabled:hover {
    cursor: not-allowed;
}
