/* Base styles */
body {
    font-family: 'Josefin Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.calendar-header h1 {
    font-size: 2rem;
    margin: 0 20px;
    color: #003366;
    text-align: center;
    min-width: 200px;
}

.calendar-header button {
    background: #003366;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.calendar-header button:hover {
    background: #E65A2B;
}

.calendar-header button i {
    font-size: 1rem;
}

.wall-calendar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.day-names {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    color: #003366;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day-cell {
    min-height: 100px;
    border: 1px solid #ddd;
    padding: 5px;
    position: relative;
    background-color: white;
    transition: all 0.3s ease;
}

.day-cell:hover {
    background-color: #f0f8ff;
}

.day-number {
    font-weight: bold;
    margin-bottom: 5px;
    color: #003366;
}

.day-cell.other-month .day-number {
    color: #aaa;
}

.day-cell.today {
    background-color: #f4dc96;
}

.day-cell.today .day-number {
    font-weight: bold;
    color: #003366;
}

.event-indicator {
    background-color: #E65A2B;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 3px;
    margin: 2px 0;
    cursor: pointer;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    /* Ограничение до 2 строк */
    line-height: 1.3;
    word-break: break-word;
    max-height: 2.6em;
}

.event-indicator:hover {
    background-color: #d0451b;
}

.calendar-notes {
    margin-top: 30px;
    background: rgba(249, 249, 249, 0.95);
    padding: 20px;
    border-radius: 8px;
}

.calendar-notes h3 {
    color: #003366;
    margin-top: 0;
    border-bottom: 2px solid #003366;
    padding-bottom: 10px;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upcoming-event {
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.upcoming-event:hover {
    transform: translateY(-3px);
}

.upcoming-event h4 {
    margin: 0 0 5px 0;
    color: #003366;
    white-space: normal;
    word-break: break-word;
}

.upcoming-event p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}

.upcoming-event .event-date {
    font-weight: bold;
    color: #E65A2B;
}

/* Event Modal */
.event-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow: auto;
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.98);
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #003366;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    color: #003366;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #E65A2B;
}

.modal-content h2 {
    color: #003366;
    margin-top: 0;
}

.event-details {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-details p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
}

.event-details i {
    color: #E65A2B;
    width: 20px;
    text-align: center;
}

.event-description {
    margin: 20px 0;
    line-height: 1.6;
}

.event-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 5px;
    margin-top: 20px;
}


.calendar-hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0.7;
}

.calendar-container {
    position: relative;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 30px;
    margin: 40px auto;
    max-width: 1200px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    white-space: pre-line;
    /* Это позволит переносить текст по \n */
    word-break: break-word;
    /* Перенос длинных слов */
}

.event-description {
    white-space: pre-line;
    /* Учитывает переносы строк в тексте */
    word-break: break-word;
    /* Переносит длинные слова */
    overflow-wrap: break-word;
    /* Альтернатива для word-break */
}

.event-indicator {
    white-space: normal;
    /* Разрешает перенос строк */
    word-break: break-word;
    /* Переносит длинные слова */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    /* Ограничивает количество строк */
    -webkit-box-orient: vertical;
}


/* Responsive styles */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .calendar-header h1 {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
    }

    .day-cell {
        min-height: 60px;
    }

    .event-indicator {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .calendar-container {
        margin: 20px;
        padding: 15px;
    }

    .hero-background {
        opacity: 0.5;
    }
}

@media (max-width: 480px) {
    .day-names div {
        font-size: 0.8rem;
    }

    .day-number {
        font-size: 0.8rem;
    }

    .event-indicator {
        display: none;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}