/* Cantine Pop Calendar Widget Styles */

.cantine-pop-calendar-widget {
    max-width: 100%;
    margin: 0 auto;
}

.cantine-month-header {
    background-color: #007cba;
    color: #ffffff;
    padding: 15px 20px;
    margin: 20px 0 10px 0;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    text-align: left;
}

.cantine-event-item {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.cantine-event-item:hover {
    transform: translateY(-2px);
}

.cantine-event-header {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
}

.cantine-event-header:hover {
    /* Styles de base - peuvent être surchargés par Elementor */
    background: linear-gradient(135deg, #ffffff 0%, #e9ecef 100%);
}

.cantine-event-date {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    color: #666666;
    margin-right: 15px;
    text-align: center;
    padding: 8px 12px;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}

.cantine-event-time {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    color: #007cba;
    margin-right: 15px;
    text-align: center;
    padding: 8px 12px;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #007cba;
    display: flex;
    align-items: center;
}

.cantine-event-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    line-height: 1.4;
    margin-right: 20px;
}

.cantine-event-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.cantine-toggle-icon {
    font-size: 18px;
    font-weight: bold;
    color: #007cba;
    transition: transform 0.3s ease;
    line-height: 1;
}

.cantine-event-item.active .cantine-toggle-icon {
    transform: rotate(45deg);
    color: #005a87;
}


.cantine-event-content {
    padding: 20px;
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    display: none;
}

/* Clearfix pour les images flottantes dans le contenu */
.cantine-event-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Styles pour les images alignées dans le contenu */
.cantine-event-content img.alignleft {
    float: left;
    margin: 0 15px 15px 0;
    max-width: 50%;
    height: auto;
}

.cantine-event-content img.alignright {
    float: right;
    margin: 0 0 15px 15px;
    max-width: 50%;
    height: auto;
}

.cantine-event-content img.aligncenter {
    display: block;
    margin: 15px auto;
    max-width: 100%;
    height: auto;
}

.cantine-event-description {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555555;
    font-size: 14px;
}

.cantine-event-venue {
    margin-bottom: 10px;
    padding: 8px 12px;
    background-color: #ffffff;
    border-radius: 4px;
    border-left: 4px solid #007cba;
    font-size: 14px;
}

.cantine-event-organizer {
    margin-bottom: 10px;
    padding: 8px 12px;
    background-color: #ffffff;
    border-radius: 4px;
    border-left: 4px solid #007cba;
    font-size: 14px;
}

.cantine-event-venue strong {
    color: #333333;
    margin-right: 8px;
    font-weight: 600;
}

.cantine-event-organizer strong {
    color: #333333;
    margin-right: 8px;
    font-weight: 600;
}

.cantine-event-link {
    margin-top: 15px;
    text-align: center;
}

.cantine-event-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007cba;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cantine-event-more:hover {
    background-color: #005a87;
    transform: translateY(-2px);
    color: #ffffff;
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cantine-month-header {
        padding: 12px 15px;
        font-size: 16px;
        margin: 15px 0 8px 0;
    }
    
    .cantine-event-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .cantine-event-date {
        flex: none;
        width: auto;
        margin-right: 10px;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .cantine-event-time {
        flex: none;
        width: auto;
        margin-right: 10px;
        margin-bottom: 10px;
        text-align: center;
    }
    
    .cantine-event-title {
        margin-right: 0;
        margin-bottom: 15px;
        font-size: 16px;
    }
    
    .cantine-event-toggle {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 20px;
        height: 20px;
    }
    
    .cantine-toggle-icon {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .cantine-month-header {
        padding: 10px 12px;
        font-size: 15px;
        margin: 12px 0 6px 0;
    }
    
    .cantine-event-item {
        margin-bottom: 10px;
        border-radius: 6px;
    }
    
    .cantine-event-header {
        padding: 12px;
    }
    
    .cantine-event-content {
        padding: 12px;
    }
    
    .cantine-event-date {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .cantine-event-title {
        font-size: 15px;
    }
    
    .cantine-event-toggle {
        width: 18px;
        height: 18px;
        top: 12px;
        right: 12px;
    }
    
    .cantine-toggle-icon {
        font-size: 14px;
    }
}

/* Les animations sont maintenant gérées entièrement par JavaScript pour plus de fluidité */

/* Style pour les événements sans contenu */
.cantine-event-item.no-content .cantine-event-toggle {
    display: none;
}

.cantine-event-item.no-content .cantine-event-header {
    cursor: default;
}

/* Style pour les événements en vedette */
.cantine-event-item.featured {
    border-left: 4px solid #ff6b35;
}

.cantine-event-item.featured .cantine-event-date {
    background-color: #ff6b35;
    color: #ffffff;
    border-color: #ff6b35;
}

/* Style pour les événements passés */
.cantine-event-item.past-event {
    opacity: 0.7;
}

.cantine-event-item.past-event .cantine-event-date {
    background-color: #6c757d;
    color: #ffffff;
    border-color: #6c757d;
}

/* Loading state */
.cantine-pop-calendar-widget.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cantine-pop-calendar-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mode tableau compact */
.cantine-pop-calendar-widget.cantine-table-mode {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-item {
    margin-bottom: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #e9ecef;
    box-shadow: none;
    background-color: transparent;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-item:last-child {
    border-bottom: none;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-item:hover {
    background-color: #ffffff;
    transform: none;
    box-shadow: none;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-header {
    border-bottom: none;
    border-radius: 0;
    background: #ffffff;
    padding: 12px 20px;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-header:hover {
    /* Styles de base pour le mode tableau - peuvent être surchargés par Elementor */
    background: #f8f9fa;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-content {
    border-top: 1px solid #e9ecef;
    border-radius: 0;
    /* background-color supprimé pour laisser Elementor contrôler */
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-month-header {
    margin: 0;
    border-radius: 0;
    border-bottom: 2px solid #005a87;
    background-color: #007cba;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-month-header:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Alternance de couleurs pour un effet tableau */
.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-item:nth-child(even) .cantine-event-header {
    background-color: #ffffff;
}

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-item:nth-child(even) .cantine-event-header:hover {
    background-color: #e9ecef;
}

/* Uniformisation du contenu pour toutes les lignes - contrôlé par Elementor */
/* .cantine-pop-calendar-widget.cantine-table-mode .cantine-event-content supprimé pour laisser Elementor contrôler */

.cantine-pop-calendar-widget.cantine-table-mode .cantine-event-item:nth-child(even) .cantine-event-content {
    /* background-color supprimé pour laisser Elementor contrôler */
}

/* Responsive pour le mode tableau */
@media (max-width: 768px) {
    .cantine-pop-calendar-widget.cantine-table-mode .cantine-event-header {
        padding: 10px 15px;
    }
    
    .cantine-pop-calendar-widget.cantine-table-mode .cantine-event-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .cantine-pop-calendar-widget.cantine-table-mode .cantine-event-header {
        padding: 8px 12px;
    }
    
    .cantine-pop-calendar-widget.cantine-table-mode .cantine-event-content {
        padding: 12px;
    }
}
