/* ==========================================================================
   MONCH EXTREME CALENDAR - FRONTEND STYLES
   ========================================================================== */

/* ==========================================================================
   СЕТКА БЛОКОВ СОБЫТИЙ
   ========================================================================== */
.monch-events-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 30px 0;
    transition: opacity 0.2s ease;
}

/* ==========================================================================
   ФИЛЬТРЫ (СТИЛЬ: ПРЯМОУГОЛЬНЫЕ КНОПКИ, Ч/Б)
   ========================================================================== */
.monch-events-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
    padding: 0;
    background: transparent;
    border: none;
}

.monch-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.monch-filter-btn {
    padding: 8px 5px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background: #fff;
    color: #111;
    font-size: 15px;
    font-weight: 550;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
    font-family: inherit;
    letter-spacing: 0.2px;
}

.monch-filter-btn:hover {
    border-color: #111;
    background: #0000007c;
}

.monch-filter-btn.active {
    background: #111;
    border-color: #111;
    color: #fff;
}

.monch-filter-btn.active:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}

/* ==========================================================================
   ФИЛЬТР ПО КАТЕГОРИЯМ (DROPDOWN)
   ========================================================================== */
.monch-filter-categories {
    display: flex;
    align-items: center;
}

.monch-category-select {
    padding: 4px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background: #fff;
    color: #111;
    font-size: 15px;
    font-weight: 550;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    letter-spacing: 0.2px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    min-width: 200px;
}

.monch-category-select:hover {
    border-color: #111;
}

.monch-category-select:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Индикатор загрузки */
.monch-events-grid.monch-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.monch-no-events {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 1.05em;
    grid-column: 1 / -1;
    margin: 0;
}

/* Адаптивность фильтров */
@media (max-width: 768px) {
    .monch-filter-buttons {
        gap: 8px;
    }
    
    .monch-filter-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .monch-category-select {
        padding: 10px 35px 10px 12px;
        font-size: 14px;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .monch-filter-btn {
        padding: 9px 14px;
        font-size: 13px;
    }
    
    .monch-category-select {
        padding: 9px 30px 9px 10px;
        font-size: 13px;
    }
}

/* ==========================================================================
   БЛОК СОБЫТИЯ (КАРТОЧКА)
   ========================================================================== */
.monch-event-block {
    background:#ccc;
    border-radius: 8px;
    padding: 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    border-top: 4px solid #1e98ff;
    min-height: 280px;
}

.monch-event-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   ИЗОБРАЖЕНИЕ СОБЫТИЯ
   ========================================================================== */
.monch-event-thumbnail {
    width: 100%;
    height: 160px;
    background: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
}

.monch-event-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.monch-event-block:hover .monch-event-thumbnail img {
    transform: scale(1.05);
}

/* ==========================================================================
   ИКОНКА (ЕСЛИ НЕТ ИЗОБРАЖЕНИЯ)
   ========================================================================== */
.monch-event-icon {
    margin-bottom: 10px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 0 10px;
}

.monch-event-icon svg {
    max-width: 40px;
    max-height: 40px;
    width: auto;
    height: auto;
}

.monch-default-icon {
    font-size: 30px;
    opacity: 0.6;
}

/* ==========================================================================
   ДАТА СОБЫТИЯ
   ========================================================================== */
.monch-event_day-month-year {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px 8px;
    gap: 8px;
}

.monch-event-date_day {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.monch-date-day {
    font-size: 40px;
    font-weight: 500;
    letter-spacing: 0.1px;
    line-height: 48px;
    color: #333;
}

.monch-event-date_month-year {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    margin-top: -4px;
}

.monch-date-month {
    font-size: 14px;
    line-height: 12px;
    color: #000000;
    margin-bottom: 5px;
    text-transform: lowercase;
}

.monch-date-year {
    font-size: 14px;
    line-height: 12px;
    color: #000000;
    font-weight: 400;
}

/* ==========================================================================
   НАЗВАНИЕ СОБЫТИЯ
   ========================================================================== */
.monch-event-title {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    padding: 8px 12px 14px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: auto;
}

/* ==========================================================================
   МЕТА-ИНФОРМАЦИЯ (в карточках [monch_calendar])
   ========================================================================== */
.monch-event-meta {
    padding: 0 12px 12px;
    font-size: 0.85em;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО
   ========================================================================== */
.monch-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    animation: monch-fadeIn 0.2s ease;
}

@keyframes monch-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.monch-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: monch-slideUp 0.3s ease;
}

@keyframes monch-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.monch-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(167, 165, 165, 0.7);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 30%;
    font-size: 44px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.monch-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    transform: rotate(90deg);
}

