/**
 * UNPNC Calendrier - Styles
 * Affichage calendrier mensuel des rendez-vous
 * 
 * @package UNPNC_Task_Manager
 * @version 1.0.0
 */

/* ========================================
   MODAL CALENDRIER
======================================== */

.unpnc-calendrier-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.unpnc-calendrier-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.unpnc-calendrier-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* ========================================
   HEADER MODAL
======================================== */

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

.unpnc-calendrier-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.unpnc-calendrier-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ========================================
   NAVIGATION CALENDRIER
======================================== */

.unpnc-calendrier-navigation {
    padding: 20px 32px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.unpnc-calendrier-nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.unpnc-calendrier-nav-btn {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unpnc-calendrier-nav-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.unpnc-calendrier-month-year {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.unpnc-calendrier-today-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.unpnc-calendrier-today-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(102, 126, 234, 0.4);
}

/* ========================================
   GRILLE CALENDRIER
======================================== */

.unpnc-calendrier-body {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

.unpnc-calendrier-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

/* Jours de la semaine */
.unpnc-calendrier-weekday {
    text-align: center;
    padding: 12px;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Cellules des jours */
.unpnc-calendrier-day {
    aspect-ratio: 1;
    min-height: 80px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.unpnc-calendrier-day:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(102, 126, 234, 0.3);
}

.unpnc-calendrier-day.other-month {
    background: #f8fafc;
    opacity: 0.5;
}

.unpnc-calendrier-day.today {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.unpnc-calendrier-day.has-rdv {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.1) 100%);
}

.unpnc-calendrier-day-number {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.unpnc-calendrier-day.other-month .unpnc-calendrier-day-number {
    color: #94a3b8;
}

.unpnc-calendrier-rdv-indicator {
    background: #10b981;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    display: inline-block;
    margin-top: auto;
}

/* Aperçu des RDV dans chaque case (nom + type) */
.unpnc-calendrier-rdv-mini-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.unpnc-calendrier-rdv-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    line-height: 1.1;
    color: #0f172a;
}

.unpnc-calendrier-rdv-mini-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unpnc-calendrier-rdv-mini-tag {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    white-space: nowrap;
}

.unpnc-calendrier-rdv-more {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.unpnc-calendrier-rdv-dots {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.unpnc-calendrier-rdv-dot {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
}

/* ========================================
   DÉTAILS JOUR (PANNEAU LATÉRAL)
======================================== */

.unpnc-calendrier-details {
    display: none;
    position: fixed;
    right: 0;
    top: 0;
    width: 400px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    animation: slideInRight 0.3s ease;
    overflow-y: auto;
}

.unpnc-calendrier-details.active {
    display: block;
}

.unpnc-calendrier-details-header {
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1;
}

.unpnc-calendrier-details-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.unpnc-calendrier-details-date {
    font-size: 14px;
    opacity: 0.9;
}

.unpnc-calendrier-details-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
}

.unpnc-calendrier-details-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.unpnc-calendrier-details-body {
    padding: 24px;
}

.unpnc-calendrier-rdv-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.unpnc-calendrier-rdv-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.unpnc-calendrier-rdv-time {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unpnc-calendrier-rdv-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.unpnc-calendrier-rdv-phone {
    font-size: 14px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.unpnc-calendrier-rdv-notes {
    font-size: 13px;
    color: #475569;
    font-style: italic;
    padding: 8px;
    background: white;
    border-radius: 6px;
    margin-top: 8px;
}

.unpnc-calendrier-no-rdv {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.unpnc-calendrier-no-rdv-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* ========================================
   LÉGENDE
======================================== */

.unpnc-calendrier-legend {
    display: flex;
    gap: 20px;
    padding: 16px 32px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.unpnc-calendrier-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
}

.unpnc-calendrier-legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid;
}

.unpnc-calendrier-legend-box.today {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.unpnc-calendrier-legend-box.has-rdv {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .unpnc-calendrier-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .unpnc-calendrier-header,
    .unpnc-calendrier-navigation,
    .unpnc-calendrier-body {
        padding: 16px;
    }

    .unpnc-calendrier-grid {
        gap: 4px;
    }

    .unpnc-calendrier-day {
        min-height: 60px;
        padding: 4px;
    }

    .unpnc-calendrier-day-number {
        font-size: 14px;
    }

    .unpnc-calendrier-rdv-indicator {
        font-size: 10px;
        padding: 1px 4px;
    }

    .unpnc-calendrier-details {
        width: 100%;
    }

    .unpnc-calendrier-legend {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }

    .unpnc-calendrier-nav-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .unpnc-calendrier-month-year {
        font-size: 16px;
    }
}

/* ========================================
   ÉTAT LOADING
======================================== */

.unpnc-calendrier-loading {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

.unpnc-calendrier-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
