/* --- СЕКЦИЯ И ОСНОВНОЙ КОНТЕЙНЕР --- */
.calendar-section {
    padding: 80px 20px;
    background: #0a0a0a;
}

.calendar-center-all {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calendar-wrapper {
    width: 100%;
    max-width: 600px;
    background: #111;
    padding: 30px;
    border-radius: 40px;
    border: 1px solid rgba(212, 252, 30, 0.15);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* --- ИДЕАЛЬНОЕ ЦЕНТРИРОВАНИЕ ЗАГОЛОВКА --- */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 30px;
    min-height: 50px;
}

.calendar-header h3 {
    font-size: clamp(20px, 5vw, 28px);
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    text-align: center;
    width: 100%;
    letter-spacing: 1px;
    font-weight: 800;
}

.calendar-header button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(212, 252, 30, 0.1);
    border: none;
    color: #D4FC1E;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: 0.3s;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prevMonth { left: 0; }
#nextMonth { right: 0; }

.calendar-header button:hover {
    background: #D4FC1E;
    color: #000;
}

/* --- СЕТКА КАЛЕНДАРЯ --- */
.calendar-grid-header, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    text-align: center;
}

.calendar-grid-header div {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    font-weight: 700;
    padding-bottom: 10px;
}

.calendar-day {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.3s;
    font-size: 16px;
    color: #fff;
}

.calendar-day:hover:not(:empty) {
    background: rgba(255, 255, 255, 0.1);
}

.calendar-day.has-event {
    border: 2px solid #D4FC1E;
    color: #D4FC1E;
    font-weight: 800;
    box-shadow: 0 0 10px rgba(212, 252, 30, 0.2);
}

/* --- НОВЫЙ ДИЗАЙН МОДАЛЬНОГО ОКНА --- */
.event-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.event-modal.active { opacity: 1; }

.event-modal-content {
    background: #111;
    max-width: 850px;
    width: 95%;
    border-radius: 35px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(212, 252, 30, 0.2);
    transform: translateY(30px) scale(0.95);
    transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.event-modal.active .event-modal-content {
    transform: translateY(0) scale(1);
}

.event-flex-layout {
    display: flex;
    flex-wrap: wrap;
}

.event-info-side {
    flex: 1.2;
    padding: 40px;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.event-badge {
    background: rgba(212, 252, 30, 0.1);
    color: #D4FC1E;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    width: fit-content;
    margin-bottom: 20px;
    border: 1px solid rgba(212, 252, 30, 0.3);
}

.event-info-side h3 {
    font-size: 32px;
    color: #fff;
    margin-bottom: 15px;
}

.event-info-side p {
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 30px;
}

.event-details-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.loc-label { color: rgba(255, 255, 255, 0.3); font-size: 11px; text-transform: uppercase; }
.loc-value { color: #D4FC1E; font-weight: 600; font-size: 14px; }

.btn-copy {
    background: #D4FC1E;
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.event-image-side {
    flex: 1;
    min-height: 400px;
    position: relative;
    min-width: 300px;
}

.event-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #111 0%, transparent 30%);
}

.close-event {
    position: absolute;
    top: 20px; right: 20px;
    background: rgba(0,0,0,0.5);
    border: none; color: #fff;
    font-size: 24px; width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; z-index: 10;
}





@media (max-width: 768px) {
    /* Основной контейнер теперь не на весь экран */
    .event-modal-content {
        width: 90%;          /* Оставляем отступы по бокам */
        height: auto;        /* Высота зависит от контента */
        max-height: 85vh;    /* Но не более 85% высоты экрана */
        border-radius: 25px; /* Возвращаем скругления */
        overflow: hidden;    /* Прячем лишнее */
        display: flex;
        flex-direction: column;
    }

    .event-flex-layout {
        flex-direction: column;
        height: auto;
        overflow-y: auto;    /* Прокрутка внутри, если текста много */
    }

    /* Уменьшаем высоту картинки */
    .event-image-side {
        flex: none;
        height: 30vh;        /* Уменьшили с 40vh до 25vh */
        min-height: 180px;
        order: 1;
    }

    /* Текстовый блок */
    .event-info-side {
        flex: none;
        padding: 20px;       /* Уменьшили внутренние отступы */
        order: 2;
        background: #111;
        margin-top: -20px;   /* Легкий нахлест */
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        position: relative;
        z-index: 2;
    }

    .event-info-side h3 {
        font-size: 20px;     /* Уменьшили заголовок */
        margin-bottom: 10px;
    }

    .event-info-side p {
        font-size: 14px;     /* Уменьшили шрифт текста */
        margin-bottom: 20px;
    }

    /* Компактный блок футера */
    .event-details-footer {
        flex-direction: row; /* Возвращаем в ряд для экономии места */
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        background: rgba(255, 255, 255, 0.03);
        padding: 12px 15px;
        border-radius: 15px;
    }

    .event-location-block {
        text-align: left;    /* Выравнивание по левому краю */
    }

    .loc-label {
        font-size: 10px;
    }

    .loc-value {
        font-size: 12px;
    }

    /* Маленькая аккуратная кнопка */
    .btn-copy {
        width: auto;
        padding: 8px 15px;
        font-size: 12px;
    }

    /* Кнопка закрытия */
    .close-event {
        top: 10px;
        right: 10px;
        width: 36px;         /* Уменьшили размер кнопки закрытия */
        height: 36px;
        font-size: 20px;
    }
}