/* Стили для интерактивного календаря */

.calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.calendar-modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.calendar-modal-content h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #333;
}

.calendar-modal-content p {
    margin: 8px 0;
    color: #555;
}

.calendar-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-confirm {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.4);
}

.btn-cancel {
    background: linear-gradient(135deg, #9e9e9e 0%, #616161 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 500;
}

.btn-cancel:hover {
    transform: translateY(-2px);
}

.btn-reschedule {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.btn-reschedule:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.4);
}

.btn-close {
    background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 500;
}

.btn-close:hover {
    transform: translateY(-2px);
}

/* Форма переноса */
.calendar-modal-content label {
    display: block;
    margin-top: 12px;
    margin-bottom: 4px;
    font-weight: 500;
    color: #333;
}

.calendar-modal-content input[type="date"],
.calendar-modal-content input[type="time"],
.calendar-modal-content textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.calendar-modal-content textarea {
    resize: vertical;
    min-height: 60px;
}

.btn-submit {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 500;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.4);
}

/* Стили для счетчика доступных слотов в ячейках календаря */
.day-slots-info {
    font-size: 10px;
    color: #666;
    text-align: center;
    margin-top: 2px;
    font-weight: 500;
}

/* Стили для клиентского календаря */
#clientCalendar {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

/* Улучшенные стили FullCalendar */
#clientCalendar .fc {
    font-family: inherit;
}

#clientCalendar .fc-toolbar {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

#clientCalendar .fc-toolbar-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

#clientCalendar .fc-button {
    background: #D4AF37;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

#clientCalendar .fc-button:hover {
    background: #b8941f;
    transform: translateY(-1px);
}

#clientCalendar .fc-button:active {
    transform: translateY(0);
}

#clientCalendar .fc-daygrid-day {
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
    min-height: 50px;
    height: 50px;
    width: 40px;
}

#clientCalendar .fc-daygrid-day-frame {
    min-height: 50px;
    height: 50px;
    width: 40px;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    position: relative;
    justify-content: space-between;
    align-items: center;
}

#clientCalendar .fc-daygrid-body {
    position: relative;
    z-index: 1;
}

#clientCalendar .fc-scrollgrid-section-body > td {
    border: none !important;
}

#clientCalendar .fc-daygrid-day-events {
    margin-top: auto;
    min-height: 0;
}

#clientCalendar .fc-daygrid-day:hover:not(.fc-day-disabled) {
    background: #f8f9fa;
    transform: scale(1.02);
}

#clientCalendar .fc-daygrid-day-number {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    align-self: center;
    position: relative;
    z-index: 1;
    order: 2;
}

#clientCalendar .fc-day-today {
    background: #fff9e6 !important;
    border: 2px solid #D4AF37 !important;
}

/* Выбранная дата - зеленая рамка */
#clientCalendar .fc-day-selected {
    border: 2px solid #4caf50 !important;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.4);
    z-index: 10;
    position: relative;
}

#clientCalendar .fc-day-disabled {
    background: #f5f5f5;
    opacity: 0.5;
}

.client-cal-day {
    cursor: pointer;
    transition: all 0.2s ease;
}

.client-cal-green {
    background-color: rgba(76, 175, 80, 0.15) !important;
    border-color: #4caf50 !important;
}

.client-cal-yellow {
    background-color: rgba(255, 193, 7, 0.15) !important;
    border-color: #ffc107 !important;
}

.client-cal-red {
    background-color: rgba(244, 67, 54, 0.15) !important;
    border-color: #f44336 !important;
}

.client-cal-gray {
    background-color: rgba(158, 158, 158, 0.05) !important;
}

.client-cal-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.client-cal-day:not(.client-cal-disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Прошедшие даты */
.date-past {
    color: #999 !important;
    opacity: 0.6;
    pointer-events: none;
}

.date-past .fc-daygrid-day-number {
    color: #999 !important;
}

.date-past .fc-daygrid-day-frame {
    background: rgba(158, 158, 158, 0.05) !important;
}

.day-status-icon {
    font-size: 12px;
    margin-top: 2px;
    align-self: flex-start;
}

.fc-daygrid-day-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    width: 100%;
    gap: 4px;
    flex: 1;
}

.fc-daygrid-day-number {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    order: 2;
}

/* Иконки статуса внутри ячейки */
.day-status-icon {
    font-size: 12px;
    line-height: 1;
    text-align: center;
    display: block;
}

/* CSS-индикаторы статуса доступности */
.status-indicator {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out;
    z-index: 1;
    order: 1;
    margin: 0 auto;
}

.status-indicator.status-green {
    background-color: #4CAF50;
}

.status-indicator.status-yellow {
    background-color: #FFC107;
}

.status-indicator.status-red {
    background-color: #F44336;
}

.status-indicator.status-gray {
    background-color: #9E9E9E;
}

/* Fallback эмодзи для старых браузеров */
.status-indicator::after {
    content: attr(data-emoji);
    position: absolute;
    top: -2px;
    left: -2px;
    font-size: 12px;
    opacity: 0;
}

@supports not (border-radius: 50%) {
    .status-indicator::after {
        opacity: 1;
    }
    .status-indicator {
        background: none;
    }
}

.day-slots-info {
    font-size: 11px;
    color: #666;
    text-align: center;
    padding: 2px 4px;
    margin-top: 4px;
}

/* Адаптивность календаря */
@media (max-width: 480px) {
    #clientCalendar {
        padding: 12px;
    }
    
    #clientCalendar .fc-toolbar-title {
        font-size: 16px;
    }
    
    #clientCalendar .fc-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    #clientCalendar .fc-daygrid-day-number {
        font-size: 11px;
        padding: 2px;
    }
    
    #clientCalendar .fc-daygrid-day {
        min-height: 45px;
        height: 45px;
        width: 35px;
    }
    
    #clientCalendar .fc-daygrid-day-frame {
        min-height: 45px;
        height: 45px;
        width: 35px;
        padding: 0;
    }
    
    .status-indicator {
        width: 6px;
        height: 6px;
    }
    
    .day-slots-info {
        font-size: 10px;
    }
}
