/* css/calendar.css */

/* Основные стили контейнера */
.aec-calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Панель управления */
.aec-calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.aec-controls-left,
.aec-controls-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Навигация по месяцам */
.aec-date-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
}

.aec-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: #495057;
}

.aec-nav-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.aec-current-month {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    min-width: 160px;
    text-align: center;
}

.aec-month-name {
    margin-right: 8px;
}

/* Переключатель видов */
.aec-view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
}

.aec-view-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
}

.aec-view-btn.active,
.aec-view-btn:hover {
    background: #007bff;
    color: white;
}

/* Поиск */
.aec-search-container {
    position: relative;
}

.aec-search-input {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    width: 250px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.aec-search-input:focus {
    outline: none;
    border-color: #007bff;
}

.aec-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.aec-search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f8f9fa;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.aec-search-result-item:hover {
    background: #f8f9fa;
}

.aec-search-result-item:last-child {
    border-bottom: none;
}

/* Фильтры */
.aec-filters {
    display: flex;
    gap: 10px;
}

.aec-filter-select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.aec-filter-select:focus {
    outline: none;
    border-color: #007bff;
}

/* Кнопка "Сегодня" */
.aec-today-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.aec-today-btn:hover {
    background: #218838;
}

/* Календарная сетка */
.aec-calendar-grid {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.aec-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
}

.aec-day-header {
    padding: 16px 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    border-right: 1px solid #e9ecef;
    font-size: 14px;
}

.aec-day-header:last-child {
    border-right: none;
}

.aec-calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* Дни календаря */
.aec-calendar-day {
    min-height: 120px;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.aec-calendar-day:last-child {
    border-right: none;
}

.aec-calendar-day:hover {
    background: #f8f9fa;
}

.aec-calendar-day.other-month {
    background: #fafafa;
    color: #adb5bd;
}

.aec-calendar-day.today {
    background: #e3f2fd;
}

.aec-calendar-day.today .aec-day-number {
    background: #007bff;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.aec-day-number {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #212529;
}

.aec-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* События в календаре */
.aec-event-item {
    background: #007bff;
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aec-event-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.aec-event-time {
    font-weight: 600;
    margin-right: 4px;
}

.aec-event-title {
    font-weight: 400;
}

/* Список событий */
.aec-events-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aec-list-event {
    display: flex;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    cursor: pointer;
}

.aec-list-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.aec-event-date {
    background: #007bff;
    color: white;
    padding: 20px;
    text-align: center;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.aec-date-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.aec-date-month {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 4px;
}

.aec-event-info {
    padding: 20px;
    flex: 1;
}

.aec-event-info .aec-event-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #212529;
}

.aec-event-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.aec-event-meta span {
    font-size: 14px;
    color: #6c757d;
}

.aec-event-excerpt {
    color: #495057;
    line-height: 1.5;
    margin-bottom: 15px;
}

.aec-event-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.aec-event-link:hover {
    text-decoration: underline;
}

/* Модальное окно */
.aec-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.aec-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.aec-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #adb5bd;
    z-index: 10;
}

.aec-modal-close:hover {
    color: #495057;
}

.aec-modal-body {
    padding: 30px;
}

/* Загрузка */
.aec-loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.aec-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Недельный вид */
.aec-week-view {
    display: grid;
    grid-template-columns: auto repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.aec-week-time-slot {
    background: #f8f9fa;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
}

.aec-week-day-slot {
    background: white;
    min-height: 60px;
    padding: 5px;
    position: relative;
}

/* Адаптивность */
@media (max-width: 768px) {
    .aec-calendar-container {
        padding: 15px;
    }
    
    .aec-calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .aec-controls-left,
    .aec-controls-right {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .aec-search-input {
        width: 100%;
        max-width: 300px;
    }
    
    .aec-calendar-day {
        min-height: 80px;
        padding: 6px;
    }
    
    .aec-day-number {
        font-size: 14px;
    }
    
    .aec-event-item {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .aec-list-event {
        flex-direction: column;
    }
    
    .aec-event-date {
        min-width: auto;
        padding: 15px;
    }
    
    .aec-modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .aec-calendar-day {
        min-height: 60px;
        padding: 4px;
    }
    
    .aec-day-number {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .aec-event-item {
        font-size: 9px;
        padding: 1px 3px;
    }
    
    .aec-view-toggle {
        width: 100%;
    }
    
    .aec-view-btn {
        flex: 1;
        text-align: center;
    }
}

/* Анимации */
.aec-fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.aec-slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Состояния событий */
.aec-event-item.featured {
    box-shadow: 0 0 0 2px #ffc107;
}

.aec-event-item.sold-out {
    opacity: 0.6;
    position: relative;
}

.aec-event-item.sold-out::after {
    content: "Продано";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
}