/* public/style.css - Mobile Web App Theme */

:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary-color: #008c93;
    --primary-hover: #007177;
    --danger-color: #ef4444;
    --success-color: #08aa31;
    --danger-hover: #dc2626;
    --border-color: #333333;
    --radius: 0px;
    --transition: all 0.2s ease-in-out;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--surface-color);
    padding: 25px;
    border-radius: var(--radius);
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    position: relative;
    /* Remove box shadow to make it more subtle */
}

/* Flex utilities */
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.center-header {
    justify-content: center;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-title {
    margin: 0;
    line-height: 1;
}

/* Typography */
h2, h3, h4 {
    margin-top: 25px;
    color: #fff;
    font-weight: 600;
}

h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; color: var(--text-muted); }

/* Logo */
.app-logo {
    max-width: 150px;
    display: block;
    margin: 0 auto 25px auto;
}

.dashboard-logo {
    max-width: 100px;
}

/* Form Elements */
label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

select, .champ, textarea {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: #2b2b2b;
    color: var(--text-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    transition: var(--transition);
}

select:focus, .champ:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Lists */
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    display: flex;
    padding: 0;
    overflow: hidden;
    background: #222222;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.li-timeline {
    display: flex;
    padding: 0;
    overflow: hidden;
    margin-bottom: 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.li-content {
    flex: 1;
    padding: 15px;
}

.btn-transfer {
    background: #096b00;
    color: #212529;
    border: none;
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-transfer i {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.btn-transfer:hover {
    background: #085c00;
}

.btn-pause {

    background: #dbb131;
    color: #212529;
    border: none;
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-pause i {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.btn-pause:hover {
    background: #b8921f;
}


.btn-finish {
    background: rgba(255, 19, 19, 0.2);
    color: #EF4444;
    border: none;
    border-left: 1px solid var(--border-color);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-finish i {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.btn-finish:hover {
    background: rgba(255, 19, 19, 0.4);
}

/*li:hover {
    background: #1d1d1d;
}*/

li strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 5px;
    color: #fff;
}

li small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.greyed {
    opacity: 0.5;
    background: #1a1a1a;
}

/* Buttons */
button, .btn-blue, .btn-logout {
    font-family: inherit;
    transition: var(--transition);
}

.btn-erase{
    font-family: inherit;
    transition: var(--transition);
}

.btn-logout {
    color: var(--danger-color);
    text-decoration: none;
    font-weight: bold;
    border: 1px solid var(--danger-color);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    background-color: transparent;
    margin-top: 15px;
    width: 100%;
    cursor: pointer;
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.btn-blue {
    margin-top: 25px;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

.btn-blue:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-blue:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}



.close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: var(--text-muted);
    transition: var(--transition);
}

.close-btn:hover {
    color: #fff;
}

.error {
    color: var(--danger-color);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 500;
    background: rgb(43, 43, 43);
    border: 3px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius);
    z-index: 9999; /* S'assure que le message passe par-dessus le reste du site */
}

.success {
    color: var(--success-color);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-weight: 500;
    background: rgb(43, 43, 43);
    border: 3px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius);
    z-index: 9999; /* S'assure que le message passe par-dessus le reste du site */
}

/* Digicode */
.digicode {
    display: grid;
    /* minmax(0, 1fr) force les colonnes à être STRICTEMENT de la même taille, peu importe le contenu */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* grid-auto-rows force toutes les lignes à faire exactement la même hauteur (ajustez les 60px selon vos goûts) */
    grid-auto-rows: 60px; 
    gap: 10px;
    margin-bottom: 20px;
    
    /* Optionnel mais recommandé : limiter la largeur max pour éviter un digicode géant sur PC */
    max-width: 350px; 
    margin-left: auto;
    margin-right: auto;
}

.digicode button {
    width: 100%;
    height: 100%; /* Le bouton prend 100% de la case de 60px imposée par la grille */
    margin: 0;
    padding: 0; /* Retire les paddings internes qui créent des décalages */
    
    /* Centrage parfait du contenu (chiffre ou icône) */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Taille de police unique pour que les icônes et les chiffres aient les mêmes proportions */
    font-size: 1.5rem; 
}

.digicode button:hover {
    background-color: #383838;
}

.digicode button:active {
    background-color: #444444;
    transform: scale(0.95);
}

.digicode button.btn-clear {
    color: var(--danger-color);
}

/* Empty States & Loader */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.loader {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Grid layout for 4 action buttons */
.li-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 140px;
    border-left: 1px solid var(--border-color);
}

.li-actions-grid button {
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    background: #2b2b2b;
    color: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.70rem;
    transition: var(--transition);
}

.li-actions-grid button:last-child {
    border-bottom: none;
}
.li-actions-grid button:nth-child(3) {
    border-bottom: none;
}

.btn-delete { color: var(--danger-color) !important; }
.btn-delete:hover { background: #3a1a1a !important; }

.btn-report { color: #fd7e14 !important; }
.btn-report:hover { background: #3f2a1a !important; }

.btn-pause-action { color: #0dcaf0 !important; }
.btn-pause-action:hover { background: #1a3a3a !important; }

.btn-transfer { color: #8e44ad !important; }
.btn-transfer:hover { background: #2a1a3a !important; }

/* Special states */
.btn-reprise { background: #198754 !important; color: white !important; }
.btn-reprise:hover { background: #157347 !important; }

.btn-disabled { opacity: 0.4; cursor: not-allowed !important; pointer-events: none; }
