﻿.planning-week-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.planning-table-wrapper {
    max-width: 100%;

}

/* =========================================================
   MASQUER LE WEEK-END PAR DÉFAUT

   Structure :
   | Agents | Teams | Action | Lun | Mar | Mer | Jeu | Ven | Sam | Dim |

   Colonnes :
   |   1    |   2   |   3    |  4  |  5  |  6  |  7  |  8  |  9  | 10  |
   ========================================================= */

.planning-week-container.hide-weekend .week-table .weekend-col {
    display: none !important;
}

.planning-week-container.show-weekend .week-table .weekend-col {
    display: table-cell !important;
}

/* Centre le tableau (fit-content) quand le week-end est masqué */
.planning-week-container.hide-weekend .planning-table-wrapper {
    width: fit-content;
    margin: 0 auto;
}

/* Quand le week-end est visible, le tableau peut dépasser : 
   on laisse le wrapper prendre toute la largeur dispo */
.planning-week-container.show-weekend .planning-table-wrapper {
    width: 100%;
}

/* =========================================================
   BOUTON TOGGLE WEEK-END
   ========================================================= */

.toggle-weekend-btn {
    padding: 6px 12px;
    color: white;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.3s;
}

    .toggle-weekend-btn:hover {
        background-color: #218838;
    }

    .toggle-weekend-btn.active {
        background-color: #dc3545;
    }

        .toggle-weekend-btn.active:hover {
            background-color: #c82333;
        }

