/* ======================
   ЗАГОЛОВОК КАЛЕНДАРЯ FULLCALENDAR (ПОЛНАЯ ПЕРЕРАБОТКА)
   ====================== */

/* Сброс стилей FullCalendar для лучшей кастомизации */
.fc {
    --fc-button-text-color: #333;
    --fc-button-bg-color: #fff;
    --fc-button-border-color: #ddd;
    --fc-button-hover-bg-color: #f5f7fa;
    --fc-button-hover-border-color: #667eea;
    --fc-button-active-bg-color: #667eea;
    --fc-button-active-border-color: #667eea;
    --fc-today-bg-color: #f0f9ff;
}

/* Заголовок календаря */
.fc .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0;
}

.fc .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Заголовок (название месяца/недели) */
.fc .fc-toolbar-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    min-width: 200px;
    text-align: center;
}

/* Кнопки навигации */
.fc .fc-button {
    padding: 8px 16px;
    border: 1px solid var(--fc-button-border-color);
    border-radius: 6px;
    background: var(--fc-button-bg-color);
    color: var(--fc-button-text-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    height: auto;
    line-height: 1.4;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fc .fc-button:hover {
    background: var(--fc-button-hover-bg-color);
    border-color: var(--fc-button-hover-border-color);
    color: var(--fc-button-hover-text-color, #667eea);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.fc .fc-button:active,
.fc .fc-button.fc-button-active {
    background: var(--fc-button-active-bg-color);
    border-color: var(--fc-button-active-border-color);
    color: white;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.fc .fc-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Кнопка "Сегодня" */
.fc .fc-today-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    font-weight: 600;
    min-width: 90px;
}

.fc .fc-today-button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f96 100%);
    border-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Кнопки навигации (предыдущий/следующий) */
.fc .fc-prev-button,
.fc .fc-next-button {
    min-width: 40px;
    padding: 8px;
    font-size: 1.2em;
    font-weight: bold;
}

.fc .fc-prev-button .fc-icon,
.fc .fc-next-button .fc-icon {
    font-weight: bold;
}

/* Группировка кнопок вида */
.fc .fc-button-group {
    display: flex;
    gap: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #f7fafc;
    padding: 2px;
}

.fc .fc-button-group > .fc-button {
    border: none;
    border-radius: 4px;
    min-width: 70px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: #4a5568;
}

.fc .fc-button-group > .fc-button:hover {
    background: white;
    color: #667eea;
}

.fc .fc-button-group > .fc-button.fc-button-active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

/* Адаптивность для планшетов (768px - 1024px) */
@media (max-width: 1024px) {
    .fc .fc-toolbar-title {
        font-size: 1.3rem;
        min-width: 180px;
        padding: 8px 12px;
    }
    
    .fc .fc-button {
        font-size: 13px;
        padding: 7px 14px;
        min-width: 75px;
    }
    
    .fc .fc-prev-button,
    .fc .fc-next-button {
        min-width: 36px;
        padding: 7px;
        font-size: 1.1em;
    }
    
    .fc .fc-today-button {
        min-width: 80px;
        font-size: 13px;
    }
    
    .fc .fc-button-group > .fc-button {
        min-width: 65px;
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Адаптивность для мобильных (< 768px) */
@media (max-width: 768px) {
    .fc .fc-toolbar.fc-header-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .fc .fc-toolbar-chunk {
        width: 100%;
        justify-content: center;
    }
    
    /* Левый блок: навигация */
    .fc .fc-toolbar-chunk:first-child {
        justify-content: flex-start;
        order: 1;
    }
    
    /* Центральный блок: заголовок */
    .fc .fc-toolbar-chunk:nth-child(2) {
        justify-content: center;
        order: 2;
    }
    
    /* Правый блок: переключатель вида */
    .fc .fc-toolbar-chunk:last-child {
        justify-content: center;
        order: 3;
        margin-top: 8px;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1.2rem;
        padding: 10px 16px;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .fc .fc-button {
        font-size: 13px;
        padding: 8px 14px;
        min-width: 70px;
    }
    
    .fc .fc-prev-button,
    .fc .fc-next-button {
        min-width: 38px;
        padding: 8px;
        font-size: 1.2em;
    }
    
    .fc .fc-today-button {
        min-width: 75px;
        font-size: 12px;
        padding: 8px 12px;
		margin: 0px auto !important;
    }
    
    .fc .fc-button-group {
        flex-direction: row;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .fc .fc-button-group > .fc-button {
        flex: 1;
        min-width: auto;
        font-size: 12px;
        padding: 8px 6px;
    }
}

/* Очень маленькие экраны (< 480px) */
@media (max-width: 480px) {
    .fc .fc-toolbar-title {
        font-size: 1.1rem;
        padding: 8px 12px;
    }
    
    .fc .fc-button {
        font-size: 12px;
        padding: 7px 12px;
        min-width: 65px;
    }
    
    .fc .fc-prev-button,
    .fc .fc-next-button {
        min-width: 36px;
        padding: 7px;
        font-size: 1.1em;
    }
    
    .fc .fc-today-button {
        min-width: 70px;
        font-size: 11px;
        padding: 7px 10px;
    }
    
    .fc .fc-button-group > .fc-button {
        font-size: 11px;
        padding: 7px 4px;
    }
}

/* Сетка календаря - адаптивность */
.fc .fc-view-harness {
    overflow-x: auto;
}

.fc-direction-ltr .fc-dayGrid-view .fc-dayGrid-body {
    min-width: 600px;
}

@media (max-width: 768px) {
    .fc-direction-ltr .fc-dayGrid-view .fc-dayGrid-body {
        min-width: 400px;
    }
    
    .fc .fc-col-header-cell {
        font-size: 12px;
        padding: 6px 4px;
    }
    
    .fc .fc-daygrid-day-number {
        font-size: 13px;
    }
    
    .fc .fc-event-title {
        font-size: 12px;
    }
}

/* Улучшение внешнего вида событий на мобильных */
@media (max-width: 480px) {
    .fc .fc-event {
        font-size: 11px;
        padding: 3px 5px;
    }
    
    .fc .fc-event-title {
        font-size: 10px;
    }
    
    .fc .fc-col-header-cell {
        font-size: 11px;
        padding: 4px 2px;
    }
    
    .fc .fc-daygrid-day-number {
        font-size: 12px;
    }
}