/* Import des styles de base */
@import url('../style.css');

/* ============================================
   NAVBAR (header.php)
   ============================================ */
.navbar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    border-bottom: 3px solid var(--norm);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-logo {
    height: 50px;
    max-height: 50px;
}

.navbar-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--evid);
    margin: 0;
    white-space: nowrap;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-link {
    color: var(--norm);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.navbar-link:hover {
    background-color: var(--norm);
    color: white;
}

.navbar-link.logout {
    background-color: var(--evid);
    color: white;
}

.navbar-link.logout:hover {
    background-color: #1a1640;
}

.navbar-username-box {
    color: var(--evid);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    background-color: #f1f0e0;
    border: 2px solid var(--norm);
    border-radius: 6px;
    white-space: nowrap;
}

.navbar-username-box.small-text {
    font-size: 0.65rem;
    padding: 0.4rem 0.8rem;
}

/* Espace pour compenser la barre fixe */
body.has-navbar {
    padding-top: 70px;
}

@media (max-width: 768px) {
    .navbar-fixed {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
    }
    
    .navbar-logo {
        height: 40px;
    }
    
    .navbar-title {
        font-size: 1rem;
    }
    
    .navbar-right {
        gap: 0.75rem;
    }
    
    .navbar-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    body.has-navbar {
        padding-top: 80px;
    }
}

/* ============================================
   LOGIN (login.php)
   ============================================ */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem 1rem;
}

.login-box {
    width: 100%;
    max-width: 450px;
    border-top: 4px solid var(--norm);
    border-left: 4px solid var(--norm);
    border-radius: 1rem;
    padding: 2rem;
    background-color: white;
    box-shadow: 0.2rem 1rem 0.5rem var(--norm);
}

.alert {
    background: #ffebee;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #ef9a9a;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    border: 2px solid var(--evid);
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

.login-box input[type="text"]:focus,
.login-box input[type="password"]:focus {
    outline: none;
    border-color: var(--norm);
}

.login-box label {
    font-weight: bold;
    color: var(--evid);
    display: block;
    margin-bottom: 5px;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-image: linear-gradient(var(--norm), var(--evid));
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.logo-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-header img {
    max-height: 100px;
    margin-bottom: 1rem;
}

.logo-header h2 {
    color: var(--evid);
    background: none;
    padding: 0;
    margin: 0;
    font-size: 2rem;
}

.forgot-password-link {
    text-align: center;
    margin-top: 20px;
}

.forgot-password-link a {
    color: var(--norm);
    text-decoration: none;
    font-size: 0.9rem;
}

.forgot-password-link a:hover {
    text-decoration: underline;
}

/* ============================================
   LOGOUT (logout.php)
   ============================================ */
body.logout-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.logout-content {
    text-align: center;
}

.logout-content img {
    max-height: 150px;
    margin-bottom: 2rem;
}

.logout-content h1 {
    color: var(--evid);
    font-size: 2.5rem;
    margin: 0;
}

/* ============================================
   FORMULAIRES (edit_user.php, creer_admin.php, creer_implantation.php, reset_password.php)
   ============================================ */
.edit-form-container,
.create-form-container,
.reset-container,
.delete-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.reset-container {
    max-width: 600px;
}

.delete-container {
    max-width: 600px;
}

.edit-form,
.create-form,
.reset-box,
.delete-box {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    border-top: 4px solid var(--norm);
    border-left: 4px solid var(--norm);
    box-shadow: 0.2rem 1rem 0.5rem var(--norm);
}

.delete-box {
    border-top: 4px solid #d32f2f;
    border-left: 4px solid #d32f2f;
    box-shadow: 0.2rem 1rem 0.5rem rgba(211, 47, 47, 0.3);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--evid);
    margin-bottom: 0.5rem;
}

.form-group label .required {
    color: #d32f2f;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--evid);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--norm);
}

.form-group .help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.btn-cancel {
    background-color: #757575;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background-color: #616161;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.password-display {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--evid);
    text-align: center;
    margin: 1rem 0;
    word-break: break-all;
}

.password-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.password-actions button {
    flex: 1;
}

.btn-danger {
    background-color: #d32f2f;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

/* ============================================
   GESTION USERS (gestion_users.php)
   ============================================ */
.users-table-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.users-table thead {
    background-image: linear-gradient(var(--norm), var(--evid));
    color: white;
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 1rem;
}

.users-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    color: var(--evid);
}

.users-table tbody tr:hover {
    background-color: #f5f5f5;
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.role-admin {
    background-color: #ff9800;
    color: white;
}

.role-superadmin {
    background-color: #d32f2f;
    color: white;
}

.role-implantation {
    background-color: #1976d2;
    color: white;
}

.role-user {
    background-color: #757575;
    color: white;
}

.actions-column {
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-action {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-action:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--evid);
}

@media (max-width: 768px) {
    .users-table-container {
        overflow-x: auto;
    }
    
    .users-table {
        min-width: 600px;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   ADMIN SECTION (index.php)
   ============================================ */
.admin-sections-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .admin-sections-wrapper {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
    }
}

.admin-section {
    flex: 1;
    max-width: 400px;
    min-width: 300px;
    padding: 0;
}

/* Centrer l'encart s'il est seul */
.admin-section:only-child {
    flex: 0 0 auto;
    margin: 0 auto;
    max-width: 400px;
}

@media (min-width: 768px) {
    .admin-section:only-child {
        max-width: 400px;
    }
}

.admin-box {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    border-top: 4px solid var(--norm);
    border-left: 4px solid var(--norm);
    box-shadow: 0.2rem 1rem 0.5rem var(--norm);
}

.admin-box h2 {
    color: var(--evid);
    margin-top: 0;
}

.admin-box p {
    color: var(--norm);
    margin-bottom: 1.5rem;
}

.admin-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-links a {
    display: block;
    background-image: linear-gradient(var(--norm), var(--evid));
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.admin-links a:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ============================================
   SEND PASSWORD EMAIL (send_password_email.php)
   ============================================ */
.send-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.send-box {
    background-color: white;
    padding: 2rem;
    border-radius: 1rem;
    border-top: 4px solid var(--norm);
    border-left: 4px solid var(--norm);
    box-shadow: 0.2rem 1rem 0.5rem var(--norm);
}

.user-info {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

/* ============================================
   MODIFICATIONS DES H2
   ============================================ */
h2 {
    font-size: 1.8rem;
    color: var(--evid);
    padding: 0.2cm 0 0.2cm 0.2cm;
    background: none !important;
    background-image: none !important;
}

/* ============================================
   BOUTONS COMMUNS
   ============================================ */
.btn-link {
    display: inline-block;
    padding: 12px 24px;
    background-image: linear-gradient(var(--norm), var(--evid));
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s;
}

.btn-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
