/* Calendar Modal Styles - Standalone CSS */
.form_elem__datetime {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.form_elem__datetime input {
    flex: 1;
    height: 40px;
}

.form_elem__datetime .btn {
    min-width: 150px;
    white-space: nowrap;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.selected-datetime {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 15px;
    height: 40px;
    box-sizing: border-box;
}

.selected-datetime__text {
    font-size: 14px;
    line-height: 20px;
    font-weight: normal;
    color: #333;
    flex: 1;
}

.selected-datetime__change {
    background: none;
    border: none;
    color: #1976d2;
    font-size: 12px;
    line-height: 16px;
    font-weight: normal;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    text-decoration: underline;
}

.selected-datetime__change:hover {
    color: #156cd8;
}

.btn--secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn--secondary:hover {
    background: #e9ecef;
    color: #333;
}

/* Calendar Modal */
.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.calendar-modal.active {
    display: block !important;
}

.calendar-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.calendar-modal__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 90%;
    max-height: 90%;
    width: 600px;
    overflow: hidden;
}

.calendar-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.calendar-modal__header h3 {
    margin: 0;
    font-size: 20px;
    line-height: 24px;
    font-weight: bold;
    color: #333;
}

.calendar-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-modal__close:hover {
    color: #333;
}

.calendar-modal__body {
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    gap: 20px;
}

.calendar-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #eee;
}

/* Calendar Grid */
.calendar-container {
    flex: 1;
    min-width: 300px;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-nav button {
    background: #f8f9fa;
    border: 1px solid #ddd;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 20px;
    font-weight: bold;
}

.calendar-nav button:hover {
    background: #e9ecef;
}

.calendar-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.calendar-nav__month {
    font-size: 18px;
    line-height: 22px;
    font-weight: bold;
    color: #333;
    text-align: center;
    flex: 1;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    line-height: 16px;
    font-weight: bold;
    color: #666;
    padding: 8px 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    line-height: 18px;
    font-weight: normal;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: #f8f9fa;
    border-color: #ddd;
}

.calendar-day.today {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: bold;
}

.calendar-day.selected {
    background: #1976d2;
    color: white;
    font-weight: bold;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.disabled:hover {
    background: transparent;
    border-color: transparent;
}

.calendar-day.other-month {
    color: #ccc;
}

/* Time Selection */
.time-container {
    flex: 0 0 250px;
    border-left: 1px solid #eee;
    padding-left: 20px;
    margin-left: 0;
}

.time-container__header {
    margin-bottom: 15px;
}

.time-container__header .selected-date {
    font-size: 14px;
    line-height: 18px;
    font-weight: bold;
    color: #333;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.time-slot {
    padding: 8px 6px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    line-height: 16px;
    font-weight: normal;
    transition: all 0.2s ease;
    background: white;
}

.time-slot:hover {
    background: #f8f9fa;
    border-color: #bbb;
}

.time-slot.selected {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.time-slot.disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.time-slot.disabled:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

/* Mobile Responsive */
@media only screen and (max-width: 768px) {
    .calendar-modal__content {
        width: 95%;
        max-height: 85%;
    }
    
    .calendar-modal__body {
        flex-direction: column;
    }
    
    .time-container {
        flex: none;
        border-left: none;
        border-top: 1px solid #eee;
        padding-left: 0;
        padding-top: 20px;
        margin-top: 20px;
    }
    
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media only screen and (max-width: 500px) {
    .form_elem__datetime {
        flex-direction: column;
        gap: 10px;
    }
    
    .form_elem__datetime .btn {
        min-width: auto;
        width: 100%;
    }
    
    .selected-datetime {
        width: 100%;
    }
    
    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}
