/* =============================================
   COLIBRI CUSTOM CALENDAR (100% Sur-Mesure)
   ============================================= */

:root {
    --cal-bg: #f9f4ef;
    --cal-primary: var(--colibri-green, #6aaf6a);
    --cal-secondary: #c97c5d;
    --cal-text: #4a5c54;
}

.colibri-calendar-wrapper {
    margin: 40px 0;
    font-family: 'Poppins', Calibri, sans-serif;
    position: relative;
}

/* ── Slider Controls ── */
.colibri-slider-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
    gap: 12px;
}

.colibri-slider-btn {
    background: var(--cal-primary);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(45, 74, 62, 0.2);
}

.colibri-slider-btn:hover {
    background: var(--cal-secondary);
    transform: scale(1.05);
}

.colibri-slider-btn:disabled {
    background: #e0e0e0;
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.colibri-slider-btn i {
    font-size: 24px;
}

/* ── Grid des Mois (Slider View) ── */
.colibri-calendar-container {
    overflow-x: hidden; /* Hidden to hide the scrollbar, handled by JS */
    scroll-behavior: smooth;
    padding-bottom: 20px;
}

.colibri-calendar-grid {
    display: flex;
    gap: 24px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ── Colonne d'un Mois ── */
.colibri-month-col {
    /* Show 3 items per view on desktop: width = 100% / 3 minus gap */
    flex: 0 0 calc(33.333% - 16px);
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    border: 1px solid rgba(45, 74, 62, 0.05);
    display: flex;
    flex-direction: column;
}

@media (max-width: 980px) {
    .colibri-month-col {
        flex: 0 0 calc(50% - 12px);
    }
}

@media (max-width: 767px) {
    .colibri-month-col {
        flex: 0 0 100%;
    }
}

.colibri-month-header {
    font-size: 24px;
    font-weight: 700;
    color: var(--cal-primary);
    border-bottom: 2px solid var(--cal-secondary);
    padding-bottom: 12px;
    margin-bottom: 16px;
    text-transform: capitalize;
    flex-shrink: 0;
}

/* Scroll area for events inside the month */
.colibri-events-list {
    flex-grow: 1;
    max-height: 450px;
    overflow-y: auto;
    padding-right: 8px; /* space for scrollbar */
}

/* Custom Scrollbar for events list */
.colibri-events-list::-webkit-scrollbar {
    width: 6px;
}
.colibri-events-list::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}
.colibri-events-list::-webkit-scrollbar-thumb {
    background: rgba(45, 74, 62, 0.3); 
    border-radius: 4px;
}
.colibri-events-list::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 74, 62, 0.6); 
}

/* ── Carte Événement ── */
.colibri-event-card {
    background: #fdfdfd;
    border-left: 4px solid var(--cal-primary);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.colibri-event-card:last-child {
    margin-bottom: 0;
}

.colibri-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.colibri-event-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--cal-secondary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.colibri-event-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cal-primary);
    line-height: 1.4;
    margin-bottom: 12px;
}

/* Bouton Google Agenda */
.colibri-gcal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(45, 74, 62, 0.05);
    color: var(--cal-primary);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 0;
}

.colibri-gcal-btn:hover {
    background: var(--cal-primary);
    color: #ffffff;
}

.colibri-gcal-btn i {
    font-size: 16px;
}

/* ── Légende ── */
.colibri-calendar-legend {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.legend-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-top: 4px solid var(--cal-primary);
}

.legend-box h3 {
    font-size: 18px;
    color: var(--cal-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-box h3 i {
    color: var(--cal-secondary);
    font-size: 22px;
}

.legend-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legend-list li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
    font-size: 14px;
    color: var(--cal-text);
}
.legend-list li:last-child { border-bottom: none; }
.legend-list li strong { color: var(--cal-primary); }

.legend-badges {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.legend-badge-item {
    font-size: 13px;
    color: var(--cal-text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-tag {
    background: rgba(106, 175, 106, 0.15);
    color: var(--cal-primary);
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

.legend-notes {
    background: rgba(201, 124, 93, 0.05);
    border-left: 4px solid var(--cal-secondary);
    padding: 16px;
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: var(--cal-text);
    font-style: italic;
    grid-column: 1 / -1;
}

/* ── Filtres de travaux et catégories ── */
.colibri-cal-filters-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(45, 74, 62, 0.05);
    border: 1px solid rgba(45, 74, 62, 0.05);
}

.colibri-cal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.colibri-cal-filters:not(:last-child) {
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(45, 74, 62, 0.1);
}

.colibri-filter-label {
    font-weight: 700;
    color: var(--cal-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 16px;
    min-width: 100px;
}

.colibri-filter-label i {
    font-size: 18px;
    color: var(--cal-secondary);
}

.colibri-filter-btn {
    background: transparent;
    color: var(--cal-text);
    border: 1px solid rgba(45, 74, 62, 0.15);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.colibri-filter-btn:hover {
    background: rgba(45, 74, 62, 0.03);
    border-color: rgba(45, 74, 62, 0.3);
    transform: translateY(-1px);
}

.colibri-filter-btn.active {
    background: var(--cal-primary);
    color: #ffffff;
    border-color: var(--cal-primary);
    box-shadow: 0 4px 12px rgba(45, 74, 62, 0.15);
    font-weight: 600;
}

/* ── Tags sur la carte ── */
.colibri-event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.colibri-event-tasks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    max-width: 60%;
}

.colibri-task-tag {
    background: rgba(45, 74, 62, 0.08);
    color: var(--cal-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Description au clic ── */
.colibri-event-card.has-description {
    cursor: pointer;
}

.colibri-event-description {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13.5px;
    color: var(--cal-text);
    margin-top: 0;
    line-height: 1.5;
}

.colibri-event-description p:last-child {
    margin-bottom: 0;
}

.colibri-event-card.expanded .colibri-event-description {
    max-height: 500px;
    opacity: 1;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0,0,0,0.1);
}

.colibri-event-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.colibri-desc-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    color: var(--cal-secondary);
    transition: transform 0.3s ease;
}

.colibri-event-card.expanded .colibri-desc-indicator {
    transform: rotate(180deg);
}
