/* Event Calendar & Downloads Plugin Styles - Notion Design */

.ecd-container {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    color: #1A3760;
    line-height: 1.5;
}

/* === CALENDRIER === */
.ecd-calendar-section {
    margin-bottom: 40px;
    background: rgb(255, 255, 255);
    border-radius: 12px;
    border: 1px solid rgba(227, 226, 224, 0.5);
    overflow: hidden;
    box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 2px 4px;
}

.ecd-calendar-section h3 {
    background: rgb(255, 255, 255);
    color: #1A3760;
    margin: 0;
    padding: 24px 24px 16px 24px;
    font-size: 1.875rem;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid rgba(227, 226, 224, 0.5);
}

.ecd-calendar {
    padding: 24px;
}

.ecd-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 8px;
}

.ecd-nav-btn {
    background: #1A3760;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.ecd-nav-btn:hover {
    background: #0f2548;
    transform: translateY(-1px);
}

#ecd-current-month {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1A3760;
}

.ecd-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: rgba(227, 226, 224, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(227, 226, 224, 0.5);
}

.ecd-calendar-day {
    background: white;
    padding: 16px 12px;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.ecd-calendar-day:hover {
    background: rgb(245, 244, 242);
}

.ecd-calendar-day.ecd-other-month {
    color: rgba(26, 55, 96, 0.4);
    background: rgb(251, 250, 249);
}

.ecd-calendar-day.ecd-today {
    background: #1A3760;
    color: white;
    font-weight: 600;
}

.ecd-calendar-day.ecd-today:hover {
    background: #0f2548;
}

.ecd-calendar-day.ecd-has-event {
    background: rgb(251, 243, 219);
    border: 2px solid rgb(255, 212, 0);
    color: #1A3760;
    font-weight: 600;
}

.ecd-calendar-day.ecd-has-event:hover {
    background: rgb(248, 238, 199);
}

.ecd-calendar-day.ecd-has-event::after {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: rgb(255, 163, 68);
    border-radius: 50%;
}

.ecd-calendar-weekday {
    background: rgb(247, 246, 243);
    padding: 12px;
    text-align: center;
    font-weight: 600;
    color: rgba(26, 55, 96, 0.7);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === ÉVÉNEMENTS === */
.ecd-events-list {
    padding: 24px;
    background: rgb(255, 255, 255);
}

.ecd-events-list h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1A3760;
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(227, 226, 224, 0.5);
}

.ecd-events {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ecd-event-item {
    display: flex;
    background: rgb(251, 250, 249);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(227, 226, 224, 0.5);
    transition: all 0.2s ease;
    position: relative;
}

.ecd-event-item:hover {
    transform: translateY(-2px);
    box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.2) 0px 3px 6px, rgba(15, 15, 15, 0.1) 0px 9px 24px;
    border-color: rgba(26, 55, 96, 0.2);
}

.ecd-event-date {
    flex-shrink: 0;
    background: #1A3760;
    color: white;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-right: 20px;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ecd-event-day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.ecd-event-month {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 4px;
    opacity: 0.8;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ecd-event-details {
    flex: 1;
}

.ecd-event-title {
    margin: 0 0 12px 0;
    color: #1A3760;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

.ecd-event-time {
    margin: 8px 0;
    color: rgba(26, 55, 96, 0.7);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.ecd-event-description {
    margin: 12px 0;
    color: rgba(26, 55, 96, 0.8);
    line-height: 1.5;
    font-size: 14px;
}

.ecd-event-actions {
    margin-top: 16px;
}

.ecd-google-calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ff5538;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.ecd-google-calendar-btn:hover {
    background: #ff5538;
    color: white;
    transform: translateY(-1px);
    box-shadow: rgba(15, 15, 15, 0.1) 0px 2px 4px;
}

.ecd-no-events {
    text-align: center;
    color: rgba(26, 55, 96, 0.6);
    font-style: italic;
    padding: 40px;
    background: rgb(251, 250, 249);
    border-radius: 8px;
    border: 1px solid rgba(227, 226, 224, 0.5);
}

/* === TÉLÉCHARGEMENTS === */
.ecd-downloads-section {
    background: rgb(255, 255, 255);
    border-radius: 12px;
    border: 1px solid rgba(227, 226, 224, 0.5);
    overflow: hidden;
    box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.1) 0px 2px 4px;
}

.ecd-downloads-section h3 {
    background: rgb(255, 255, 255);
    color: #1A3760;
    margin: 0;
    padding: 24px 24px 16px 24px;
    font-size: 1.875rem;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid rgba(227, 226, 224, 0.5);
}

/* === SECTIONS CATÉGORIES === */
.ecd-category-section {
    margin-bottom: 32px;
}

.ecd-category-section:last-child {
    margin-bottom: 0;
}

.ecd-category-title {
    margin: 0 0 20px 0;
    padding: 16px 24px;
    background: rgb(247, 246, 243);
    color: #1A3760;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(227, 226, 224, 0.5);
    position: relative;
}

.ecd-category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #1A3760;
}

.ecd-category-title.ecd-postes::before {
    background: #e74c3c;
}

.ecd-category-title.ecd-ressources::before {
    background: #3498db;
}

.ecd-downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    padding: 24px;
}

.ecd-download-item {
    background: rgb(251, 250, 249);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(227, 226, 224, 0.5);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ecd-download-item:hover {
    transform: translateY(-2px);
    box-shadow: rgba(15, 15, 15, 0.1) 0px 0px 0px 1px, rgba(15, 15, 15, 0.2) 0px 3px 6px, rgba(15, 15, 15, 0.1) 0px 9px 24px;
    border-color: rgba(55, 53, 47, 0.2);
}

.ecd-download-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ecd-download-logo {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: rgb(247, 246, 243);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(227, 226, 224, 0.5);
}

.ecd-download-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ecd-default-icon {
    font-size: 24px;
    color: rgba(26, 55, 96, 0.4);
}

.ecd-download-content {
    flex: 1;
}

.ecd-download-title {
    margin: 0 0 4px 0;
    color: #1A3760;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

.ecd-download-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ecd-download-count {
    color: rgba(26, 55, 96, 0.6);
    font-size: 13px;
    font-weight: 500;
}

.ecd-download-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ecd-download-btn, .ecd-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    min-width: 100px;
    justify-content: center;
}

.ecd-download-btn {
    background: #ff5538;
    color: white;
}

.ecd-download-btn:hover {
    background: #ff5538;
    color: white;
    transform: translateY(-1px);
    box-shadow: rgba(15, 15, 15, 0.1) 0px 2px 4px;
}

.ecd-view-btn {
    background: rgb(247, 246, 243);
    color: rgb(55, 53, 47);
    border: 1px solid rgba(227, 226, 224, 0.8);
}

.ecd-view-btn:hover {
    background: rgb(241, 240, 236);
    color: #1A3760;
    transform: translateY(-1px);
    border-color: rgba(26, 55, 96, 0.3);
}

.ecd-no-downloads {
    text-align: center;
    color: rgba(26, 55, 96, 0.6);
    font-style: italic;
    padding: 40px;
    background: rgb(251, 250, 249);
    border-radius: 8px;
    border: 1px solid rgba(227, 226, 224, 0.5);
    margin: 24px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .ecd-container {
        padding: 0 16px;
    }
    
    .ecd-calendar-section,
    .ecd-downloads-section {
        margin-bottom: 24px;
        border-radius: 8px;
    }
    
    .ecd-calendar-section h3,
    .ecd-downloads-section h3 {
        padding: 20px 20px 12px 20px;
        font-size: 1.5rem;
    }
    
    .ecd-calendar {
        padding: 20px;
    }
    
    .ecd-calendar-grid {
        font-size: 13px;
    }
    
    .ecd-calendar-day {
        padding: 12px 8px;
        min-height: 50px;
        font-size: 13px;
    }
    
    .ecd-calendar-header {
        margin-bottom: 20px;
    }
    
    .ecd-nav-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 32px;
        height: 32px;
    }
    
    #ecd-current-month {
        font-size: 1.125rem;
    }
    
    .ecd-event-item {
        flex-direction: column;
        text-align: left;
        padding: 16px;
    }
    
    .ecd-event-date {
        margin-right: 0;
        margin-bottom: 16px;
        align-self: flex-start;
        min-width: 70px;
        padding: 12px;
    }
    
    .ecd-event-day {
        font-size: 1.25rem;
    }
    
    .ecd-event-month {
        font-size: 0.7rem;
    }
    
    .ecd-downloads-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 12px;
    }
    
    .ecd-download-item {
        padding: 16px;
    }
    
    .ecd-download-header {
        gap: 12px;
    }
    
    .ecd-download-logo {
        width: 48px;
        height: 48px;
    }
    
    .ecd-download-title {
        font-size: 1rem;
    }
    
    .ecd-download-actions {
        gap: 12px;
        flex-direction: column;
    }
    
    .ecd-download-btn, .ecd-view-btn {
        flex: 1;
        min-width: auto;
        font-size: 14px;
        padding: 14px 16px;
        min-height: 48px;
        justify-content: center;
        border-radius: 8px;
    }
    
    .ecd-google-calendar-btn {
        font-size: 14px;
        padding: 14px 16px;
        min-height: 48px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .ecd-container {
        padding: 0 12px;
    }
    
    .ecd-calendar-section h3,
    .ecd-downloads-section h3 {
        padding: 16px;
        font-size: 1.375rem;
    }
    
    .ecd-calendar {
        padding: 16px;
    }
    
    .ecd-calendar-header {
        flex-direction: row;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .ecd-calendar-day {
        padding: 8px 4px;
        min-height: 40px;
        font-size: 12px;
    }
    
    .ecd-calendar-weekday {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .ecd-nav-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-width: 30px;
        height: 30px;
    }
    
    #ecd-current-month {
        font-size: 1rem;
    }
    
    .ecd-events-list {
        padding: 16px;
    }
    
    .ecd-event-item {
        padding: 12px;
    }
    
    .ecd-event-date {
        min-width: 60px;
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .ecd-event-day {
        font-size: 1.125rem;
    }
    
    .ecd-event-title {
        font-size: 1rem;
    }
    
    .ecd-downloads-grid {
        padding: 16px;
        gap: 12px;
    }
    
    .ecd-download-item {
        padding: 12px;
    }
    
    .ecd-download-header {
        gap: 10px;
    }
    
    .ecd-download-logo {
        width: 40px;
        height: 40px;
    }
    
    .ecd-download-title {
        font-size: 0.95rem;
    }
    
    .ecd-download-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .ecd-download-btn, .ecd-view-btn {
        
        font-size: 14px;
        padding: 5px 10px;
        min-height: 52px;
        justify-content: center;
        border-radius: 8px;
    }
    
    .ecd-google-calendar-btn {
        font-size: 14px;
        padding: 5px 10px;
        min-height: 52px;
        border-radius: 8px;
        justify-content: center;
    }
}

/* === ANIMATIONS ET ÉTATS === */
.ecd-highlighted {
    background: rgb(255, 248, 220) !important;
    border-color: rgb(255, 212, 0) !important;
    transform: scale(1.02) !important;
    box-shadow: rgba(255, 212, 0, 0.3) 0px 0px 0px 2px !important;
}

.ecd-tooltip {
    position: absolute;
    background: rgb(55, 53, 47);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    white-space: nowrap;
    box-shadow: rgba(15, 15, 15, 0.2) 0px 3px 6px, rgba(15, 15, 15, 0.1) 0px 9px 24px;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease forwards;
}

.ecd-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border: 4px solid transparent;
    border-top-color: rgb(55, 53, 47);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ecd-fade-in {
    animation: fadeInUp 0.4s ease forwards;
}

/* === AMÉLIORATIONS POUR LES ICÔNES === */
.dashicons {
    font-size: inherit;
    width: auto;
    height: auto;
}

.ecd-download-btn .dashicons,
.ecd-view-btn .dashicons,
.ecd-google-calendar-btn .dashicons {
    font-size: 14px;
}

/* === FOCUS ET ACCESSIBILITÉ === */
.ecd-nav-btn:focus,
.ecd-download-btn:focus,
.ecd-view-btn:focus,
.ecd-google-calendar-btn:focus {
    outline: 2px solid rgb(46, 170, 220);
    outline-offset: 2px;
}

.ecd-calendar-day:focus {
    outline: 2px solid rgb(46, 170, 220);
    outline-offset: -2px;
}

/* === ÉTATS DE CHARGEMENT === */
.ecd-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.ecd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(55, 53, 47, 0.3);
    border-top: 2px solid rgb(55, 53, 47);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}