/* ============================================
   ADMIN STYLES - Styles pour l'interface admin
   ============================================ */

body { 
    font-family: Arial, sans-serif; 
    padding: 20px; 
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ========== PAGE DE CONNEXION ========== */
.password-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.password-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.password-box h2 {
    margin-top: 0;
    color: #333;
    margin-bottom: 10px;
}

.password-box p {
    color: #666;
    margin-bottom: 25px;
}

.password-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.password-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.password-submit {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.password-submit:hover {
    background-color: #45a049;
}

.error-message {
    color: #f44336;
    margin-top: 15px;
    display: none;
}

/* ========== ANIMATIONS ========== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== CONTAINER PRINCIPAL ========== */
.container {
    display: block;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ========== HEADER ADMIN ========== */
.admin-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.admin-header h1 { 
    margin: 0; 
    color: #333; 
    text-align: center; 
}

.logout-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 0 16px;
    height: 40px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-header .logout-btn {
    width: auto !important;
    flex: 0 0 auto;
    white-space: nowrap;
}

.logout-btn:hover { 
    background-color: #da190b; 
}

/* ========== TABLEAUX ========== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0 auto;
}

table thead {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

table th, table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table tbody tr:hover { 
    background-color: #f9f9f9; 
}

table tbody tr:nth-child(even) { 
    background-color: #f5f5f5; 
}

.status-message {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    color: #666;
    text-align: center;
}

/* ========== MODE MOBILE POUR TABLEAU ========== */
@media screen and (max-width: 768px) {
    /* Masquer le tableau classique sur mobile */
    #pointageTable thead,
    #statsTable thead {
        display: none;
    }
    
    #pointageTable tbody tr,
    #statsTable tbody tr {
        display: block;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 15px;
        background: white;
        border: none;
    }
    
    #pointageTable tbody td,
    #statsTable tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border: none;
        text-align: right;
        gap: 10px;
    }
    
    #pointageTable tbody td::before,
    #statsTable tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #667eea;
        flex-shrink: 0;
        text-align: left;
        min-width: 100px;
    }
    
    /* Style spécial pour la dernière colonne (checkbox) */
    #pointageTable tbody td:last-child {
        justify-content: center;
        padding-top: 15px;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }
    
    #pointageTable tbody td:last-child::before {
        content: '';
        min-width: 0;
    }
    
    /* Masquer les lignes de détails imbriqués sur mobile */
    #statsTable tbody tr[style*="background:#f8f9fa"] {
        display: none;
    }
}

/* ========== MENU HOME ========== */
.home-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 70px 20px 20px;
    background: #f5f5f5;
}

.home-header {
    text-align: center;
    color: #333;
    margin-bottom: 50px;
}

.home-header h1 {
    font-size: 3em;
    margin: 0 0 10px 0;
    color: #333;
}

.home-header h1 .gradient-text,
.admin-header h1 .gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-header p {
    font-size: 1.2em;
    color: #666;
    margin: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    width: 100%;
}

.menu-card {
    background: white;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.menu-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--card-color-1), var(--card-color-2));
}

.menu-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.menu-card.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.menu-card.disabled:hover {
    transform: translateY(-3px);
}

.menu-card-icon {
    font-size: 4em;
    margin-bottom: 20px;
    display: block;
}

.menu-card h2 {
    font-size: 1.5em;
    margin: 0 0 15px 0;
    color: #333;
}

.menu-card p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
}

.menu-card .badge {
    display: inline-block;
    background: #ff9800;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    margin-top: 15px;
}

/* Couleurs personnalisées pour chaque carte */
.menu-card:nth-child(1) {
    --card-color-1: #4CAF50;
    --card-color-2: #45a049;
}

.menu-card:nth-child(2) {
    --card-color-1: #9c27b0;
    --card-color-2: #7b1fa2;
}

.menu-card:nth-child(3) {
    --card-color-1: #FF9800;
    --card-color-2: #F57C00;
}

.menu-card:nth-child(4) {
    --card-color-1: #2196F3;
    --card-color-2: #1976D2;
}

.menu-card:nth-child(5) {
    --card-color-1: #FF5722;
    --card-color-2: #E64A19;
}

.menu-card:nth-child(6) {
    --card-color-1: #FFC107;
    --card-color-2: #FFA000;
}

/* ========== RESPONSIVE ========== */
@media screen and (max-width: 1024px) {
    .home-header h1 {
        font-size: 2.5em;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        padding: 0 20px;
    }
}

@media screen and (max-width: 768px) {
    body { padding: 10px; }
    table th, table td { padding: 8px; font-size: 14px; }
    .admin-header { 
        flex-direction: column; 
        padding: 15px;
    }
    
    .admin-header h1 {
        font-size: 1.5em;
        text-align: center;
    }
    
    .admin-header > div {
        width: 100%;
        justify-content: center !important;
        flex-wrap: wrap;
    }
    
    .admin-container {
        padding: 60px 10px 10px !important;
    }
    
    .status-message {
        font-size: 0.9em;
        padding: 10px;
    }
    
    /* Masquer le tableau classique sur mobile */
    #pointageTable thead {
        display: none;
    }
    
    #pointageTable tbody tr {
        display: block;
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        padding: 15px;
        background: white;
        border: none;
    }
    
    #pointageTable tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border: none;
        text-align: right;
        gap: 10px;
    }
    
    #pointageTable tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #667eea;
        flex-shrink: 0;
        text-align: left;
        min-width: 100px;
    }
    
    /* Style spécial pour la dernière colonne (checkbox) */
    #pointageTable tbody td:last-child {
        justify-content: center;
        padding-top: 15px;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }
    
    #pointageTable tbody td:last-child::before {
        content: '';
        min-width: 0;
    }
    
    .home-container {
        padding: 60px 15px 20px;
    }
    
    .home-header {
        margin-bottom: 30px;
    }
    
    .home-header h1 {
        font-size: 2em;
    }
    
    .home-header p {
        font-size: 1em;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
        max-width: 500px;
    }
    
    .menu-card {
        padding: 30px 20px;
    }
    
    .menu-card-icon {
        font-size: 3em;
    }
    
    .menu-card h2 {
        font-size: 1.3em;
    }
    
    .back-btn {
        padding: 6px 10px !important;
        font-size: 14px !important;
    }
}

@media screen and (max-width: 480px) {
    table th, table td { padding: 6px; font-size: 12px; }
    
    .home-container {
        padding: 60px 10px 15px;
    }
    
    .home-header h1 {
        font-size: 1.6em;
    }
    
    .home-header p {
        font-size: 0.9em;
    }
    
    .menu-card {
        padding: 25px 15px;
    }
    
    .menu-card-icon {
        font-size: 2.5em;
        margin-bottom: 15px;
    }
    
    .menu-card h2 {
        font-size: 1.1em;
        margin-bottom: 10px;
    }
    
    .menu-card p {
        font-size: 0.85em;
    }
}
