/* ============================================================================
   Copyright (c) 2026 Vanneçon Alexandre / Razamelpar. Tous droits réservés.
   ============================================================================ */

/* ==================== VARIABLES GLOBALES ==================== */
:root {
    --corporate-dark: #002C5E;
    --lafarge-green: #00925A;
    --accent-gray: #A6AAAE;
    --text-color: #333333;
    --tile-background: rgba(255, 255, 255, 0.95);
}

.hidden { display: none !important; }

/* ==================== BASE ==================== */
body {
    background-image: url('https://www.lafarge.fr/sites/france/files/images/image_lafargeholcim_investit_3_millions_deuros_dans_une_nouvelle_generation_de_centrale_a_beton_a_toulouse.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center center;
    font-family: 'Open Sans', 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
}

/* ==================== EN-TÊTE ==================== */
header {
    background-color: white;
    color: var(--corporate-dark);
    padding: 15px 40px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-bottom: 5px solid var(--lafarge-green);
}

.logo, .logo2 { position: absolute; height: 50px; object-fit: contain; }
.logo  { left: 40px; }
.logo2 { right: 40px; }

.header-content { text-align: center; }
header h1 { font-size: 1.8em; margin: 0; min-height: 1.2em; }
header h3 { font-size: 1.1em; margin: 2px 0; font-weight: normal; }

/* --- Horloge (remplace l'ancien nom) --- */
#clock { margin-top: 2px; }
#clock-time {
    display: block;
    font-size: 1.15em;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
#clock-date {
    display: block;
    font-size: 0.75em;
    opacity: 0.7;
}

/* ==================== ÉCRAN DE CONNEXION ==================== */
#login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-card {
    background: white;
    border-top: 5px solid var(--lafarge-green);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    padding: 40px 45px;
    text-align: center;
    width: min(400px, 92vw);
    box-sizing: border-box;
}

.login-card h2 { color: var(--corporate-dark); margin: 0 0 8px 0; }
.login-card > p { color: var(--text-color); margin: 0; }

#login-form { text-align: left; margin-top: 25px; }

#login-form label {
    display: block;
    font-size: 0.85em;
    font-weight: bold;
    color: var(--corporate-dark);
    margin-bottom: 14px;
}

#login-form input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
    padding: 10px 12px;
    font-size: 1em;
    font-family: inherit;
    border: 1px solid var(--accent-gray);
    border-radius: 6px;
    letter-spacing: 0.05em;
}

#login-form input:focus {
    outline: none;
    border-color: var(--lafarge-green);
    box-shadow: 0 0 0 2px rgba(0, 146, 90, 0.2);
}

.btn-block {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    font-size: 1em;
}

#login-submit:disabled { opacity: 0.6; cursor: wait; }

.login-error {
    color: #c62828;
    font-size: 0.9em;
    min-height: 1.2em;
    margin: 15px 0 0 0;
    text-align: center;
}

/* ==================== GRILLE DE RACCOURCIS ==================== */
#main-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding-bottom: 50px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 40px;
    width: 90%;
    max-width: 1200px;
    z-index: 10;
}

.tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 90px;
    text-decoration: none;
    background-color: var(--tile-background);
    border: 1px solid var(--accent-gray);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-color: var(--lafarge-green);
}

.tile i { font-size: 3.5em; color: var(--lafarge-green); margin-bottom: 15px; }
.tile img.tile-image { width: 70px; height: 70px; object-fit: contain; margin-bottom: 15px; }
.tile span { font-weight: bold; color: var(--text-color); text-align: center; }

/* ==================== POST-IT LATÉRAUX ==================== */
.sidebar {
    position: fixed;
    top: 160px;
    width: 230px;
    z-index: 1000;
}

#sidebar-left  { left: 0; }
#sidebar-right { right: 0; }

.post-it {
    padding: 12px;
    margin-bottom: 5px;
    border-left: 5px solid var(--lafarge-green);
    background-color: white;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: outline 0.15s ease;
}

#sidebar-right .post-it {
    border-left: none;
    border-right: 5px solid var(--lafarge-green);
    border-radius: 4px 0 0 4px;
}

.post-it:hover { outline: 2px dashed var(--lafarge-green); outline-offset: 2px; }

.post-it h4 { margin: 0; font-size: 0.9em; color: var(--corporate-dark); }
.post-it p {
    font-size: 0.8em;
    margin: 8px 0 0 0;
    white-space: pre-line; /* les retours à la ligne du contenu sont respectés */
}

/* Post-it vide (emplacement libre) */
.post-it.empty {
    border-left-style: dashed;
    background-color: rgba(255, 255, 255, 0.75);
    opacity: 0.8;
}
#sidebar-right .post-it.empty { border-right-style: dashed; }
.post-it.empty h4 { color: var(--accent-gray); font-weight: normal; }
.post-it.empty p { font-style: italic; color: #888; }

/* ==================== MODALE D'ÉDITION ==================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.modal {
    background: white;
    border-top: 5px solid var(--lafarge-green);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 25px 30px;
    width: min(420px, 92vw);
}

.modal h3 { color: var(--corporate-dark); margin: 0 0 18px 0; font-size: 1.1em; }

.modal label {
    display: block;
    font-size: 0.85em;
    font-weight: bold;
    color: var(--corporate-dark);
    margin-bottom: 14px;
}

.modal input[type="text"],
.modal textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 5px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.95em;
    border: 1px solid var(--accent-gray);
    border-radius: 6px;
}

.modal textarea { resize: vertical; }
.modal input:focus, .modal textarea:focus {
    outline: none;
    border-color: var(--lafarge-green);
    box-shadow: 0 0 0 2px rgba(0, 146, 90, 0.2);
}

#color-palette { margin-top: 6px; }

.swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--accent-gray);
    margin-right: 8px;
    cursor: pointer;
    padding: 0;
}

.swatch.selected { border: 3px solid var(--corporate-dark); transform: scale(1.15); }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 5px; }

.btn {
    padding: 9px 20px;
    border: 1px solid var(--accent-gray);
    border-radius: 6px;
    background: white;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95em;
    cursor: pointer;
}

.btn.primary { background: var(--lafarge-green); border-color: var(--lafarge-green); color: white; }
.btn:hover { opacity: 0.85; }

/* ==================== TOAST (confirmation) ==================== */
#toast {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--lafarge-green);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 0.9em;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 4000;
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================== DÉCONNEXION ==================== */
#logout-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--accent-gray);
    background: var(--tile-background);
    color: var(--corporate-dark);
    font-size: 1em;
    cursor: pointer;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1500;
}

#logout-btn:hover { color: #c62828; border-color: #c62828; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
    .sidebar { display: none !important; }
}