/* Frontend Styles for Konvivio Events */

/* ================================
   FILTRES
   ================================ */
.konvivio-events-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.konvivio-filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #333;
}

.konvivio-filter-btn:hover {
    border-color: var(--category-color, #2271b1);
    color: var(--category-color, #2271b1);
    transform: translateY(-2px);
}

.konvivio-filter-btn.active {
    background: var(--category-color, #2271b1);
    border-color: var(--category-color, #2271b1);
    color: white;
}

/* ================================
   VUE CARROUSEL (7 JOURS)
   ================================ */
.konvivio-events-carousel-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.konvivio-events-carousel {
    padding: 0 50px;
}

.konvivio-events-carousel .swiper-slide {
    height: auto;
}

.konvivio-event-item {
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.konvivio-event-item.has-shadow {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.konvivio-event-item.has-shadow:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.konvivio-event-item.hidden {
    display: none;
}

.event-image {
    position: relative;
    background-position: center;
    background-color: #f0f0f0;
    width: 100%;
}

/* Ratios d'image */
.konvivio-events-carousel.ratio-landscape .event-image {
    padding-top: 75%; /* Ratio 4:3 */
}

.konvivio-events-carousel.ratio-square .event-image {
    padding-top: 100%; /* Ratio 1:1 */
}

.konvivio-events-carousel.ratio-portrait .event-image {
    padding-top: 133.33%; /* Ratio 3:4 */
}

/* Ajustement de l'image */
.konvivio-events-carousel.fit-contain .event-image {
    background-size: contain;
    background-repeat: no-repeat;
}

.konvivio-events-carousel.fit-cover .event-image {
    background-size: cover;
    background-repeat: no-repeat;
}

/* Navigation Swiper */
.konvivio-events-carousel .swiper-button-next,
.konvivio-events-carousel .swiper-button-prev {
    color: #2271b1;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.konvivio-events-carousel .swiper-button-next:after,
.konvivio-events-carousel .swiper-button-prev:after {
    font-size: 20px;
    font-weight: bold;
}

.konvivio-events-carousel .swiper-button-next:hover,
.konvivio-events-carousel .swiper-button-prev:hover {
    background: #2271b1;
    color: white;
    transform: scale(1.1);
}

.konvivio-events-carousel .swiper-button-prev {
    left: 0;
}

.konvivio-events-carousel .swiper-button-next {
    right: 0;
}

/* Pagination Swiper */
.konvivio-events-carousel .swiper-pagination {
    bottom: -30px;
}

.konvivio-events-carousel .swiper-pagination-bullet {
    background: #2271b1;
    opacity: 0.3;
    width: 10px;
    height: 10px;
    transition: all 0.3s ease;
}

.konvivio-events-carousel .swiper-pagination-bullet-active {
    opacity: 1;
    width: 30px;
    border-radius: 5px;
}

.event-categories {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    z-index: 2;
}

.event-category {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.event-info {
    padding: 15px;
}

.event-weekday {
    display: block;
    /* Les styles sont gérés par Elementor */
}

.event-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.event-date {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.event-date.has-icon::before {
    content: "📅";
    font-size: 16px;
}

/* Message si aucun événement */
.konvivio-no-events {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ================================
   VUE CALENDRIER
   ================================ */
.konvivio-events-calendar {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.konvivio-events-calendar.has-shadow {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.calendar-month {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    text-transform: capitalize;
}

.calendar-nav {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.weekday {
    padding: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
}

.calendar-day {
    background: white;
    min-height: 100px;
    padding: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-day.empty {
    background: #f8f9fa;
}

.calendar-day.today {
    background: #fff9e6;
}

.calendar-day.today .day-number {
    background: #ffc107;
    color: white;
}

.calendar-day:not(.empty):hover {
    background: #f0f7ff;
    cursor: pointer;
}

.day-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

.day-event {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 11px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.day-event.hidden {
    display: none;
}

.day-event:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    display: inline-block;
    flex-shrink: 0;
}

.event-title-mini {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* ================================
   LIGHTBOX
   ================================ */
.konvivio-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 2;
    animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.lightbox-close:hover {
    background: #f44336;
    color: white;
    transform: rotate(90deg);
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 1200px) {
    .konvivio-events-grid[data-columns="5"] {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .konvivio-events-grid[data-columns="4"],
    .konvivio-events-grid[data-columns="5"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .konvivio-events-grid[data-columns="3"],
    .konvivio-events-grid[data-columns="4"],
    .konvivio-events-grid[data-columns="5"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .calendar-month {
        font-size: 18px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 5px;
    }
    
    .weekday {
        padding: 10px 5px;
        font-size: 12px;
    }
    
    .day-event {
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .konvivio-events-grid {
        grid-template-columns: 1fr !important;
    }
    
    .calendar-day {
        min-height: 60px;
    }
    
    .day-number {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
    }
    
    .konvivio-events-filters {
        padding: 15px;
    }
    
    .konvivio-filter-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* ================================
   BOUTON DE RÉSERVATION
   ================================ */
.event-booking-button {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 24px;
    background: #2271b1;
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    width: 100%;
}

.event-booking-button:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

/* ================================
   POPUP ÉVÉNEMENT (Calendrier)
   ================================ */
.konvivio-event-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    width: 90%;
    max-width: 400px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.konvivio-event-popup::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.popup-content {
    position: relative;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.popup-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #f0f0f0;
    position: relative;
}

.popup-details {
    padding: 25px 20px;
    text-align: center;
}

.popup-weekday {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-align: center;
}

.popup-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: #E91E63;
    line-height: 1.2;
    text-align: center;
}

.popup-datetime {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.popup-datetime::before {
    content: "📅";
    font-size: 16px;
}

.popup-booking-button {
    display: inline-block;
    width: 100%;
    padding: 16px 24px;
    background: #1976D2;
    color: white !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 5px;
    border: none;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.popup-booking-button:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.4);
}

/* Responsive Popup */
@media (max-width: 768px) {
    .konvivio-event-popup {
        max-width: 95%;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .popup-details {
        padding: 20px 15px;
    }
}
