/* ===================================================================
   MODAL DE RESERVA - ClassGo
   Componente: Modal de reserva con stepper, calendario y pago
   Metodología: BEM (Block Element Modifier)
   =================================================================== */

/* ===================================================================
   ANIMATIONS & KEYFRAMES
   =================================================================== */
@import 'variables.css';

@keyframes booking-modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes booking-modal-shake {
    0%, 100% { 
        transform: translateX(0); 
    }
    10%, 30%, 50%, 70%, 90% { 
        transform: translateX(-5px); 
    }
    20%, 40%, 60%, 80% { 
        transform: translateX(5px); 
    }
}

@keyframes booking-spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===================================================================
   MODAL BASE
   =================================================================== */
.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.booking-modal--hidden {
    display: none !important;
}

.booking-modal--active .booking-modal__content {
    animation: booking-modal-fade-in 300ms ease-in-out forwards;
}

/* ===================================================================
   MODAL CONTENT
   =================================================================== */
.booking-modal__content {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 48rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.booking-modal__body {
    padding: 1rem 1.5rem;
    position: relative;
}

.booking-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 1rem;
}

/* ===================================================================
   CLOSE BUTTON
   =================================================================== */
.booking-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #9ca3af;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 150ms ease-in-out;
}

.booking-modal__close:hover {
    color: #4b5563;
}

.booking-modal__close-icon {
    width: 24px;
    height: 24px;
}

/* ===================================================================
   STEPPER (Progress Indicator)
   =================================================================== */
.booking-stepper {
    margin-bottom: 1.25rem;
}

.booking-stepper__wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.booking-stepper__item {
    flex: 1;
    text-align: center;
}

.booking-stepper__icon {
    margin: 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    background-color: #e5e7eb;
    color: #6b7280;
    transition: all 300ms ease-in-out;
}

.booking-stepper__item--active .booking-stepper__icon,
.booking-stepper__item--completed .booking-stepper__icon {
    background-color: var(--secundary-color);
    color: #ffffff;
}

.booking-stepper__label {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.booking-stepper__item--active .booking-stepper__label,
.booking-stepper__item--completed .booking-stepper__label {
    color: #4b5563;
}

.booking-stepper__line {
    flex: 1;
    border-top: 2px solid #e5e7eb;
    transition: border-color 500ms ease-in-out;
}

.booking-stepper__line--active {
    border-color: var(--secundary-color);
}

/* ===================================================================
   STEPS CONTAINER
   =================================================================== */
.booking-steps {
    min-height: 320px;
    position: relative;
}

.booking-step {
    transition: opacity 300ms ease-in-out;
}

.booking-step--hidden {
    display: none !important;
}

.booking-step__container {
    max-width: 28rem;
    margin: 0 auto;
}

.booking-step__title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
    text-align: center;
}

.booking-step__subtitle {
    color: #6b7280;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

.booking-step__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 1024px) {
    .booking-step__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================================================
   FORM ELEMENTS
   =================================================================== */
.booking-form__group {
    margin-bottom: 0.75rem;
}

.booking-form__label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.booking-form__select,
.booking-form__input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    outline: none;
    transition: border-color 150ms ease-in-out, box-shadow 150ms ease-in-out;
}

.booking-form__select:focus,
.booking-form__input:focus {
    border-color: var(--secundary-color);
    box-shadow: 0 0 0 3px rgba(33, 158, 188, 0.1);
}

.booking-form__file-upload {
    cursor: pointer;
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px dashed #d1d5db;
    border-radius: 0.375rem;
    transition: border-color 150ms ease-in-out;
}

.booking-form__file-upload:hover {
    border-color: #9ca3af;
}

.booking-form__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===================================================================
   CALENDAR
   =================================================================== */
.booking-calendar {
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.booking-calendar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.booking-calendar__nav-btn {
    padding: 0.25rem;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease-in-out;
    font-size: 0.75rem;
}

.booking-calendar__nav-btn:hover {
    background-color: #f3f4f6;
}

.booking-calendar__month {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.8125rem;
}

.booking-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    text-align: center;
}

.booking-calendar__weekday {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.6875rem;
    padding: 0.125rem;
}

.booking-calendar__day {
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background-color 150ms ease-in-out, color 150ms ease-in-out;
    position: relative;
    user-select: none;
    font-size: 0.75rem;
}

.booking-calendar__day:hover:not(.booking-calendar__day--disabled) {
    background-color: #ebf8ff;
}

