
/* --- ================================== --- */
/* --- STYLES PUBLICS (index.php) --- */
/* --- ================================== --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    background-color: #0f0f0f;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0f0f0f;
    color: #e8e8e8;
    line-height: 1.6;
    padding-bottom: 70px;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding-top: env(safe-area-inset-top);
}

/* Effet de grain subtil */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

.content {
    position: relative;
    z-index: 2;
}

/* --- Barre de Navigation (index.php) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    padding-bottom: env(safe-area-inset-bottom);
    background: #141414;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
    display: flex;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
}

.bottom-nav .nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: #888;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    padding: 0.5rem 0;
    margin: 0;
    cursor: pointer;
    text-decoration: none;
    height: 100%;
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.bottom-nav .nav-link:first-child {
    border-left: none;
}

.bottom-nav .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-link img {
    width: 28px;
    height: 28px;
    margin-bottom: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav .nav-link.active {
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.1);
}

.bottom-nav .nav-link.active::before {
    transform: scaleX(1);
}

.bottom-nav .nav-link.active img {
    transform: translateY(-2px);
}

.bottom-nav .nav-link:hover {
    color: #b0b0b0;
    background: rgba(255, 255, 255, 0.05);
}

/* --- Gestion des "Pages" (index.php) --- */
.page {
    display: none;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page.active {
    display: block;
}

.page h2 {
    font-weight: 700;
    color: #ffffff;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.page h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, transparent);
    border-radius: 2px;
}

/* --- Section Horaire & Tableau (index.php) --- */
.class-selector {
    display: block;
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.class-selector:hover,
.class-selector:focus {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(30, 30, 30, 0.95);
    outline: none;
}

.schedule-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

th, td {
    padding: 0.8rem 0.6rem;
    font-size: 0.85rem;
    white-space: nowrap;
    border: none;
    vertical-align: top;
}

thead {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
}

thead th {
    font-weight: 600;
    padding: 1rem 0.6rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

thead th:first-child {
    border-top-left-radius: 8px;
}

thead th:last-child {
    border-top-right-radius: 8px;
}

tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.08);
}

tbody th {
    font-weight: 600;
    background: rgba(40, 40, 40, 0.8);
    color: #8b5cf6;
    text-align: right;
    font-size: 0.75rem;
    padding-right: 0.8rem;
}

td .subject {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 4px;
}

td .details {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
}

td.break {
    text-align: center;
    color: #888;
    background: rgba(20, 20, 20, 0.9) !important;
    font-style: italic;
}

/* --- Section Annonces (index.php) --- */
.annonces-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.annonce-card {
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.annonce-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
}

.annonce-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
}

.annonce-card h3 {
    color: #8b5cf6;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.annonce-card .annonce-contenu {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.annonce-card .annonce-meta {
    font-size: 0.85rem;
    color: #888;
    font-style: italic;
}

/* --- Section Absences (index.php) --- */
.absence-list {
    list-style: none;
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.absence-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.absence-list li:hover {
    background: rgba(139, 92, 246, 0.08);
    border-radius: 8px;
}

.absence-list li:last-child {
    border-bottom: none;
}

.prof-name {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.absence-date {
    font-style: italic;
    color: #aaa;
    font-size: 0.9rem;
}

.no-absence {
    justify-content: center !important;
    font-style: italic;
    color: #888;
    padding: 2rem !important;
}

/* --- Section Projet (index.php) --- */
.project-card {
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card p {
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.8rem;
}

.project-card strong {
    color: #8b5cf6;
    font-weight: 600;
}

.project-card .btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.project-card .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* --- ================================== --- */
/* --- STYLES ADMIN (admin.php) --- */
/* --- ================================== --- */
.admin-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.card {
    background: rgba(25, 25, 25, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

/* --- NAVIGATION ADMIN (CSS Grid) --- */
.admin-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-nav .btn {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-break: break-word;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.admin-nav .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-nav .btn:hover::before {
    opacity: 1;
}

.admin-nav .btn img {
    width: 32px;
    height: 32px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.admin-nav .btn span {
    font-size: 0.9rem;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.admin-nav .btn:hover {
    background: rgba(40, 40, 40, 0.95);
    color: #fff;
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.admin-nav .btn:hover img {
    transform: scale(1.1);
}

.admin-nav .btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.25));
    color: #ffffff;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

/* Formulaires Admin */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Boutons standards */
.btn {
    display: inline-block;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn.delete {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn.delete:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Grille d'édition Admin */
.editor-grid {
    width: 100%;
    overflow-x: auto;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
}

.editor-grid th,
.editor-grid td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    vertical-align: top;
    min-width: 200px;
}

.editor-grid th {
    background: rgba(40, 40, 40, 0.9);
    color: #8b5cf6;
    font-weight: 600;
}

.editor-grid input[type="text"] {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 6px;
    background: rgba(30, 30, 30, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.editor-grid input[type="text"]:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(30, 30, 30, 0.95);
}

/* Réglages A2F */
.qr-code-container {
    text-align: center;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-code-container #qrcode-js-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.qr-code-container img {
    background-color: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.qr-code-container p.note {
    color: #aaa;
    font-size: 0.9em;
    line-height: 1.6;
    word-break: break-all;
}

.btn.a2f-disable {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    margin-right: 5px;
}

.btn.a2f-disable:hover {
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.btn.pdf {
    background: linear-gradient(135deg, #3498db, #2980b9);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    margin-right: 5px;
}

.btn.pdf:hover {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

/* Messages de statut */
.login-form {
    margin-top: 1.5rem;
}

.card h2 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

/* Responsive Admin Nav */
@media (max-width: 600px) {
    .admin-nav {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page {
        padding: 1rem;
    }
    
    .annonce-card,
    .project-card,
    .card {
        padding: 1.5rem;
    }
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 20, 20, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

.project-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.project-logo img {
    max-width: 120px;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.project-logo img:hover {
    transform: scale(1.05);
}

/* --- CORRECTION Alignement Checkbox Admin --- */
.form-group label {
    /* Ceci permet aux labels de s'adapter s'ils contiennent une checkbox */
    display: block; 
}

.form-group label input[type="checkbox"] {
    width: auto; /* Annule le width: 100% */
    height: auto;
    padding: 0;
    margin: 0 0.5rem 0 0; /* Ajoute un espace à droite de la case */
    vertical-align: middle; /* Aligne la case avec le texte */
    position: relative;
    top: -1px; /* Ajustement fin pour un alignement parfait */
    
    /* Bonus: change la couleur de la coche pour correspondre à votre thème */
    accent-color: #8b5cf6; 
}
/* --- FIN CORRECTION --- */