/* ==================== SGA - STYLES COMPLETS V7.0 ==================== */
/* Variables pour les couleurs */
          // FINAL//
:root {
    --bg-dark-blue: #2c3e50;
    --header-blue: #34495e;
    --button-blue: #3498db;
    --button-green: #27ae60;
    --button-red: #e74c3c;
    --button-gray: #7f8c8d;
    --text-light: #ecf0f1;
    --text-white: white;
    --text-green: #2ecc71;
    --text-orange: #f39c12;
    --text-purple: #9b59b6;
    --text-red: #e74c3c;
    --text-gold: #f1c40f;
    --text-silver: #bdc3c7;
    --text-bronze: #cd7f32;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadein {
    from { bottom: 0; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

@keyframes fadeout {
    from { bottom: 30px; opacity: 1; }
    to { bottom: 0; opacity: 0; }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== STRUCTURE DE BASE ==================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark-blue);
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    background-color: var(--bg-dark-blue);
}

/* ==================== EN-TÊTE ==================== */
.app-header {
    background-color: var(--header-blue);
    color: #ffffff;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.app-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.header-logo .logo-img {
    height: 50px;
    width: auto;
    border-radius: 8px;
}

.header-title h1 {
    font-size: 1.2em;
    margin: 0;
    font-weight: bold;
    color: #ffffff;
}

.header-title #sub-title {
    font-size: 0.85em;
    margin: 5px 0 0;
    color: #ecf0f1;
}

/* ==================== ICÔNE NOTIFICATION ==================== */
.header-notification {
    position: relative;
    cursor: pointer;
    margin-left: auto;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    display: none;
}

/* ==================== PIED DE PAGE ==================== */
.app-footer {
    background-color: #1a252f;
    color: #ecf0f1;
    text-align: center;
    padding: 12px;
    font-size: 0.8em;
    border-top: 1px solid #34495e;
    margin-top: auto;
}

/* ==================== CONTENU PRINCIPAL ==================== */
#main-content {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==================== BOUTONS DE MENU ==================== */
.menu-button-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding: 20px 0;
}

.menu-button {
    width: 90%;
    max-width: 350px;
    padding: 18px 20px;
    font-size: 1.1em;
    font-weight: bold;
    color: #ffffff !important;
    background-color: #3498db !important;
    background: #3498db !important;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    text-align: center;
}

.menu-button:hover {
    background-color: #2980b9 !important;
    background: #2980b9 !important;
    transform: translateY(-2px);
}

.menu-button:active {
    background-color: #21618C !important;
    transform: translateY(0);
}

.menu-button.quit-button {
    background-color: #e74c3c !important;
    background: #e74c3c !important;
}

.menu-button.quit-button:hover { 
    background-color: #c0392b !important;
    background: #c0392b !important;
}