.monch-modal-thumbnail {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #f5f5f5;
}

.monch-modal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.monch-modal-body {
    padding: 30px;
}

.monch-modal-title {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #333;
    line-height: 1.3;
}

.monch-modal-date {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 20px;
}

.monch-modal-meta {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.monch-meta-location,
.monch-meta-instructor,
.monch-meta-age {
    margin-bottom: 8px;
    font-size: 0.95em;
    line-height: 1.5;
}

.monch-meta-location:last-child,
.monch-meta-instructor:last-child,
.monch-meta-age:last-child {
    margin-bottom: 0;
}

.monch-meta-location strong,
.monch-meta-instructor strong,
.monch-meta-age strong {
    display: inline-block;
    margin-right: 5px;
    color: #555;
}

.monch-modal-description {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #555;
}

.monch-modal-more-btn {
    display: inline-block;
    padding: 8px 14px;
    border: 2px solid #555;
    background: #555;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.monch-modal-more-btn:hover {
    background: #ffffff;
    color: #000000;
    border-radius: px;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   АДАПТИВНОСТЬ
   ========================================================================== */
@media (max-width: 1200px) {
    .monch-events-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .monch-events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .monch-event-block {
        min-height: 260px;
    }
    
    .monch-event-thumbnail {
        height: 140px;
    }
    
    .monch-date-day {
        font-size: 36px;
        line-height: 42px;
    }
    
    .monch-date-month,
    .monch-date-year {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .monch-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .monch-event-block {
        min-height: 220px;
    }
    
    .monch-event-thumbnail {
        height: 100px;
    }
    
    .monch-event_day-month-year {
        padding: 10px 8px 6px;
        gap: 6px;
    }
    
    .monch-date-day {
        font-size: 28px;
        line-height: 36px;
    }
    
    .monch-date-month,
    .monch-date-year {
        font-size: 12px;
    }
    
    .monch-event-title {
        font-size: 0.85em;
        padding: 6px 10px 10px;
    }
    
    .monch-event-icon {
        padding: 12px 0 8px;
    }
    
    /* Фильтры на мобильных */
    .monch-events-filters {
        padding: 14px;
    }
    
    .monch-filter-buttons {
        gap: 8px;
    }
    
    .monch-filter-btn {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .monch-modal-content {
        max-width: 100%;
        margin: 10px;
    }
    
    .monch-modal-body {
        padding: 20px;
    }
    
    .monch-modal-title {
        font-size: 1.4em;
    }
    
    .monch-modal-thumbnail {
        max-height: 220px;
    }
}

@media (max-width: 480px) {
    .monch-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .monch-event-block {
        min-height: 200px;
    }
    
    .monch-event-thumbnail {
        height: 90px;
    }
    
    .monch-date-day {
        font-size: 24px;
        line-height: 32px;
    }
    
    .monch-date-month,
    .monch-date-year {
        font-size: 11px;
    }
    
    .monch-event-icon {
        height: 30px;
        padding: 10px 0 6px;
    }
    
    .monch-event-icon svg {
        max-width: 30px;
        max-height: 30px;
    }
    
    .monch-default-icon {
        font-size: 26px;
    }
    
    .monch-modal-thumbnail {
        max-height: 180px;
    }
    
    .monch-filter-btn {
        padding: 7px 14px;
        font-size: 0.85em;
    }
}