/**
 * Modern Admin Interface Styles
 * Design moderne et épuré pour l'espace administrateur
 */

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.page-container {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0;
    min-height: 20vh;
}

.page-connexion {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    min-height: 20vh;
}

/* ========================================
   BARRE DE DÉCONNEXION - MODERNE
   ======================================== */

.logout-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 0;
    margin-bottom: 24px;
}

.id-famille {
    color: #ffffff;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.logout-bar .btn-navigation {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    margin-left: 12px;
}

.logout-bar .btn-navigation:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logout-bar .btn-navigation:active {
    transform: translateY(0);
}

/* ========================================
   MENU LATÉRAL ADMIN - MODERNE
   ======================================== */

.login-container {
    background-color: #ffffff;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    min-width: 320px;
}

.menu-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.menu-list li {
    margin: 0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.menu-list li:hover {
    background-color: #f8f9fa;
    transform: translateX(4px);
}

.menu-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    font-weight: 500;
    color: #1a1a1a;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-list a:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.05);
    border-left-color: #667eea;
}

/* Style pour les icônes emoji */
.menu-list li::before {
    content: '';
}

/* ========================================
   CONTENEURS DE CONTENU
   ======================================== */

.menu_principal {
    padding: 24px;
    width: 360px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page_content {
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
}

/* ========================================
   TITRES ET TEXTES
   ======================================== */

h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.5px;
}

label {
    display: block;
    margin-top: 14px;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

/* ========================================
   FORMULAIRES
   ======================================== */

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: #1a1a1a;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #ffffff;
}

/* ========================================
   BOUTONS
   ======================================== */

button {
    margin-top: 20px;
    width: 100%;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    font-family: inherit;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ========================================
   MESSAGES D'ERREUR
   ======================================== */

.error {
    margin-top: 16px;
    color: #e53e3e;
    font-size: 14px;
    text-align: center;
    font-weight: 500;
    background-color: #fff5f5;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #e53e3e;
}

.error-message {
    color: #e53e3e;
    font-weight: 600;
    margin-bottom: 12px;
    padding: 12px 16px;
    line-height: 1.4;
    font-size: 14px;
    background-color: #fff5f5;
    border-radius: 8px;
    border-left: 3px solid #e53e3e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-message::before {
    content: '⚠️';
    font-size: 18px;
}

/* ========================================
   LAYOUT ADMIN
   ======================================== */

.admin-layout {
    display: flex;
    min-height: 80vh;
    gap: 24px;
    padding: 24px;
    background-color: #f7fafc;
}

.admin-menu {
    width: 280px;
    background-color: #ffffff;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 24px;
}

.admin-content {
    flex: 1;
    padding: 32px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.admin-content a {
    font-weight: 600;
    text-decoration: none;
    color: #667eea;
    transition: color 0.2s ease;
}

.admin-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.admin-content #resultats ul li {
    list-style-type: none;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.admin-content #resultats ul li:last-child {
    border-bottom: none;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .logout-bar {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    .logout-bar .btn-navigation {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .admin-layout {
        flex-direction: column;
        padding: 16px;
    }

    .admin-menu {
        width: 100%;
        position: static;
    }

    .menu_principal {
        width: 100%;
    }

    .login-container {
        width: 100%;
        max-width: 400px;
        padding: 24px;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-container {
    animation: slideIn 0.4s ease-out;
}

.menu-list li {
    animation: slideIn 0.3s ease-out backwards;
}

.menu-list li:nth-child(1) { animation-delay: 0.05s; }
.menu-list li:nth-child(2) { animation-delay: 0.10s; }
.menu-list li:nth-child(3) { animation-delay: 0.15s; }
.menu-list li:nth-child(4) { animation-delay: 0.20s; }
.menu-list li:nth-child(5) { animation-delay: 0.25s; }
.menu-list li:nth-child(6) { animation-delay: 0.30s; }
.menu-list li:nth-child(7) { animation-delay: 0.35s; }
.menu-list li:nth-child(8) { animation-delay: 0.40s; }

/* ========================================
   ÉTAT ACTIF MENU
   ======================================== */

.menu-list a.active {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
    font-weight: 600;
}

.menu-list li:has(a.active) {
    background-color: rgba(102, 126, 234, 0.05);
}

/* ========================================
   BOUTONS HARMONISÉS (PAGES ADMIN)
   ======================================== */

/* Boutons noirs à transformer en gradient */
input[type="button"],
input[type="submit"],
.btn-valide,
.button,
button[type="submit"],
button[type="button"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    font-family: inherit;
    margin: 4px;
}

input[type="button"]:hover,
input[type="submit"]:hover,
.btn-valide:hover,
.button:hover,
button[type="submit"]:hover,
button[type="button"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

input[type="button"]:active,
input[type="submit"]:active,
.btn-valide:active,
.button:active,
button[type="submit"]:active,
button[type="button"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* ========================================
   DROPDOWNS / SELECT MODERNISÉS
   ======================================== */

select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23667eea' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select option {
    padding: 10px;
}

/* ========================================
   TITRES ET SECTIONS
   ======================================== */

h1, h3, h4 {
    color: #1a1a1a;
    font-weight: 600;
    margin-bottom: 20px;
}

h1 {
    font-size: 28px;
    letter-spacing: -0.5px;
}

h3 {
    font-size: 20px;
}

/* ========================================
   FIELDSETS ET LÉGENDES
   ======================================== */

fieldset {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    background-color: #ffffff;
}

legend {
    font-weight: 600;
    color: #667eea;
    padding: 0 10px;
    font-size: 16px;
}
