/* ============================================
   VARIABLES CSS GLOBALES
   Les couleurs sont injectées dynamiquement via PHP
   ============================================ */
:root {
    --primary-color: #2c7be5;
    --primary-dark: #1a56db;
    --primary-light: #e8f0fe;
    --secondary-color: #6c757d;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #212529;
    --light-bg: #f8f9fa;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: #333;
    line-height: 1.6;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.top-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 8px 0;
    font-size: 14px;
}

.main-header {
    background: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
}

.nav-link {
    font-weight: 600;
    color: #333 !important;
    transition: var(--transition);
    padding: 8px 15px !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* ============================================
   BOUTONS PERSONNALISÉS
   ============================================ */
.btn-primary-custom {
    background: var(--primary-color);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 25px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 123, 229, 0.3);
}

.btn-outline-primary-custom {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    padding: 8px 23px;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-outline-primary-custom:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   HERO BANNER (Page d'accueil)
   ============================================ */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 100px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,170.7C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.hero-banner h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.hero-banner p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

/* ============================================
   CARTES & SECTIONS
   ============================================ */
.card-custom {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-bottom: 25px;
    border: none;
    transition: var(--transition);
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.section-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge-niveau {
    display: inline-block;
    padding: 5px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    margin: 3px;
    font-weight: 500;
}

.badge-type {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-type.pdf { background: #f8d7da; color: #721c24; }
.badge-type.ppt { background: #fff3cd; color: #856404; }
.badge-type.video { background: #d1ecf1; color: #0c5460; }

/* ============================================
   FORMULAIRES
   ============================================ */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 123, 229, 0.15);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* ============================================
   TABLES
   ============================================ */
.table-custom {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table-custom thead {
    background: var(--primary-color);
    color: white;
}

.table-custom th {
    font-weight: 600;
    padding: 15px;
    border: none;
}

.table-custom td {
    padding: 15px;
    vertical-align: middle;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.file-upload-area {
    border: 2px dashed #dee2e6;
    padding: 40px;
    text-align: center;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    background: #fafbfc;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.file-upload-area .icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--dark-color);
    color: #adb5bd;
    padding: 50px 0 20px;
    margin-top: 60px;
}

footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
}

footer a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
}

footer a:hover {
    color: var(--primary-color);
}

footer .social-links a {
    font-size: 24px;
    margin-right: 15px;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */
.alert {
    border-radius: var(--border-radius);
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero-banner {
        padding: 60px 0;
    }
    
    .hero-banner h1 {
        font-size: 2rem;
    }
    
    .hero-banner p {
        font-size: 1rem;
    }
    
    .card-custom {
        padding: 20px;
    }
    
    .main-header {
        text-align: center;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   UTILITAIRES
   ============================================ */
.text-primary-custom { color: var(--primary-color) !important; }
.bg-primary-custom { background: var(--primary-color) !important; }
.border-primary-custom { border-color: var(--primary-color) !important; }

.shadow-custom { box-shadow: var(--box-shadow) !important; }
.rounded-custom { border-radius: var(--border-radius) !important; }