/* ===== EVENTOS - ESTILOS DEL CALENDARIO ===== */

/* Hero Section */
.events-hero {
    background: linear-gradient(135deg, #a386b1 0%, #90d4bd 50%, #a386b1 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
    color: white;
    text-align: center;
    padding: 4rem 1rem 2rem;
    position: relative;
    overflow: hidden;
}

.events-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.events-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.events-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Quicksand', sans-serif;
}

.events-hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Quicksand', sans-serif;
}

@keyframes gradientShift {
    0%, 100% { 
        background-position: 0% 50%; 
    }
    50% { 
        background-position: 100% 50%; 
    }
}

/* Contenedor del Calendario */
.calendar-container {
    max-width: 1500px;
    margin-left: 10%;
    padding: 3rem 1rem;
    background: #f8f9fa;
}

/* Header del Calendario */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-nav button {
    background: #a386b1;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav button:hover {
    background: #90d4bd;
    transform: scale(1.1);
}

.current-month {
    font-size: 1.8rem;
    font-weight: 700;
    color: #a386b1;
    font-family: 'Quicksand', sans-serif;
}

.view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.view-toggle button {
    background: none;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
}

.view-toggle button.active {
    background: #a386b1;
    color: white;
}

/* Grid del Calendario */
.calendar-grid {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #a386b1;
    color: white;
}

