/* =========================================
   style.css - Design Scroll Horizontal
   ========================================= */

:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --accent-color: #3498db;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 { margin-bottom: 10px; text-align: center; }
h2 { font-size: 1.2rem; margin-top: 20px; color: #aaa; border-bottom: 1px solid #333; padding-bottom: 5px; width: 100%; max-width: 800px; }
.subtitle { color: #888; font-size: 0.9rem; margin-bottom: 20px; text-align: center; }

/* --- BOUTONS --- */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-add { background-color: var(--accent-color); color: white; font-size: 1rem; margin-bottom: 20px; }
.btn-add:hover { background-color: #2980b9; }

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #333;
}
.btn-nav { background-color: #333; color: white; padding: 5px 15px; border-radius: 5px; }

/* --- PLANNING SEMAINE (Scroll) --- */
.week-container::-webkit-scrollbar {
    height: 0px; /* Pour Chrome/Safari */
    background: transparent; 
}
.week-container {
    scrollbar-width: none; /* Pour Firefox */
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.day-card {
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 8px;
    min-width: 100px;
    flex: 1;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.day-card.today { border-color: var(--success-color); box-shadow: 0 0 10px rgba(46, 204, 113, 0.1); }
.day-card.off { opacity: 0.6; }

.day-name { font-size: 0.8rem; color: #888; text-transform: uppercase; }
.day-date { font-size: 1.5rem; font-weight: bold; margin: 5px 0; }

.hours-container { font-size: 0.85rem; margin-bottom: 5px; }

/* --- ALIGNEMENT DES HORAIRES --- */
.shift-row { 
    display: flex; 
    align-items: center; 
    margin-bottom: 2px;
    justify-content: center; /* Par défaut centré */
}

/* Mode Admin : écarter les éléments */
body.admin-mode .shift-row {
    justify-content: space-between;
}

.duration { font-size: 0.8rem; color: #888; border-top: 1px solid #333; padding-top: 5px; }
.delete-btn { color: var(--danger-color); cursor: pointer; font-weight: bold; margin-left: 5px; }

/* --- STATISTIQUES --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}
.stat-card {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}
/* Couleurs cartes */
.card-blue { background-color: #2980b9; }
.card-green { background-color: #27ae60; }
.card-purple { background-color: #8e44ad; }
.card-orange { background-color: #d35400; }
.card-teal { background-color: #16a085; }
.card-red { background-color: #c0392b; }
.card-gold { background-color: #b7950b; }

.stat-value { font-size: 1.5rem; font-weight: bold; }
.stat-label { font-size: 0.8rem; opacity: 0.8; margin-top: 5px; }

/* --- AUJOURD'HUI --- */
.today-detail {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.status { padding: 5px 10px; border-radius: 5px; background: #333; font-size: 0.9rem; }
.status.off { color: #aaa; }

/* --- FLÈCHES DE NAVIGATION --- */
.schedule-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
}

.scroll-btn {
    background-color: rgba(30, 30, 30, 0.8);
    color: var(--accent-color);
    border: 1px solid #444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.scroll-btn:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}
.btn-left { left: -20px; }
.btn-right { right: -20px; }

@media (max-width: 600px) {
    .scroll-btn { display: none; }
}

/* --- FOOTER & MODAL --- */
.data-actions { margin-top: 30px; display: flex; gap: 10px; justify-content: center; }
.btn-small { padding: 8px 15px; font-size: 0.8rem; background: #333; color: #aaa; border: 1px solid #444; }
footer { margin-top: 20px; text-align: center; color: #555; font-size: 0.8rem; }

.modal {
    display: none; 
    position: fixed; 
    z-index: 1; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.8); 
}
.modal-content {
    background-color: var(--card-bg);
    margin: 15% auto; 
    padding: 20px; 
    border: 1px solid #444;
    border-radius: 10px;
    width: 90%; 
    max-width: 400px;
    color: white;
}
.close-modal { float: right; font-size: 28px; font-weight: bold; cursor: pointer; }
input, select {
    width: 100%; 
    padding: 10px; 
    margin: 5px 0 15px 0; 
    background: #333; 
    color: white; 
    border: 1px solid #444; 
    border-radius: 5px;
    box-sizing: border-box;
}
.btn-validate { width: 100%; background: var(--success-color); }

/* --- MODE ADMIN --- */
.btn-add, .data-actions, .delete-btn, .close-modal { display: none !important; }

body.admin-mode .btn-add,
body.admin-mode .data-actions,
body.admin-mode .delete-btn,
body.admin-mode .close-modal { display: block !important; }

body.admin-mode .data-actions { display: flex !important; }

/* --- BARRE PROGRESSION --- */
@keyframes stripes {
    0% { background-position: 0 0; }
    100% { background-position: 40px 0; }
}
.progress-container {
    background: #2a2a2a;
    border-radius: 10px;
    height: 18px;
    width: 100%;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
    position: relative;
}
.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.bar-active {
    background: linear-gradient(45deg, #2ecc71 25%, #27ae60 25%, #27ae60 50%, #2ecc71 50%, #2ecc71 75%, #27ae60 75%, #27ae60);
    background-size: 40px 40px;
    animation: stripes 2s linear infinite;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
}
.bar-done { background: linear-gradient(90deg, #3498db, #2980b9); }
.bar-future { background: transparent; }

/* --- LISTE DES SALAIRES --- */
.salary-list {
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
}

.salary-row {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.salary-date { font-weight: bold; color: #ddd; }
.salary-amount { font-weight: bold; color: var(--success-color); font-size: 1.1rem; }

/* Bouton poubelle pour le salaire */
.salary-delete {
    color: var(--danger-color);
    cursor: pointer;
    margin-left: 15px;
    font-size: 1.2rem;
    display: none; /* Caché par défaut */
}

body.admin-mode .salary-delete { display: block; }