/* ==============================================================================
   STYLESHEET POUR L'INTERFACE D'ADMINISTRATION - INNOV ACADÉMIE
   ============================================================================== */

:root {
    --primary-color: rgb(46, 44, 128); /* innov-blue */
    --secondary-color: #f38500; /* innov-orange */
    --light-gray: #f4f7fa;
    --medium-gray: #e2e8f0;
    --dark-gray: #4a5568;
    --text-color: #2d3748;
    --white: #ffffff;
    --danger-color: #e53e3e;
    --success-color: #48bb78;
    --warning-color: #f6e05e;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background-color: var(--light-gray); color: var(--text-color); margin: 0; font-size: 16px; }

/* --- Page de Connexion --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    animation: gradient-animation 10s ease infinite;
    background-size: 200% 200%;
    position: relative;
    overflow: hidden;
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1;
}

.login-box h1 {
    color: var(--white);
    margin-bottom: 0.5rem;
    font-size: 2rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.login-box p {
    color: #e2e8f0; /* light-gray */
    margin-bottom: 2rem;
    font-weight: 500;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    position: relative;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.login-form input[type="text"], .login-form input[type="password"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.2);
    color: var(--white);
}

.login-form input[type="text"]::placeholder, .login-form input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.login-form input[type="text"]:focus, .login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: rgba(0,0,0,0.25);
    box-shadow: 0 0 0 3px rgba(243, 133, 0, 0.4);
}

.btn-login {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 8px;
    background-color: var(--secondary-color);
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
}

.btn-login:hover {
    background-color: #ff9d29; /* Lighter orange */
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(243, 133, 0, 0.4);
}

.login-error {
    background-color: rgba(229, 62, 62, 0.8);
    color: var(--white);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* --- Styles généraux de l'admin --- */
.admin-wrapper { display: flex; position: relative; }
.sidebar { width: 250px; background-color: var(--primary-color); color: var(--white); min-height: 100vh; position: fixed; display: flex; flex-direction: column; z-index: 1000; transition: transform 0.3s ease-in-out; }
.main-content { margin-left: 250px; width: calc(100% - 250px); padding: 2rem; transition: margin-left 0.3s ease-in-out; }
.sidebar-header { padding: 1.5rem; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.sidebar-logo { max-width: 80px; margin-bottom: 1rem; }
.sidebar-header h2 { margin: 0; font-size: 1.5rem; }
.sidebar-header span { font-size: 0.9rem; color: var(--medium-gray); }
.sidebar-nav { flex-grow: 1; }
.sidebar-nav ul { list-style-type: none; padding: 0; margin: 0; }
.sidebar-nav a { display: block; color: var(--white); text-decoration: none; padding: 1rem 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); transition: background-color 0.3s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background-color: rgba(255, 255, 255, 0.15); }
.sidebar-nav a i { margin-right: 10px; width: 20px; text-align: center; }
.logout-section { margin-top: auto; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header h1 { margin: 0; font-size: 1.8rem; }
.mobile-nav-toggle { display: none; background: none; border: none; color: var(--primary-color); font-size: 1.5rem; cursor: pointer; }
.btn-primary-add { background-color: var(--secondary-color); color: var(--white); padding: 0.7rem 1.2rem; border-radius: 5px; text-decoration: none; font-weight: 600; transition: background-color 0.3s; }
.btn-primary-add:hover { background-color: #d17300; }
.dashboard-card { background-color: var(--white); padding: 2rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); overflow-x: auto; }

/* --- Styles pour les tables --- */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; min-width: 600px; }
table th, table td { padding: 0.9rem; text-align: left; border-bottom: 1px solid var(--medium-gray); }
table th { font-weight: 600; background-color: var(--light-gray); }
table tbody tr:hover { background-color: #f8fafc; }
.actions { white-space: nowrap; }
.actions a { color: var(--dark-gray); text-decoration: none; margin-right: 15px; font-size: 1.1rem; }
.actions a:last-child { margin-right: 0; }
.btn-action.btn-edit:hover { color: var(--primary-color); }
.btn-action.btn-delete:hover { color: var(--danger-color); }

/* --- Badges de Statut --- */
.status-badge { padding: 0.3rem 0.7rem; border-radius: 15px; font-size: 0.8rem; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.status-published { background-color: #c6f6d5; color: #2f855a; }
.status-draft { background-color: #fed7d7; color: #c53030; }
.status-featured { background-color: #feebc8; color: #9c4221; }

/* --- Messages d'alerte --- */
.alert { padding: 1rem; margin-bottom: 1.5rem; border-radius: 5px; border: 1px solid transparent; }
.alert-success { background-color: #c6f6d5; color: #2f855a; border-color: #9ae6b4; }
.alert-danger { background-color: #fed7d7; color: #c53030; border-color: #fbb6b6; }

/* --- Styles pour les formulaires --- */
.form-group { margin-bottom: 1.5rem; }
label { display: block; margin-bottom: 0.5rem; font-weight: 600; }
input[type="text"], input[type="password"], textarea, select { width: 100%; padding: 0.8rem 1rem; border: 1px solid var(--medium-gray); border-radius: 5px; font-size: 1rem; box-sizing: border-box; transition: border-color 0.3s; font-family: inherit; }
input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus { outline: none; border-color: var(--secondary-color); box-shadow: 0 0 0 2px rgba(243, 133, 0, 0.2); }
textarea { min-height: 250px; }
.article-form small { color: var(--dark-gray); font-size: 0.85rem; margin-top: 0.5rem; display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.current-image { margin-top: 1rem; }
.current-image p { font-weight: 600; margin-bottom: 0.5rem; }
.current-image img { border-radius: 5px; border: 1px solid var(--medium-gray); max-width: 200px; height: auto; }
.form-actions { margin-top: 2rem; border-top: 1px solid var(--medium-gray); padding-top: 1.5rem; display: flex; justify-content: flex-end; align-items: center; }
.back-link { color: var(--dark-gray); text-decoration: none; font-weight: 600; margin-right: 1rem; }
.back-link:hover { text-decoration: underline; }

/* --- Mise en page Formulaire + Table --- */
.form-and-table-layout { display: grid; grid-template-columns: 350px 1fr; gap: 2rem; }
.form-column { /* Le formulaire */ }
.table-column { /* Le tableau */ }

/* ==============================================================================
   STYLES RESPONSIVES
   ============================================================================== */

@media (max-width: 1024px) {
    .sidebar { transform: translateX(-250px); }
    .sidebar.is-open { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .mobile-nav-toggle { display: block; }
    .form-and-table-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .main-content { padding: 1rem; }
    .admin-header { flex-direction: column; align-items: flex-start; }
    .admin-header h1 { font-size: 1.5rem; margin-bottom: 1rem; }
    .form-grid { grid-template-columns: 1fr; }
    .dashboard-card { padding: 1rem; }
    .actions a { margin-right: 10px; }
}
