﻿/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --danger: #e74c3c;
    --danger-dark: #c0392b;
    --success: #2ecc71;
    --success-dark: #27ae60;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --gray: #95a5a6;
    --border-radius: 4px;
    --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Layout général */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 250px;
    background-color: var(--dark);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100%;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-title {
    color: white;
    font-size: 1.5rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-link {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-link:hover {
    background-color: rgba(255,255,255,0.1);
    padding-left: 25px;
}

.sidebar-link.active {
    background-color: var(--primary);
}

.sidebar-logout {
    background-color: var(--danger);
    margin: 20px;
    text-align: center;
    border-radius: var(--border-radius);
}

.sidebar-logout:hover {
    background-color: var(--danger-dark);
}

/* Contenu principal */
.app-main {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

/* Cartes et formulaires */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: var(--danger-dark);
}

/* Liste des annales */
.annales-list {
    list-style: none;
}

.annale-item {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.annale-actions {
    display: flex;
    gap: 10px;
}

.annale-actions a {
    margin-left: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    color: white;
}

.annale-download {
    background-color: #28a745;
}
.annale-download:hover {
    background-color: #218838;
}

.annale-edit {
    background-color: #ffc107;
    color: black;
}
.annale-edit:hover {
    background-color: #e0a800;
}

.annale-delete {
    background-color: #dc3545;
}
.annale-delete:hover {
    background-color: #c82333;
}

/* Page de login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--dark);
}

.login-container {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--dark);
}

.error-message {
    color: var(--danger);
    background-color: #fadbd8;
    padding: 10px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .app-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .app-main {
        margin-left: 0;
    }
}

/* ---- Pagination (version s.css conservée) ---- */
.pagination-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.pagination-info {
    margin-bottom: 10px;
    color: #6c757d;
    font-size: 0.9em;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap; /* Empêche le retour à la ligne */
    overflow-x: auto;  /* Permet le défilement si trop d'éléments */
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

.page-item {
    margin: 0 3px;
    flex-shrink: 0; /* Empêche le rétrécissement */
}

.page-link {
    display: block;
    padding: 8px 12px;
    color: #007bff;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap; /* Empêche le retour à la ligne */
}

.page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: default;
    background-color: #fff;
    border-color: #dee2e6;
}
