/* Styles pour l'affichage frontend de l'agenda */

.agenda-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Arial', sans-serif;
    background: #f5f5f5;
}



.agenda-content {
    display: flex;
    background: #fff;
    min-height: 500px;
}

.agenda-main {
    flex: 1;
    padding: 0;
    background: #f8f8f8;
}

.agenda-month-year {
    background: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.month-year-container {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.month-name {
    font-size: 24px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.year-number {
    font-size: 18px;
    color: #bdc3c7;
}

/* Boutons de navigation */
.nav-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.agenda-events {
    padding: 0;
}

.no-events {
    padding: 40px;
    text-align: center;
    color: #666;
}

.event-item {
    display: flex;
    align-items: center;
    margin: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: relative;
    min-height: 120px;
}

/* Couleurs des événements selon le jour */
.event-item.orange {
    border-left: 8px solid #f39c12;
}

.event-item.purple {
    border-left: 8px solid #9b59b6;
}

.event-item.blue {
    border-left: 8px solid #3498db;
}

.event-item.cyan {
    border-left: 8px solid #00bcd4;
}

.event-item.green {
    border-left: 8px solid #27ae60;
}

.event-item.red {
    border-left: 8px solid #e74c3c;
}

.event-item.gray {
    border-left: 8px solid #95a5a6;
}

.event-item.pink {
    border-left: 8px solid #e91e63;
}

.event-item.yellow {
    border-left: 8px solid #f1c40f;
}

.event-item.brown {
    border-left: 8px solid #8d6e63;
}

.event-item.indigo {
    border-left: 8px solid #3f51b5;
}

.event-item.teal {
    border-left: 8px solid #009688;
}

.event-item.lime {
    border-left: 8px solid #8bc34a;
}

.event-item.coral {
    border-left: 8px solid #ff7043;
}

.event-date {
    width: 120px;
    text-align: center;
    padding: 20px;
    position: relative;
}

.event-item.orange .event-date {
    background: #f39c12;
    color: white;
}

.event-item.purple .event-date {
    background: #9b59b6;
    color: white;
}

.event-item.blue .event-date {
    background: #3498db;
    color: white;
}

.event-item.cyan .event-date {
    background: #00bcd4;
    color: white;
}

.event-item.green .event-date {
    background: #27ae60;
    color: white;
}

.event-item.red .event-date {
    background: #e74c3c;
    color: white;
}

.event-item.gray .event-date {
    background: #95a5a6;
    color: white;
}

.event-item.pink .event-date {
    background: #e91e63;
    color: white;
}

.event-item.yellow .event-date {
    background: #f1c40f;
    color: black;
}

.event-item.brown .event-date {
    background: #8d6e63;
    color: white;
}

.event-item.indigo .event-date {
    background: #3f51b5;
    color: white;
}

.event-item.teal .event-date {
    background: #009688;
    color: white;
}

.event-item.lime .event-date {
    background: #8bc34a;
    color: white;
}

.event-item.coral .event-date {
    background: #ff7043;
    color: white;
}

.event-day-number {
    font-size: 36px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.event-month {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    opacity: 0.8;
}

.event-day-name {
    font-size: 10px;
    font-weight: bold;
    opacity: 0.8;
}

.event-details {
    flex: 1;
    padding: 20px 30px;
}

.event-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 10px 0;
    text-transform: uppercase;
}

.event-time {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.event-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}



.event-status {
    padding: 20px;
    display: flex;
    align-items: center;
}

/* Status buttons */
.status-btn {
    padding: 4px 8px;
    border: none;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.status-btn.ended {
    background-color: #636e72;
    color: white;
    cursor: default;
}

.status-btn.holiday {
    background-color: #e17055;
    color: white;
    cursor: default;
}

/* Holiday events styling - Inactive/Grey appearance */
.event-item.holiday {
    border-left: 4px solid #999;
    background: linear-gradient(135deg, rgba(153, 153, 153, 0.1), rgba(153, 153, 153, 0.05));
    opacity: 0.6;
    filter: grayscale(50%);
    position: relative;
    overflow: hidden;
}

/* Ribbon gris avec texte vertical au coin supérieur droit */
.event-item.holiday::after {
    content: 'INDISPONIBLE';
    position: absolute;
    top: 17px;
    right: -26px;
    width: 100px;
    height: 20px;
    background-color: #999;
    color: white;
    font-size: 9px;
    font-weight: bold;
    text-align: center;
    line-height: 20px;
    transform: rotate(45deg);
    transform-origin: center;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-item.holiday .event-title {
    color: #666;
}

.event-item.holiday .event-time,
.event-item.holiday .event-address {
    color: #888;
}

.event-item.holiday .event-date {
    background-color: #999 !important;
}

.event-item.holiday .event-date .day {
    color: #fff;
}

.event-item.holiday .event-date .month,
.event-item.holiday .event-date .weekday {
    color: #ddd;
}

/* Sidebar avec mini calendrier */
.agenda-sidebar {
    width: 250px;
    background: #fff;
    border-left: 1px solid #ddd;
    padding: 20px;
}

.mini-calendar {
    background: #fff;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.calendar-table th {
    background: #f8f9fa;
    padding: 8px 4px;
    text-align: center;
    font-weight: bold;
    color: #666;
    border: 1px solid #dee2e6;
}

.calendar-table td {
    padding: 8px 4px;
    text-align: center;
    border: 1px solid #dee2e6;
    cursor: pointer;
    position: relative;
}

.calendar-table td:hover {
    background: #f8f9fa;
}

.calendar-table td.today {
    background: #007cba;
    color: white;
    font-weight: bold;
}

.calendar-table td.has-event {
    background: #fff3cd;
    font-weight: bold;
}

.calendar-table td.has-event.today {
    background: #007cba;
    color: white;
}

.calendar-table td.other-month {
    color: #ccc;
    background: #f8f9fa;
}

/* Loading state */
.agenda-content.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.agenda-content.loading::before {
    content: "Chargement...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-weight: bold;
    color: #333;
}

.agenda-content.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 #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.nav-btn.loading-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn.loading-disabled:hover {
    background-color: inherit;
    transform: none;
}

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

/* Event hover effects */
.event-item.hovered {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.event-item.expanded {
    background: #f8f9fa;
    border-left-width: 6px;
}

/* Styles spécifiques pour la vue hebdomadaire */
.agenda-weekly .agenda-week-year {
    background: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agenda-weekly .week-year-container {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.agenda-weekly .week-title {
    font-size: 24px;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.agenda-weekly .week-dates {
    font-size: 16px;
    color: #bdc3c7;
}

.agenda-weekly .weekly-events {
    padding: 0;
}

.agenda-weekly .day-separator {
    background: #34495e;
    color: white;
    padding: 15px 20px;
    margin: 0;
    border-bottom: 2px solid #2c3e50;
}

.agenda-weekly .day-separator h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
	color: #fff;
}

.agenda-weekly .event-item {
    border-left: none;
    border-bottom: 1px solid #eee;
    margin-left: 20px;
}

.agenda-weekly .event-date {
    width: 100px;
}

.agenda-weekly .event-date .day {
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 5px;
}

.agenda-weekly .event-date .month {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
    opacity: 0.8;
}

.agenda-weekly .event-date .weekday {
    font-size: 9px;
    font-weight: bold;
    opacity: 0.8;
}

.agenda-weekly .week-info {
    background: #ecf0f1;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.agenda-weekly .week-info h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
}

.agenda-weekly .week-info p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

.agenda-weekly .week-navigation {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-weekly .week-nav-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.agenda-weekly .week-nav-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.agenda-weekly .week-nav-btn[data-action="current"] {
    background: #27ae60;
}

.agenda-weekly .week-nav-btn[data-action="current"]:hover {
    background: #229954;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .agenda-content {
        flex-direction: column;
    }
    
    .agenda-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        padding: 15px;
    }
    
    .event-item {
        flex-direction: row;
        align-items: center;
        min-height: 80px;
        margin-bottom: 8px;
        border-radius: 8px;
    }
    
    .event-date {
        width: 70px;
        min-width: 70px;
        padding: 10px;
    }
    
    .event-day-number {
        font-size: 20px;
    }
    
    .event-details {
        padding: 10px 15px;
        flex: 1;
    }
    
    .event-title {
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .event-time {
        font-size: 13px;
    }
    
    .event-address {
        font-size: 12px;
        margin-top: 2px;
    }
    
    .event-status {
        padding: 10px;
        justify-content: center;
    }
    
    .status-btn {
        padding: 3px 7px;
        font-size: 9px;
        border-radius: 10px;
    }
    
    .month-year-container {
        flex-direction: column;
        align-items: center;
    }
    
    .month-name {
        font-size: 28px;
        margin-bottom: 5px;
    }
    
    .year-number {
        font-size: 24px;
        color: #bdc3c7;
    }
    
    /* Ajustements pour tablette */
    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    /* Styles mobiles spécifiques pour la vue hebdomadaire */
    .agenda-weekly .agenda-week-year {
        padding: 15px;
    }
    
    .agenda-weekly .week-title {
        font-size: 20px;
    }
    
    .agenda-weekly .week-dates {
        font-size: 16px;
    }
    
    .agenda-weekly .day-separator {
        padding: 12px 15px;
    }
    
    .agenda-weekly .day-separator h3 {
        font-size: 16px;
    }
    
    .agenda-weekly .event-item {
        margin-left: 10px;
    }
    
    .agenda-weekly .event-date {
        width: 80px;
        padding: 12px;
    }
    
    .agenda-weekly .event-date .day {
        font-size: 24px;
    }
    
    .agenda-weekly .event-date .month,
    .agenda-weekly .event-date .weekday {
        font-size: 12px;
    }
    
    .agenda-weekly .week-navigation {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .agenda-weekly .week-nav-btn {
        flex: 1;
        min-width: 120px;
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Mobile - Smartphone */
@media (max-width: 480px) {
    .agenda-container {
        margin: 0;
        padding: 0;
    }
    
    .agenda-header {
        padding: 8px 10px;
    }
    
    .agenda-month-year {
        padding: 10px 15px;
        position: relative;
    }
    
    .month-year-container {
        flex-direction: column;
        align-items: center;
    }
    
    .month-name {
        font-size: 18px;
        margin-bottom: 3px;
    }
    
    .year-number {
        font-size: 16px;
        color: #bdc3c7;
    }
    
    /* Événements ultra-compacts sur mobile */
    .event-item {
        min-height: 60px;
        margin-bottom: 6px;
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .event-date {
        width: 50px;
        min-width: 50px;
        padding: 8px 6px;
    }
    
    .event-day-number {
        font-size: 16px;
    }
    
    .event-month, .event-weekday {
        font-size: 9px;
    }
    
    .event-details {
        padding: 8px 10px;
        flex: 1;
    }
    
    .event-title {
        font-size: 14px !important;
        margin-bottom: 2px;
        line-height: 1.2;
    }
    
    .event-time {
        font-size: 11px;
        margin-bottom: 1px;
    }
    
    .event-address {
        font-size: 10px;
        margin-top: 1px;
        opacity: 0.8;
    }
    
    .event-status {
        padding: 5px;
        justify-content: center;
    }
    
    .status-btn {
        padding: 2px 6px;
        font-size: 8px;
        border-radius: 8px;
        font-weight: 500;
    }
    
    /* Ajustements pour smartphone */
    .nav-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    /* Ribbon plus petit sur mobile */
    .event-item.holiday::after {
        width: 100px;
        height: 16px;
        font-size: 8px;
        line-height: 16px;
        top: 17px;
        right: -26px;
    }
    
    /* Sidebar plus compacte */
    .agenda-sidebar {
        padding: 10px;
    }
    
    .calendar-table th,
    .calendar-table td {
        padding: 4px 2px;
        font-size: 10px;
    }
    
    .calendar-table {
        font-size: 10px;
    }
    
    /* Masquer certains éléments non essentiels sur mobile */
    .agenda-sidebar .calendar-table {
        display: none;
    }
}

/* Animation pour les événements */
.event-item {
    opacity: 0;
    transform: translateY(20px);
    animation: slideInEvent 0.5s ease forwards;
}

.event-item:nth-child(1) { animation-delay: 0.1s; }
.event-item:nth-child(2) { animation-delay: 0.2s; }
.event-item:nth-child(3) { animation-delay: 0.3s; }
.event-item:nth-child(4) { animation-delay: 0.4s; }
.event-item:nth-child(5) { animation-delay: 0.5s; }

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

/* Hover effects */
.event-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.event-item:hover .event-title {
    color: #3498db;
}

/* Styles pour le filtre par événement */
.event-filter-container {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 20px;
    margin: 0;
}

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

.filter-header label {
    font-weight: bold;
    color: #2c3e50;
    font-size: 16px;
    margin: 0;
}

.filter-reset-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-reset-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.event-filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    color: #495057;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.event-filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.events-count {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.visible-count {
    font-weight: bold;
    color: #3498db;
}

.total-count {
    font-weight: bold;
    color: #2c3e50;
}

.no-events-filtered {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    border-radius: 6px;
}

.no-events-filtered p {
    margin: 0;
    font-weight: 500;
}

/* Animation pour le filtre */
.event-filter-container {
    opacity: 0;
    transform: translateY(-10px);
    animation: slideInFilter 0.4s ease forwards;
}

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

/* Responsive pour le filtre */
@media screen and (max-width: 768px) {
    .event-filter-container {
        padding: 15px;
    }
    
    .filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .filter-header label {
        font-size: 14px;
    }
    
    .filter-reset-btn {
        padding: 6px 12px;
        font-size: 12px;
        align-self: flex-end;
    }
    
    .event-filter-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .events-count {
        font-size: 12px;
    }
}