/**
 * TPD Control Reservation Module Styles
 */

.reservation-form {
    max-width: 100%;
}

/* Calendar Styles */
.calendar {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
    max-width: 400px;
    margin: 0;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.calendar-month-year {
    font-weight: 600;
    font-size: 0.95rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.calendar-weekday {
    padding: 0.4rem 0.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #dee2e6;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.25rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    min-height: 35px;
}

.calendar-day:hover:not(.calendar-day-disabled):not(.calendar-day-empty) {
    background-color: #e7f3ff;
    font-weight: 600;
}

.calendar-day-selected {
    background-color: #0d6efd !important;
    color: #fff !important;
    font-weight: 600;
}

.calendar-day-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.calendar-day-weekend {
    opacity: 0.5;
}

.calendar-day-empty {
    background-color: #f8f9fa;
    cursor: default;
}

/* Time Slots */
.time-slots-title {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.time-buttons-container {
    gap: 0.5rem;
}

.time-buttons-container .btn {
    min-width: 80px;
}

.modal {
    z-index: 10001 !important;
}

.modal-backdrop {
    z-index: 10000 !important;
}

.modal-dialog {
    z-index: 10001 !important;
}

/* Success Checkmark */
.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.check-icon {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #4caf50;
}

.check-icon::before {
    top: 3px;
    left: -2px;
    width: 30px;
    transform-origin: 100% 50%;
    border-radius: 100px 0 0 100px;
}

.check-icon::after {
    top: 0;
    left: 30px;
    width: 60px;
    transform-origin: 0 50%;
    border-radius: 0 100px 100px 0;
    animation: rotate-circle 4.25s ease-in;
}

.icon-line {
    height: 5px;
    background-color: #4caf50;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
}

.icon-line.line-tip {
    top: 46px;
    left: 14px;
    width: 25px;
    transform: rotate(45deg);
    animation: icon-line-tip 0.75s;
}

.icon-line.line-long {
    top: 38px;
    right: 8px;
    width: 47px;
    transform: rotate(-45deg);
    animation: icon-line-long 0.75s;
}

.icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(76, 175, 80, 0.5);
}

.icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: #fff;
}

/* Error Icon */
.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.error-cross {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 50%;
    box-sizing: content-box;
    border: 4px solid #f44336;
}

.error-cross .icon-line {
    height: 5px;
    background-color: #f44336;
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 10;
    top: 37px;
    width: 47px;
    left: 16px;
}

.error-cross .icon-line.line-left {
    transform: rotate(45deg);
    animation: error-line-left 0.75s;
}

.error-cross .icon-line.line-right {
    transform: rotate(-45deg);
    animation: error-line-right 0.75s;
}

.error-cross .icon-circle {
    top: -4px;
    left: -4px;
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: absolute;
    box-sizing: content-box;
    border: 4px solid rgba(244, 67, 54, 0.5);
}

.error-cross .icon-fix {
    top: 8px;
    width: 5px;
    left: 26px;
    z-index: 1;
    height: 85px;
    position: absolute;
    transform: rotate(-45deg);
    background-color: #fff;
}

/* Animations */
@keyframes rotate-circle {
    0% {
        transform: rotate(-45deg);
    }
    5% {
        transform: rotate(-45deg);
    }
    12% {
        transform: rotate(-405deg);
    }
    100% {
        transform: rotate(-405deg);
    }
}

@keyframes icon-line-tip {
    0% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    54% {
        width: 0;
        left: 1px;
        top: 19px;
    }
    70% {
        width: 50px;
        left: -8px;
        top: 37px;
    }
    84% {
        width: 17px;
        left: 21px;
        top: 48px;
    }
    100% {
        width: 25px;
        left: 14px;
        top: 45px;
    }
}

@keyframes icon-line-long {
    0% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    65% {
        width: 0;
        right: 46px;
        top: 54px;
    }
    84% {
        width: 55px;
        right: 0;
        top: 35px;
    }
    100% {
        width: 47px;
        right: 8px;
        top: 38px;
    }
}

@keyframes error-line-left {
    0% {
        width: 0;
        left: 39px;
    }
    65% {
        width: 0;
        left: 39px;
    }
    84% {
        width: 55px;
        left: 12px;
    }
    100% {
        width: 47px;
        left: 16px;
    }
}

@keyframes error-line-right {
    0% {
        width: 0;
        left: 39px;
    }
    65% {
        width: 0;
        left: 39px;
    }
    84% {
        width: 55px;
        left: 12px;
    }
    100% {
        width: 47px;
        left: 16px;
    }
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .calendar {
        max-width: 100%;
    }
    
    .calendar-day {
        font-size: 0.7rem;
        padding: 0.25rem;
        min-height: 30px;
    }
    
    .calendar-header {
        padding: 0.5rem 0.4rem;
    }
    
    .calendar-month-year {
        font-size: 0.85rem;
    }
    
    .calendar-weekday {
        padding: 0.3rem 0.2rem;
        font-size: 0.7rem;
    }
    
    .time-buttons-container .btn {
        min-width: 70px;
        font-size: 0.875rem;
    }
}