/*
============================================
APERTURE SCIENCE - PLANIFICATEUR CSS
Fichier: aperture-planner.css
Auteur: Emile SNYERS
Date: 2025-08-16
Version: 1.0
Licence: Creative Commons BY-NC 4.0

Description: Styles CSS dédiés au planificateur de missions
Harmonisé avec aperture-modules.css existant
============================================
*/

/* ====== CORRECTIONS SPÉCIFIQUES AU PLANIFICATEUR ====== */

/* Structure principale du planificateur */
.mission-planner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg, 2rem);
    align-items: start; /* AJOUT: éviter l'étirement */
}

/* ====== CORRECTIONS DU CALENDRIER ====== */

/* Container principal - amélioration de l'existant */
.calendar-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--aperture-light-grey, #555);
    border-radius: var(--border-radius-md, 10px);
    padding: var(--spacing-md, 1.5rem);
    width: 100%; /* AJOUT: largeur complète */
    box-sizing: border-box; /* AJOUT: inclure padding dans la largeur */
}

/* Header du calendrier - corrections */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md, 1.5rem);
    padding: 0; /* RESET: enlever padding par défaut */
}

/* Boutons de navigation - amélioration */
.nav-btn {
    background: var(--aperture-orange, #ff6b35);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--aperture-teal, #4ecdc4);
    transform: scale(1.1);
}

/* Titre du mois */
.current-month {
    color: var(--aperture-orange, #ff6b35);
    margin: 0;
    font-size: 1.3em;
    font-weight: bold;
    text-transform: capitalize;
}

/* ====== STRUCTURE DU CALENDRIER CORRIGÉE ====== */

/* Grid principal du calendrier */
.calendar-grid {
    display: block; /* CHANGEMENT: block au lieu de grid pour contrôler la structure */
    width: 100%;
}

/* En-têtes des jours de la semaine */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 8px;
    width: 100%;
}

.weekday {
    background: var(--aperture-teal, #4ecdc4);
    color: white;
    text-align: center;
    padding: 8px 4px;
    font-weight: bold;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Grille des jours - CORRECTION PRINCIPALE */
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    width: 100%;
}

/* Styles des jours - harmonisé avec l'existant */
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--aperture-grey, #333);
    border-radius: var(--border-radius-sm, 6px);
    cursor: pointer;
    transition: var(--transition-fast, 0.3s ease);
    color: white;
    font-size: 0.9em;
    padding: 4px;
    position: relative;
    min-height: 40px;
}

.calendar-day:hover {
    background: var(--aperture-orange, #ff6b35);
    transform: scale(1.05);
}

.calendar-day.today {
    background: var(--aperture-orange, #ff6b35);
    color: white;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.calendar-day.selected {
    background: var(--aperture-teal, #4ecdc4);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.5);
}

.calendar-day.has-events {
    border: 2px solid var(--aperture-orange, #ff6b35);
}

.calendar-day.other-month {
    opacity: 0.3;
    cursor: default;
    background: #222;
}

.calendar-day.other-month:hover {
    background: #222;
    transform: none;
}

/* Numéro du jour */
.day-number {
    font-weight: bold;
    margin-bottom: 2px;
}

/* Indicateurs d'événements */
.event-indicators {
    display: flex;
    gap: 1px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2px;
}

.event-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--aperture-orange, #ff6b35);
}

.event-dot.high {
    background: #ff0000;
}

.event-dot.normal {
    background: var(--aperture-orange, #ff6b35);
}

.event-dot.low {
    background: var(--aperture-teal, #4ecdc4);
}

/* Actions du calendrier */
.calendar-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #555;
}

.action-btn {
    background: var(--aperture-teal, #4ecdc4);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--aperture-orange, #ff6b35);
    transform: translateY(-2px);
}

/* ====== CORRECTIONS DES MISSIONS ====== */

/* Container des détails de mission - CORRECTION DÉBORDEMENT */
.mission-details {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--aperture-light-grey, #555);
    border-radius: var(--border-radius-md, 10px);
    padding: var(--spacing-md, 1.5rem);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* AJOUT: empêcher le débordement */
}

/* Titre des missions */
.mission-details h4 {
    color: var(--aperture-teal, #4ecdc4);
    margin: 0 0 1rem 0;
    font-size: 1.1em;
}

/* Liste des missions - CORRECTION DÉBORDEMENT */
.mission-list {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: var(--spacing-md, 1.5rem);
    width: 100%;
    box-sizing: border-box;
}

/* Items de mission - CORRECTION LARGEUR */
.mission-item {
    display: flex;
    flex-direction: column; /* CHANGEMENT: colonne pour éviter débordement */
    gap: var(--spacing-sm, 0.5rem);
    padding: var(--spacing-md, 1rem);
    background: rgba(0, 0, 0, 0.4);
    border-left: 3px solid var(--aperture-teal, #4ecdc4);
    border-radius: var(--border-radius-sm, 6px);
    margin-bottom: var(--spacing-sm, 0.5rem);
    transition: var(--transition-fast, 0.3s ease);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* AJOUT: empêcher débordement */
}

.mission-item:hover {
    transform: translateX(5px);
    background: rgba(0, 0, 0, 0.6);
}

/* Header de mission */
.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* AJOUT: permettre le retour à la ligne */
    gap: 0.5rem;
}

.mission-header h4 {
    margin: 0;
    color: white;
    font-size: 1em;
    flex: 1;
    min-width: 0; /* AJOUT: permettre la réduction */
}

/* Statuts de priorité */
.mission-item.priority-high {
    border-left-color: var(--aperture-danger, #ff0000);
}

.mission-item.priority-medium {
    border-left-color: var(--aperture-warning, #ffa500);
}

.mission-item.priority-low {
    border-left-color: var(--aperture-success, #00ff00);
}

/* Détails de mission */
.mission-details-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
    font-size: 0.85em;
}

.mission-details-content p {
    margin: 0;
    color: #ccc;
    word-wrap: break-word; /* AJOUT: casser les mots longs */
}

.mission-details-content strong {
    color: var(--aperture-teal, #4ecdc4);
}

/* Temps de mission */
.mission-time {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: var(--aperture-orange, #ff6b35);
    font-size: 0.9em;
}

/* Statut de mission */
.mission-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0; /* AJOUT: ne pas rétrécir */
}

.mission-status.pending {
    background: var(--aperture-warning, #ffa500);
    color: black;
}

.mission-status.scheduled {
    background: var(--aperture-teal, #4ecdc4);
    color: white;
}

.mission-status.in-progress {
    background: var(--aperture-orange, #ff6b35);
    color: white;
}

.mission-status.completed {
    background: var(--aperture-success, #00ff00);
    color: black;
}

.mission-status.cancelled {
    background: var(--aperture-danger, #ff0000);
    color: white;
}

/* Actions de mission */
.mission-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.mission-actions button {
    padding: 6px 12px;
    background: var(--aperture-teal, #4ecdc4);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.mission-actions button:hover {
    background: var(--aperture-orange, #ff6b35);
}

/* Bouton d'ajout de mission */
.add-mission-btn {
    width: 100%;
    background: var(--aperture-orange, #ff6b35);
    color: white;
    border: none;
    padding: var(--spacing-md, 1rem);
    border-radius: var(--border-radius-sm, 6px);
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: var(--transition-fast, 0.3s ease);
}

.add-mission-btn:hover {
    background: var(--aperture-teal, #4ecdc4);
    transform: translateY(-2px);
}

/* Message pour missions vides */
.no-missions {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 2rem 1rem;
    border: 2px dashed #555;
    border-radius: 8px;
    margin: 1rem 0;
}

/* ====== STYLES DES MODAUX ====== */
.mission-modal,
.danger-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--aperture-grey, #2a2a2a);
    color: white;
    border-radius: 10px;
    border: 2px solid var(--aperture-orange, #ff6b35);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #555;
}

.modal-header h3 {
    margin: 0;
    color: var(--aperture-orange, #ff6b35);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--aperture-orange, #ff6b35);
}

.modal-body {
    padding: 20px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1024px) {
    .mission-planner {
        grid-template-columns: 1fr;
        gap: var(--spacing-md, 1.5rem);
    }
}

@media (max-width: 768px) {
    .calendar-container,
    .mission-details {
        padding: var(--spacing-sm, 1rem);
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .calendar-day {
        min-height: 35px;
        font-size: 0.8em;
        padding: 2px;
    }
    
    .mission-item {
        padding: var(--spacing-sm, 0.75rem);
    }
    
    .mission-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .weekday {
        padding: 6px 2px;
        font-size: 0.7em;
    }
    
    .calendar-day {
        min-height: 30px;
        font-size: 0.75em;
    }
    
    .event-dot {
        width: 3px;
        height: 3px;
    }
}

/*


*/
