/* Сброс стилей для календаря */
.velo-calendar * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.velo-calendar {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    position: relative;
    z-index: 1000;
}

.calendar-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: visible;
}

.header {
    background: linear-gradient(135deg, #2a3ad1, #ee5a24);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 0;
}

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.calendar-filter-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.calendar-filter-btn:hover, .calendar-filter-btn.active {
    background: white;
    color: #ee5a24;
}

.legend-content {
    padding: 30px;
}

.calendar-season-section {
    margin-bottom: 30px;
}

.season-title {
    font-size: 1.4em;
    color: #2d3436;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f2f6;
    display: flex;
    align-items: center;
}

.season-title::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 10px;
}

.spring::before { background: #00b894; }
.summer::before { background: #fdcb6e; }
.autumn::before { background: #e17055; }
.winter::before { background: #74b9ff; }

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 10px;
}

.calendar-event-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: all 0.3s ease;
    border-left: 4px solid;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.calendar-event-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}

.event-date {
    min-width: 80px;
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 8px;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.event-day {
    font-size: 1.5em;
    font-weight: bold;
    display: block;
}

.event-month {
    font-size: 0.9em;
    color: #636e72;
    text-transform: uppercase;
}

.event-info h3 {
    font-size: 1.1em;
    color: #2d3436;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.event-info p {
    font-size: 0.9em;
    color: #636e72;
    margin-bottom: 0;
}

.event-description {
    margin-top: 8px;
    font-style: italic;
    color: #7f8c8d;
}

.event-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
    color: white;
}

/* Цвета типов мероприятий по умолчанию */
.training { border-color: #0984e3; background: linear-gradient(135deg, #74b9ff20, #0984e320); }
.training .event-type { background: #0984e3; }

.zachetka { border-color: #e84393; background: linear-gradient(135deg, #fd79a820, #e8439320); }
.zachetka .event-type { background: #e84393; }

.race { border-color: #00b894; background: linear-gradient(135deg, #55efc420, #00b89420); }
.race .event-type { background: #00b894; }

.pvd { border-color: #fdcb6e; background: linear-gradient(135deg, #ffeaa720, #fdcb6e20); }
.pvd .event-type { background: #fdcb6e; color: #333; }

.coffeeoutside { border-color: #6c5ce7; background: linear-gradient(135deg, #a29bfe20, #6c5ce720); }
.coffeeoutside .event-type { background: #6c5ce7; }

.travel { border-color: #636e72; background: linear-gradient(135deg, #dfe6e920, #b2bec320); }
.travel .event-type { background: #636e72; }

.wine { border-color: #8e44ad; background: linear-gradient(135deg, #d7bde220, #8e44ad20); }
.wine .event-type { background: #8e44ad; }

.running { border-color: #e74c3c; background: linear-gradient(135deg, #ff797920, #e74c3c20); }
.running .event-type { background: #e74c3c; }

.footer {
    text-align: center;
    padding: 20px;
    color: #636e72;
    font-size: 0.9em;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 20px 20px;
}

.highlight {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
}

.highlight h3 {
    color: #e84393;
    margin-bottom: 10px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #636e72;
}

.add-to-calendar {
    display: block;
    width: 100%;
    padding: 12px;
    background: #0984e3;
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.add-to-calendar:hover {
    background: #0767b3;
}

@media (max-width: 768px) {
    .legend-content {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .events-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-event-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .event-date {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .event-info h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Анимация появления */
.calendar-event-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Задержки для анимации */
.calendar-event-item:nth-child(1) { animation-delay: 0.1s; }
.calendar-event-item:nth-child(2) { animation-delay: 0.2s; }
.calendar-event-item:nth-child(3) { animation-delay: 0.3s; }
.calendar-event-item:nth-child(4) { animation-delay: 0.4s; }
.calendar-event-item:nth-child(5) { animation-delay: 0.5s; }

.hashtag {
    color: #0984e3;
    font-weight: 500;
}

.dashicons-star-filled {
    font-size: 16px;
}