/* public/css/components.css */

/* =======================================================
   📋 EN-TÊTES ET CARTES UNIFORMISÉS (PAGES ADMIN)
   ======================================================= */

.page-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 25px;
    background: white;
    padding: 20px 25px;
    border-radius: 20px; 
    box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.05); 
}

.page-header h1 {
    color: #1b2559;
    margin: 0 0 5px 0;
    font-size: 35px;
    font-weight: bold;
}

.page-header p {
    color: #64748b; /* text-muted */
    margin: 0;
}

.dashboard-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.05);
    width: 100%;
    margin-bottom: 20px;
}


/* =======================================================
   📅 ÉLÉMENTS DU PLANNING
   ======================================================= */

.calendar-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.reservation-slot {
    position: absolute;
    left: 5%;
    width: 90%;
    top: var(--t);
    height: var(--h);
    border-radius: 4px;
    z-index: 10;
    overflow: hidden;
    transition: transform 0.2s;
    box-sizing: border-box;
}

.reservation-slot:hover {
    transform: scale(1.02);
    z-index: 20;
}

/* Couleurs spécifiques pour les différents types de réservation */
.bg-tp { background-color: #00b371 !important; }
.bg-montage { background-color: #faa21e !important; }
.bg-install { background-color: #ff0000 !important; }

.res-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 3px 5px;
    box-sizing: border-box;
}

.res-bottom-row {
    display: flex;
    justify-content: space-between; /* Nom à gauche, heure à droite */
    align-items: flex-end; /* Aligne le texte sur la même ligne de base */
    width: 100%;
    margin-top: auto; /* Force cette ligne à coller tout en bas de la case */
}

.res-title {
    font-weight: bold;
    font-size: 13px;
    white-space: normal;
    overflow-wrap: break-word;
    background: rgba(255, 255, 255, 0.83);
    border-radius: 4px;
    text-align: center;
    overflow: hidden;
    color: white;
}

.res-subtitle {
    font-size: 9px;
    font-weight: 600;
    opacity: 0.8;
    padding-top: 2px;
    white-space: nowrap;       
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 5px;
    color: white;
}

.res-time {
    font-size: 9px;
    font-weight: 700;
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.5);
    padding: 1px 4px;
    border-radius: 4px;
    margin: 0; 
    white-space: nowrap;
}


/* =======================================================
   🔘 BOUTONS ET NAVIGATION
   ======================================================= */

.btn-primary {
    background: #4318ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
}

.filters-group {
    display: flex;
    align-items: center;
    gap: 10px; 
}

.date-picker-form {
    margin: 0; 
}

.select-month-input {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    color: #1b2559;
    font-weight: 600;
    background: white;
}

.btn-nav {
    background: #f8fafc;
    color: #4318ff; 
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 14px;
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
    transition: transform 0.2s, background 0.2s;
}

.btn-nav:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

/* Bouton vers l'export planning */
.btn-export-link {
    background: #f8fafc;
    color: #4318ff;
    border: 2px solid #e2e8f0;
    font-weight: bold;
    border-radius: 10px;
    padding: 10px 20px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    margin-bottom: 17px;
}

/* 🪄 L'effet au survol */
.btn-export-link:hover {
    background: #e2e8f0;         
    color: #1b2559;              
    border-color: #cbd5e1;       
    transform: translateY(-2px); 
}


/* =======================================================
   🪟 MODALE DÉTAILS RÉSERVATION
   ======================================================= */

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(27, 37, 89, 0.4); /* Bleu foncé semi-transparent */
    display: flex; justify-content: center; align-items: center;
    z-index: 1000; backdrop-filter: blur(3px);
}

.modal-content {
    background: white; padding: 30px; border-radius: 20px;
    width: 400px; max-width: 90%; position: relative;
    box-shadow: 0px 45px 80px rgba(0, 0, 0, 0.15);
}

.close-btn {
    position: absolute; top: 15px; right: 20px;
    font-size: 28px; cursor: pointer; color: #a3aed0; transition: 0.2s;
}
.close-btn:hover { color: #1b2559; }

.btn-info { background: #0ea5e9; color: white; border: none; padding: 10px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; }
.btn-warning { background: #ffb547; color: white; border: none; padding: 10px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; }
.btn-danger { background: #ee5d50; color: white; border: none; padding: 10px 15px; border-radius: 8px; cursor: pointer; font-weight: bold; }

.modal-title {
    margin-top: 0;
    color: #1b2559;
}

.modal-body-text {
    margin-top: 15px;
    line-height: 1.6;
}

.modal-actions-container {
    margin-top: 25px;
    display: flex;
    gap: 10px;
}


/* =======================================================
   🪄 AFFICHAGE COMPACT POUR LES RÉSERVATIONS <= 1H 
   ======================================================= */

.reservation-slot.compact .res-info {
    display: flex;
    flex-direction: row; 
    align-items: center; 
    padding: 2px 6px;
    gap: 8px;
}

.reservation-slot.compact .res-title {
    flex: 1; 
    text-align: center; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. La boîte de l'heure garde sa taille d'origine et reste à droite */
.reservation-slot.compact .res-bottom-row {
    flex-shrink: 0; /* 👈 Empêche l'heure de se faire écraser si le titre est très long */
    margin-top: 0;
    width: auto;
}

/* On s'assure que l'heure est bien visible */
.reservation-slot.compact .res-time {
    display: block;
    margin: 0;
}

/* cache le nom du prof */
.reservation-slot.compact .res-subtitle {
    display: none;
}