.booking-calendar__day--selected {
    background-color: var(--secundary-color);
    color: #ffffff;
}

.booking-calendar__day--disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.booking-calendar__availability-dot {
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background-color: var(--terciary-color2);
    border-radius: 50%;
}

/* ===================================================================
   TIME SLOTS
   =================================================================== */
.booking-timeslots {
    max-height: 16rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.375rem;
}

.booking-timeslots::-webkit-scrollbar {
    width: 5px;
}

.booking-timeslots::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.booking-timeslots::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

.booking-timeslots::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.booking-timeslot {
    cursor: pointer;
    padding: 0.25rem 0.375rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    text-align: center;
    transition: all 150ms ease-in-out;
    user-select: none;
    font-size: 0.75rem;
}

.booking-timeslot:hover {
    background-color: #ebf8ff;
    border-color: var(--secundary-color);
}

.booking-timeslot--selected {
    background-color: var(--secundary-color);
    color: #ffffff;
    border-color: var(--secundary-color);
}

/* ===================================================================
   SUMMARY (Step 3)
   =================================================================== */
.booking-summary {
    background: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
}

.booking-summary__section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

.booking-summary__details {
    color: #4b5563;
    font-size: 0.875rem;
}

.booking-summary__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.booking-summary__label {
    font-weight: 500;
}

.booking-summary__value {
    font-weight: 600;
    color: #1f2937;
}

.booking-summary__divider {
    border-top: 1px solid #e5e7eb;
    margin: 0.75rem 0;
}

.booking-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
}

.booking-summary__coupon-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.booking-summary__message {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    min-height: 1rem;
}

.booking-summary__message--success {
    color: #059669;
}

.booking-summary__message--error {
    color: #dc2626;
}

/* ===================================================================
   PAYMENT TABS
   =================================================================== */
.booking-payment {
    margin-top: 1rem;
}

.booking-payment__tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
}

.booking-payment__tab {
    flex: 1;
    padding: 0.375rem 0;
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 150ms ease-in-out, border-color 150ms ease-in-out;
}

.booking-payment__tab:hover {
    color: var(--secundary-color);
}

.booking-payment__tab--active {
    color: var(--secundary-color);
    border-bottom-color: var(--secundary-color);
}

.booking-payment__content {
    margin-top: 1rem;
    text-align: center;
}

.booking-payment__content--hidden {
    display: none !important;
}

.booking-payment__qr-container {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.875rem;
    color: #9ca3af;
}

.booking-payment__transfer-info {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.5rem;
    text-align: left;
    font-size: 0.875rem;
}

.booking-payment__transfer-row {
    margin-bottom: 0.375rem;
}

/* ===================================================================
   MODAL STATES (Loader & Confirmation)
   =================================================================== */
.booking-modal__state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    padding: 2rem;
    border-radius: 1rem;
}

.booking-modal__state--hidden {
    display: none !important;
}

.booking-modal__spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid var(--secundary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: booking-spinner 1s linear infinite;
}

.booking-modal__state-icon {
    background: #dcfce7;
    border-radius: 50%;
    padding: 1rem;
}

.booking-modal__state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 1.5rem;
}

.booking-modal__state-text {
    color: #4b5563;
    margin-top: 0.5rem;
    max-width: 28rem;
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.booking-btn {
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 300ms ease-in-out;
}

.booking-btn--primary {
    background-color: var(--secundary-color);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.booking-btn--primary:hover {
    background-color: var(--primary-color);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.booking-btn--secondary {
    background-color: var(--secundary-color2);
    color: var(--primary-color);
}

.booking-btn--secondary:hover {
    background-color: var(--terciary-color2);
    color: #ffffff;
}

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

.booking-btn:disabled:hover {
    background-color: #e5e7eb;
    box-shadow: none;
}

/* ===================================================================
   NAVIGATION
   =================================================================== */
.booking-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1.25rem;
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */
.booking-shake {
    animation: booking-modal-shake 0.5s ease-in-out;
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
    .booking-modal {
        padding: 0.5rem;
    }
    
    .booking-modal__body {
        padding: 1rem;
    }
    
    .booking-modal__title {
        font-size: 1.25rem;
    }
    
    .booking-step__grid {
        gap: 1rem;
    }
    
    .booking-stepper__wrapper {
        max-width: 100%;
    }
    .tutor-card-main-content, .tutor-banner-overlay {
    z-index: auto !important;
    position: static !important;
    }
    .tutor-profile-img{
        z-index: 1 !important;
    }
}