/* =========================================================
   EN-TÊTE DE LA SEMAINE
   ========================================================= */

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.week-info {
    flex: 1;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.nav-button {
    padding: 6px 12px;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

    .nav-button:hover {
        background-color: #0056b3;
    }

/* =========================================================
   TABLEAU
   ========================================================= */

.week-table {
    min-width: 1400px;
    flex-shrink: 0;
    overflow: hidden;
    border-collapse: collapse;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 12px;
}

    .week-table thead {
        background-color: #f8f9fa;
        font-weight: bold;
        text-align: center;
    }

    .week-table th {
        border: 1px solid #dee2e6;
        text-align: center;
        vertical-align: middle;
    }

        .week-table th.day-header {
            width: 310px;
            min-width: 310px;
            max-width: 310px;
        }

.agents-header {
    min-width: 130px;
    background-color: #e7f3ff;
    text-align: left;
}

.teams-header {
    min-width: 100px;
    background-color: #f0f0f0;
}

/* =========================================================
   EN-TÊTES DES JOURS
   ========================================================= */

.day-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.day-name-date {
    display: flex;
    gap: 2px;
    white-space: nowrap;
    font-size: 0.95em;
}

.day-name {
    font-weight: bold;
}

.day-date {
    color: #666;
    font-size: 0.9em;
}

.holiday-header {
    background-color: #fff3cd !important;
}

.holiday-name {
    color: #ff6b6b;
    font-size: 11px;
    font-style: italic;
}

/* =========================================================
   LIGNES ET CELLULES DES AGENTS
   ========================================================= */

.week-table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

    .week-table tbody tr:hover {
        background-color: #f9f9f9;
    }

.agent-row {
    background-color: #ffffff;
}

.agent-cell {
    padding: 0;
    vertical-align: middle;
}

.agent-name {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* aligne tout à gauche */
    gap: 10px;
    height: 100%;
    padding: 0;
}

.agent-name-cell {
    min-width: 130px;
    padding: 8px;
    background-color: #e7f3ff;
    font-weight: 600;
    text-align: left;
}

    .agent-name-cell small {
        display: block;
        font-size: 11px;
        font-weight: normal;
    }

.agent-teams-cell {
    min-width: 100px;
    padding: 8px;
    background-color: #f5f5f5;
}

.teams-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-badge {
    display: inline-block;
    width: fit-content;
    padding: 3px 8px;
    color: white;
    background-color: #007bff;
    border-radius: 12px;
    font-size: 11px;
}

/* =========================================================
   CELLULES DES JOURS
   ========================================================= */

.day-cell {
    min-width: 130px;
    padding: 6px;
    background-color: #ffffff;
    text-align: left;
    vertical-align: top;
}

.holiday-cell {
    background-color: #fffbf0;
}

.day-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 60px;
}

.events-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.event-item {
    padding: 4px;
    background-color: #e7f3ff;
    border-left: 3px solid #007bff;
    border-radius: 4px;
    font-size: 10px;
}

    .event-item.confirmed {
        background-color: #d4edda;
        border-left-color: #28a745;
    }

    .event-item.pending {
        background-color: #fff3cd;
        border-left-color: #ffc107;
    }

.event-title {
    color: #333;
    font-weight: 600;
}

.event-time {
    color: #666;
    font-size: 9px;
}

.event-team {
    color: #007bff;
    font-weight: 500;
}

.event-status {
    margin-top: 2px;
}

.no-events {
    padding: 30px 0;
    color: #999;
    font-style: italic;
    text-align: center;
}

.comment-text {
    display: block;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-muted {
    color: #999;
}

/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
}

.badge-success {
    color: white;
    background-color: #28a745;
}

.badge-warning {
    color: #333;
    background-color: #ffc107;
}

/* =========================================================
   EN-TÊTE DIAGONAL « AGENTS / COMMENTAIRES »
   ========================================================= */

.empty-header {
    width: 150px;
    background-color: #f5f5f5;
}

.corner-header {
    width: 120px;
    height: 80px;
    padding: 0 !important;
    background-color: #e7f3ff;
    position: relative;
}

.diagonal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

    .diagonal-header::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(135deg, transparent 50%, #000 50%);
        pointer-events: none;
    }

.label-comments {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    font-weight: bold;
}

.label-agents {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 11px;
    font-weight: bold;
}

/* =========================================================
   COMMENTAIRES
   ========================================================= */

.comments-row {
    background-color: #f0f8ff;
}

.comment-cell {
    padding: 0 !important;
    background-color: #f0f8ff;
    vertical-align: middle;
}

.comments-label {
    display: flex;
    align-items: center;
    width: 150px;
    height: 60px;
    padding: 0 0 0 12px !important;
    background-color: #e7f3ff;
    border: 1px solid #dee2e6;
    position: relative;
    font-weight: bold;
    text-align: left;
}

    .comments-label::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( to top right, transparent calc(50% - 0.5px), #dee2e6 calc(50% - 0.5px), #dee2e6 calc(50% + 0.5px), transparent calc(50% + 0.5px) );
        pointer-events: none;
    }

.label-top-right {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}

.label-bottom-left {
    position: absolute;
    bottom: 6px;
    left: 8px;
    z-index: 2;
    color: #333;
    font-size: 14px;
    font-weight: bold;
}

.comment-edit-mode {
    padding: 8px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.comment-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
}

.comment-actions {
    display: flex;
    gap: 5px;
    margin-top: 8px;
}

.comment-view-mode {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-height: 50px;
    padding: 8px;
}

    .comment-view-mode:hover {
        background-color: #f0f0f0;
    }

.comment-content {
    flex: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.empty-comment {
    color: #999;
    font-style: italic;
}

.comment-buttons {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    gap: 4px;
}

    .comment-buttons .btn {
        padding: 2px 6px !important;
        white-space: nowrap;
        font-size: 12px;
    }

/* =========================================================
   BOUTON « AJOUTER »
   ========================================================= */

.btn.btn-sm.btn-light {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 10px;
    padding: 0;
    margin: 2px auto;
    color: #fff;
    border: none;
    border-radius: 6px;
    box-shadow: none;
    font-size: 10px;
    font-weight: bold;
    transition: background-color 0.2s;
}

/* =========================================================
   CELLULE CALENDRIER
   ========================================================= */

.calendar-cell {
    padding: 0 !important;
}

.cell-inner.split-layout {
    display: flex;
    min-height: auto;
    height: 100%;
}

/* Colonne gauche : horaires */
.time-column {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    padding: 4px 2px;
    /*border-right: 2px solid #dee2e6;*/
    transition: background-color 0.3s ease;
}

    .time-column.overtime {
        background-color: #d4edda;
        border-right-color: #28a745;
    }

.time-range {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: #495057;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}

.time-start,
.time-end {
    white-space: nowrap;
    line-height: 1;
}



/* Colonne droite : tâches */
.events-container-double {
    display: grid;
    flex: 1;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    margin-bottom: 4px;
}

.events-half {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 200px;
}

    .events-half.left-half {
        padding-right: 2px;
        border-right: 1px dashed #dee2e6;
    }

    .events-half.right-half {
        padding-left: 2px;
    }

.events-column {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 3px;
}

.events-container {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
    overflow: hidden;
}

.event-box {
    padding: 3px 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1.2;
    transition: transform 0.2s, box-shadow 0.2s;
    color: antiquewhite;
}

    .event-box:hover {
        transform: scale(1.02);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    }

.add-btn {
    display: flex;
    justify-content: center;
    margin-top: auto;
}

    .add-btn button {
        width: 28px;
        height: 28px;
        padding: 0;
        border-radius: 50%;
        font-size: 14px;
    }

/* =========================================================
   SURBRILLANCE DU JOUR ACTUEL
   ========================================================= */

.today-header {
    position: relative;
    color: #333;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 2px solid #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.3);
    font-weight: bold;
}

    .today-header::after {
        content: "📍 AUJOURD'HUI";
        position: absolute;
        top: -20px;
        left: 50%;
        padding: 2px 8px;
        color: white;
        background-color: #ff6b6b;
        border-radius: 12px;
        transform: translateX(-50%);
        white-space: nowrap;
        font-size: 10px;
        font-weight: bold;
    }

.today-cell {
    background-color: #fffacd;
}

    .today-cell:hover {
        background-color: #ffffe0;
    }

/* =========================================================
   RÉSUMÉ
   ========================================================= */

.summary-column-header {
    margin-bottom: 8px;
    color: #333;
    font-size: 13px;
    font-weight: bold;
}

.summary-column-subheader {
    margin-bottom: 4px;
    color: #666;
    font-size: 11px;
}

.summary-cell {
    padding: 10px;
    background-color: #f9f9f9;
}

.summary-task-columns {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.summary-task-column {
    flex: 1;
    font-size: 12px;
}

.summary-task-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.summary-label {
    color: #666;
    font-weight: 500;
}

.summary-value {
    color: #333;
    font-weight: bold;
}

.summary-divider {
    height: 1px;
    margin: 10px 0;
    background-color: #ddd;
}

.summary-support-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.summary-support-label {
    color: #666;
    font-weight: bold;
}

.summary-support-items {
    display: flex;
    gap: 5px;
}

.summary-support-item {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

/*Nouveau*/
/* Ligne réduite */
tr.row-collapsed {
    height: 1px !important;
    max-height: 1px !important;
}

    tr.row-collapsed > td {
        height: 1px !important;
        max-height: 1px !important;
        padding: 0 !important;
        line-height: 1px !important;
        overflow: hidden !important;
    }

    tr.row-collapsed .agent-name-cell {
    padding: 0 !important;
    min-width: 0 !important;
}

    tr.row-collapsed .agent-name {
        height: 20px !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 10px !important;
        line-height: 20px !important;
    }

        tr.row-collapsed .agent-name button {
            width: 20px !important;
            height: 18px !important;
            padding: 0 !important;
            margin: 0 !important;
            line-height: 15px !important;
            font-size: 11px !important;
        }

    tr.row-collapsed .team-badge,
    tr.row-collapsed .duplicate-button,
    tr.row-collapsed .calendar-cell,
    tr.row-collapsed .cell-inner {
        display: none !important;
    }

/*Option clique bouton droit sur l'événement*/
.alternative-title-list {
    width: 100%;
    min-width: 240px;
    border: 2px solid #b8d0ff;
    border-radius: 8px;
    padding: 4px;
    font-size: 14px;
    background-color: white;
}

    .alternative-title-list option {
        padding: 8px;
    }

.popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
}

.alternative-title-popup {
    position: absolute;
    background: white;
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0,0,0,.25);
}

.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: transparent; /* ou rgba(0,0,0,0.1) si vous voulez un effet de voile */
}

.popup-content {
    position: fixed; /* déjà défini en inline via popupStyle, mais on s'assure du z-index */
}
/*Fin Option clique bouton droit sur l'événement*/