.weekday {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

/* Días del Calendario */
.calendar-day {
    background: white;
    min-height: 120px;
    max-height: 120px;
    padding: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    background: #f8f9fa;
    border-color: #a386b1;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #999;
}

.calendar-day.today {
    background: linear-gradient(135deg, #a386b1, #90d4bd);
    color: white;
}

.calendar-day.has-events {
    border-left: 4px solid #90d4bd;
}

.day-number {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-family: 'Quicksand', sans-serif;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    overflow: hidden;
    max-height: calc(100% - 2rem);
}

/* Eventos en el Calendario */
.event-item {
    background: linear-gradient(135deg, #a386b1, #90d4bd);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Quicksand', sans-serif;
    line-height: 1.2;
    min-height: 1.2rem;
    max-height: 1.2rem;
    flex-shrink: 0;
    position: relative;
}

/* Evento con texto largo - permite dos líneas */
.event-item.multiline {
    white-space: normal;
    min-height: 2rem;
    max-height: 2rem;
    line-height: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Limitación cuando hay muchos eventos */
.day-events.many-events .event-item {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    min-height: 1rem;
    max-height: 1rem;
}

/* Indicador de más eventos */
.event-item.more-events {
    background: #6c757d;
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}

.event-item:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.event-item.training {
    background: linear-gradient(135deg, #17a2b8, #20c997);
}

.event-item.competition {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.event-item.meeting {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

/* ===== MODAL DE EVENTOS ===== */

.event-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.event-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    font-family: 'Quicksand', sans-serif;
}

.modal-close:hover {
    color: #a386b1;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #a386b1;
    margin-bottom: 1rem;
    font-family: 'Quicksand', sans-serif;
    padding-right: 2rem;
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.event-detail {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border-left: 4px solid #a386b1;
}

.event-detail svg {
    color: #a386b1;
    flex-shrink: 0;
}

.event-detail-text {
    font-family: 'Quicksand', sans-serif;
    line-height: 1.5;
}

.event-detail-text strong {
    color: #a386b1;
}

/* Estilos para el modal de eventos del día */
.day-events-list {
    padding: 1rem 0;
}

.day-event-item {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.day-event-item:hover {
    border-color: #a386b1;
    box-shadow: 0 2px 8px rgba(163, 134, 177, 0.15);
    transform: translateY(-1px);
}

.day-event-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.event-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.event-indicator.training {
    background: linear-gradient(135deg, #17a2b8, #20c997);
}

.event-indicator.competition {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
}

.event-indicator.meeting {
    background: linear-gradient(135deg, #6f42c1, #e83e8c);
}

.day-event-time {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.day-event-location {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* ===== LISTA DE PRÓXIMOS EVENTOS ===== */

.upcoming-events {
    margin-top: 3rem;
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.upcoming-events h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #a386b1;
    margin-bottom: 1.5rem;
    font-family: 'Quicksand', sans-serif;
}

.upcoming-event {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #90d4bd;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upcoming-event:hover {
    background: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.upcoming-event-date {
    background: linear-gradient(135deg, #a386b1, #90d4bd);
    color: white;
    padding: 0.5rem 0rem;
    border-radius: 0.5rem;
    text-align: center;
    min-width: 80px;
    font-weight: 600;
    font-family: 'Quicksand', sans-serif;
}

.upcoming-event-info {
    flex: 1;
}

.upcoming-event-info h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #333;
    font-family: 'Quicksand', sans-serif;
}

.upcoming-event-info p {
    color: #666;
    font-size: 0.9rem;
    font-family: 'Quicksand', sans-serif;
}

/* ===== VISTA DE LISTA ===== */

.list-view {
    display: none;
}

.list-view.active {
    display: block;
}

.calendar-grid.hidden {
    display: none;
}

.events-list {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.events-list-item {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.3s ease;
}

.events-list-item:last-child {
    border-bottom: none;
}

.events-list-item:hover {
    background: #f8f9fa;
}

.events-list-date {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a386b1;
    margin-bottom: 0.5rem;
    font-family: 'Quicksand', sans-serif;
}

.events-list-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1200px) {
    .calendar-day {
        min-height: 100px;
        max-height: 100px;
    }
    
    .event-item {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .event-item.multiline {
        min-height: 1.8rem;
        max-height: 1.8rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 768px) {
    .calendar-container {
        margin-left: auto;
        margin-right: auto;
    }

    .events-hero h1 {
        font-size: 2rem;
    }

    .events-hero p {
        font-size: 1rem;
    }

    .calendar-header {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        padding: 0.8rem 1rem;
    }

    .calendar-nav {
        gap: 0.8rem;
    }

    .calendar-nav button {
        padding: 0.6rem;
        width: 40px;
        height: 40px;
    }

    /* Ocultar botones de cambio de vista en móvil */
    .view-toggle {
        display: none !important;
    }

    .current-month {
        font-size: 1.3rem;
        margin: 0;
        text-align: center;
    }

    .calendar-day {
        min-height: 80px;
        max-height: 80px;
        padding: 0.5rem;
    }

    .day-number {
        font-size: 1rem;
    }

    .event-item {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
        min-height: 0.9rem;
        max-height: 0.9rem;
    }
    
    .event-item.multiline {
        min-height: 1.5rem;
        max-height: 1.5rem;
        font-size: 0.6rem;
        line-height: 0.9;
    }
    
    .day-events.many-events .event-item {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
        min-height: 0.8rem;
        max-height: 0.8rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }

    .upcoming-events {
        padding: 1.5rem;
    }

    .upcoming-event {
        padding: 0.8rem;
    }
    
    .day-event-item {
        padding: 0.8rem;
    }
    
    .day-event-title {
        font-size: 0.9rem;
    }

    .calendar-container {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .calendar-container {
        margin-left: auto;
        margin-right: auto;
    }

    .events-hero {
        padding: 4rem 1rem 1.5rem;
    }

    .events-hero h1 {
        font-size: 1.6rem;
    }

    .calendar-container {
        padding: 1.5rem 1rem;
    }

    .calendar-header {
        padding: 0.6rem;
        gap: 0.4rem;
    }

    .calendar-nav {
        gap: 0.6rem;
    }

    .calendar-nav button {
        padding: 0.5rem;
        width: 36px;
        height: 36px;
    }

    .current-month {
        font-size: 1.1rem;
    }

    .weekday {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .calendar-day {
        min-height: 60px;
        max-height: 60px;
        padding: 0.3rem;
    }
    
    .event-item {
        font-size: 0.6rem;
        padding: 0.1rem 0.25rem;
        min-height: 0.7rem;
        max-height: 0.7rem;
    }
    
    .event-item.multiline {
        min-height: 1.2rem;
        max-height: 1.2rem;
        font-size: 0.55rem;
        line-height: 0.8;
    }

    .upcoming-event {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .upcoming-event-date {
        min-width: auto;
        width: 100%;
    }

    .modal-content {
        padding: 1rem;
        margin: 0.5rem;
    }

    .event-detail {
        padding: 0.6rem;
        gap: 0.6rem;
    }

    .calendar-nav {
        gap: 0.5rem;
    }

    /* Ocultar botones de cambio de vista en móvil pequeño también */
    .view-toggle {
        display: none !important;
    }
    
    .day-event-item {
        padding: 0.6rem;
    }
    
    .day-event-title {
        font-size: 0.85rem;
    }
}