.menu-button.menu-section {
    background: linear-gradient(135deg, #3498db, #2c3e50) !important;
    border-left: 5px solid #f39c12;
}

.menu-button.menu-section:hover {
    background: linear-gradient(135deg, #2980b9, #34495e) !important;
}

.menu-button.back-button {
    background-color: #7f8c8d !important;
    background: #7f8c8d !important;
}

.menu-button.back-button:hover {
    background-color: #6c7a89 !important;
    background: #6c7a89 !important;
}

/* ==================== POPUPS ==================== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.visible {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background-color: var(--bg-dark-blue);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    color: #ffffff;
}

.popup-header {
    background-color: var(--header-blue);
    color: #ffffff;
    padding: 15px 20px;
    margin: -25px -25px 20px -25px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #ffffff;
}

.popup-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.popup-body {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 5px;
    max-height: 60vh;
    color: #ffffff;
}

.popup-body::-webkit-scrollbar {
    width: 8px;
}

.popup-body::-webkit-scrollbar-track {
    background: #34495e;
    border-radius: 4px;
}

.popup-body::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.popup-body::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.popup-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== BOUTONS POPUP ==================== */
.popup-button {
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #ffffff;
}

.popup-button.green { background-color: var(--button-green); }
.popup-button.green:hover { background-color: #229954; }

.popup-button.blue { background-color: var(--button-blue); }
.popup-button.blue:hover { background-color: #2980b9; }

.popup-button.red { background-color: var(--button-red); }
.popup-button.red:hover { background-color: #c0392b; }

.popup-button.gray { background-color: var(--button-gray); }
.popup-button.gray:hover { background-color: #6c7a89; }

.popup-button.orange { background-color: var(--text-orange); }
.popup-button.orange:hover { background-color: #e67e22; }

.popup-button.small {
    padding: 5px 10px;
    font-size: 0.9em;
}

/* ==================== SECTIONS D'INFORMATION ==================== */
.info-section {
    background-color: var(--header-blue);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    color: #ffffff;
}

.info-section h3 {
    color: #ffffff;
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: #ffffff;
    font-size: 0.95em;
}

.info-value {
    color: #ffffff;
    font-weight: bold;
    font-size: 0.95em;
}

.info-value.green { color: var(--text-green); }

/* ==================== FORMULAIRES ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.9em;
}

.form-input {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #34495e;
    background-color: #2c3e50;
    color: #ffffff;
    font-size: 1em;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}

textarea.form-input {
    min-height: 80px;
    resize: vertical;
}

select.form-input option {
    background-color: #2c3e50;
    color: #ffffff;
}

/* ==================== TABLES ==================== */
.classement-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.classement-table th, 
.classement-table td {
    padding: 4px 6px !important;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}

.classement-table th {
    background-color: var(--header-blue);
    font-weight: bold;
    font-size: 0.9em;
    color: #ffffff;
}

.classement-table td {
    font-size: 0.85em;
    color: #ffffff;
}

.classement-table tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

/* ==================== TABLEAU DES SOLDES ==================== */
td input[type="number"] {
    background-color: #2c3e50;
    border: 1px solid #f39c12;
    border-radius: 4px;
    padding: 4px;
    color: white;
    font-weight: bold;
}

/* ==================== RANGS POUR LE CLASSEMENT ==================== */
.rank-1 { 
    color: var(--text-gold); 
    font-weight: bold; 
}
.rank-2 { 
    color: var(--text-silver); 
    font-weight: bold; 
}
.rank-3 { 
    color: var(--text-bronze); 
    font-weight: bold; 
}

/* ==================== PLANNING TABLES ==================== */
.planning-table {
    width: 100%;
    border-collapse: collapse;
}

.planning-table th, 
.planning-table td {
    padding: 4px 6px !important;
    text-align: center;
    border: 1px solid #2c3e50;
    vertical-align: middle;
    font-size: 0.8rem;
}

.planning-table th {
    background-color: #34495e;
    color: #ffffff;
    font-weight: bold;
    min-width: 40px;
}

.planning-table td {
    color: #ffffff;
}

.planning-table th.holiday {
    background-color: #e74c3c;
    color: #ffffff;
}

.planning-table td.holiday {
    background-color: rgba(231, 76, 60, 0.2);
}

/* ==================== CELLULES DE SHIFT ==================== */
.shift-cell {
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
    min-width: 35px;
    height: 35px;
    color: #ffffff;
}

.shift-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* ==================== BADGES DE STATUT ==================== */
.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block;
    color: #ffffff;
}

.status-badge.active {
    background-color: #27ae60;
}

.status-badge.inactive {
    background-color: #e74c3c;
}

.status-badge.warning {
    background-color: #f39c12;
}

/* ==================== BOUTONS D'ACTION ==================== */
.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin: 0 2px;
    transition: background-color 0.2s;
    color: #ffffff;
}

.action-btn.small {
    padding: 2px 5px !important;
    font-size: 0.7rem !important;
}

.action-btn.blue {
    background-color: #3498db;
}

.action-btn.blue:hover {
    background-color: #2980b9;
}

.action-btn.green {
    background-color: #27ae60;
}

.action-btn.green:hover {
    background-color: #229954;
}

.action-btn.red {
    background-color: #e74c3c;
}

.action-btn.red:hover {
    background-color: #c0392b;
}

.action-btn.orange {
    background-color: #f39c12;
}

.action-btn.orange:hover {
    background-color: #e67e22;
}

/* ==================== BARRES DE PROGRESSION ==================== */
.progress-bar-container {
    margin-bottom: 10px;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    margin-bottom: 3px;
    color: #ffffff;
}

.progress-bar-wrapper {
    background-color: var(--header-blue);
    border-radius: 5px;
    height: 12px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

/* ==================== GRILLES ET CARTES ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: #34495e;
    border-radius: 8px;
    padding: 8px !important;
    text-align: center;
    color: #ffffff;
}

.stat-value {
    font-size: 1.5rem !important;
    font-weight: bold;
    color: #3498db;
    margin: 10px 0;
}

.stat-label {
    color: #ffffff;
    font-size: 0.9em;
}

/* ==================== TABLEAU DE BORD (DASHBOARD) ==================== */
.dashboard {
    padding: 20px;
}

.dashboard-cards {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
}

.card {
    background: #ecf0f1 !important;  /* fond blanc cassé */
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    min-width: 150px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #2c3e50 !important;  /* texte bleu foncé */
}

.card-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #3498db !important;  /* chiffres en bleu vif */
}

.dashboard-section {
    background: #2c3e50;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.dashboard-section h3 {
    margin-top: 0;
    color: #ffffff;
}

/* ==================== NOTIFICATIONS ==================== */
.notification-unread {
    background-color: rgba(231, 76, 60, 0.2);
    font-weight: bold;
}

/* ==================== SNACKBAR ==================== */
#snackbar {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 3000;
    left: 50%;
    bottom: 30px;
    font-size: 0.9em;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#snackbar.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

/* ==================== FORCE LES COULEURS ==================== */
.form-group label,
label {
    color: #ffffff !important;
}

select.form-input,
select,
.form-input select,
select option,
.form-input option {
    color: #ffffff !important;
    background-color: #2c3e50 !important;
}

input, textarea, .form-input {
    color: #ffffff !important;
}

h2, h3, h4, .popup-header h2, .info-section h3 {
    color: #ffffff !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
    #app-container {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
    }
    
    .dashboard-cards {
        gap: 10px;
    }
    
    .card {
        min-width: 120px;
        padding: 15px;
    }
    
    .card-value {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 10px;
    }
    
    .user-info {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .header-logo .logo-img {
        height: 40px;
    }
    
    .header-title h1 {
        font-size: 1em;
    }
    
    .header-title #sub-title {
        font-size: 0.7em;
    }
    
    .menu-button {
        padding: 15px 10px;
        font-size: 1em;
        width: 95%;
    }
    
    .popup-content {
        padding: 15px;
        width: 95%;
    }
    
    .popup-header {
        margin: -15px -15px 15px -15px;
    }
    
    .popup-header h2 {
        font-size: 1.1em;
    }
    
    .popup-footer {
        padding-top: 15px;
        margin-top: 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .popup-footer button {
        width: 100%;
    }
    
    .planning-table {
        font-size: 0.7em;
    }
    
    .planning-table th,
    .planning-table td {
        padding: 4px 2px;
    }
    
    .shift-cell {
        min-width: 30px;
        height: 30px;
        font-size: 0.9em;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 1.5em;
    }
    
    .classement-table th,
    .classement-table td {
        padding: 6px 4px;
        font-size: 0.75em;
    }
}

@media (max-width: 380px) {
    .planning-table {
        font-size: 0.6em;
    }
    
    .planning-table th,
    .planning-table td {
        padding: 3px 1px;
    }
    
    .shift-cell {
        min-width: 25px;
        height: 25px;
        font-size: 0.8em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .card {
        width: 100%;
        max-width: 250px;
    }
}

/* ==================== IMPRESSION ==================== */
@media print {
    .menu-button-container,
    .menu-button,
    .action-btn,
    .popup-button,
    button {
        display: none !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .planning-table,
    .classement-table {
        border: 1px solid #ccc;
    }
    
    .planning-table th,
    .classement-table th {
        background-color: #eee;
        color: black;
    }
    
    .planning-table td,
    .classement-table td {
        border: 1px solid #ccc;
        color: black;
    }
}
