/**
 * Lekòl - Thème Vert École
 * Design moderne et professionnel pour établissement scolaire
 * @version 2.0
 */

:root {
    /* Couleurs principales - Vert École */
    --primary: #28a745;
    --primary-dark: #1e7e34;
    --primary-light: #48c774;
    --secondary: #155724;
    --accent: #20c997;

    /* Couleurs complémentaires */
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;

    /* Neutres */
    --white: #ffffff;
    --light: #f8f9fa;
    --gray-100: #f4f6f9;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --gray-700: #495057;
    --dark: #212529;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --gradient-dark: linear-gradient(135deg, #155724 0%, #1e7e34 100%);
    --gradient-hero: linear-gradient(135deg, rgba(40, 167, 69, 0.95) 0%, rgba(32, 201, 151, 0.9) 100%);

    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);

    /* Bordures */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;

    /* Transitions */
    --transition: all 0.3s ease;
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   NAVIGATION PRINCIPALE
   ======================================== */
.navbar-lekol {
    background: var(--gradient-dark) !important;
    padding: 0.8rem 0;
    box-shadow: var(--shadow);
}

.navbar-lekol .navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
    text-decoration: none;
}

.navbar-lekol .navbar-brand img {
    height: 55px;
    width: 55px;
    min-width: 55px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.95);
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.navbar-lekol .navbar-brand-text {
    display: block;
    max-width: 280px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Responsive navbar brand */
@media (max-width: 991.98px) {
    .navbar-lekol .navbar-brand {
        font-size: 1.05rem;
    }
    .navbar-lekol .navbar-brand img {
        height: 48px;
        width: 48px;
        min-width: 48px;
    }
    .navbar-lekol .navbar-brand-text {
        max-width: 220px;
    }
}

@media (max-width: 767.98px) {
    .navbar-lekol .navbar-brand {
        font-size: 0.95rem;
        gap: 10px;
    }
    .navbar-lekol .navbar-brand img {
        height: 42px;
        width: 42px;
        min-width: 42px;
    }
    .navbar-lekol .navbar-brand-text {
        max-width: 180px;
    }
}

@media (max-width: 575.98px) {
    .navbar-lekol .navbar-brand {
        font-size: 0.85rem;
        gap: 8px;
    }
    .navbar-lekol .navbar-brand img {
        height: 38px;
        width: 38px;
        min-width: 38px;
    }
    .navbar-lekol .navbar-brand-text {
        max-width: 150px;
    }
}

/* Menu hamburger (sandwich) visible sur mobile */
.navbar-lekol .navbar-toggler {
    border: 2px solid rgba(255,255,255,0.8);
    padding: 0.4rem 0.6rem;
}

.navbar-lekol .navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.3);
}

.navbar-lekol .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-lekol .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.navbar-lekol .nav-link:hover,
.navbar-lekol .nav-link.active {
    color: var(--white) !important;
    background: rgba(255,255,255,0.15);
}

.navbar-lekol .btn-connexion {
    background: var(--white);
    color: var(--primary-dark) !important;
    font-weight: 600;
    padding: 0.5rem 1.5rem !important;
    border-radius: 25px;
}

.navbar-lekol .btn-connexion:hover {
    background: var(--accent);
    color: var(--white) !important;
    transform: translateY(-2px);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    background: var(--gradient-hero), url('../img/school-bg.jpg');
    background-size: cover;
    background-position: center;
    min-height: 500px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Overlay sombre pour améliorer la lisibilité du texte sur les images de bannière */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(21, 87, 36, 0.75) 0%, rgba(30, 126, 52, 0.65) 50%, rgba(32, 201, 151, 0.55) 100%);
    z-index: 1;
}

.hero-section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, var(--gray-100), transparent);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    color: var(--white);
    padding: 3rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 8px rgba(0,0,0,0.7), 0 0 30px rgba(0,0,0,0.4);
}

.hero-subtitle {
    font-size: 1.4rem;
    opacity: 1;
    margin-bottom: 2rem;
    max-width: 600px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
}

.hero-buttons .btn {
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: 30px;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.btn-hero-primary {
    background: var(--white);
    color: var(--primary-dark);
    border: none;
}

.btn-hero-primary:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-hero-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-hero-outline:hover {
    background: var(--white);
    color: var(--primary-dark);
    transform: translateY(-3px);
}

/* ========================================
   STATISTIQUES
   ======================================== */
.stats-section {
    margin-top: -50px;
    position: relative;
    z-index: 10;
}

.stats-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: var(--white);
    font-size: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

.stat-label {
    color: var(--gray-700);
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* ========================================
   SECTIONS PRINCIPALES
   ======================================== */
.section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--gray-700);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ========================================
   CARTES ACTUALITÉS
   ======================================== */
.news-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.news-card-image {
    height: 200px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--white);
    color: var(--primary-dark);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.news-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-date {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.news-card-excerpt {
    color: var(--gray-700);
    font-size: 0.95rem;
    flex-grow: 1;
}

.news-card-link {
    margin-top: 1rem;
    color: var(--primary);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.news-card-link:hover {
    gap: 10px;
}

/* ========================================
   WIDGET CALENDRIER
   ======================================== */
.calendar-widget {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1.25rem;
    text-align: center;
}

.calendar-header h5 {
    margin: 0;
    font-weight: 600;
}

.calendar-body {
    padding: 1rem;
}

.calendar-event {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
    background: var(--gray-100);
    transition: var(--transition);
}

.calendar-event:hover {
    background: var(--gray-200);
}

.calendar-event-date {
    min-width: 50px;
    text-align: center;
    padding-right: 1rem;
    border-right: 3px solid var(--primary);
}

.calendar-event-day {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1;
}

.calendar-event-month {
    font-size: 0.75rem;
    color: var(--gray-700);
    text-transform: uppercase;
}

.calendar-event-info {
    padding-left: 1rem;
    flex-grow: 1;
}

.calendar-event-title {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.calendar-event-time {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.calendar-event-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.type-examen { background: #f8d7da; color: #721c24; }
.type-conge { background: #d1ecf1; color: #0c5460; }
.type-fete { background: #fff3cd; color: #856404; }
.type-reunion { background: #e2d5f1; color: #4a235a; }
.type-sport { background: #ffecd2; color: #8b4513; }
.type-autre { background: #d4edda; color: #155724; }

/* ========================================
   CARTES INFO ÉCOLE
   ======================================== */
.info-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    height: 100%;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.info-card-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--white);
    font-size: 2rem;
}

.info-card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.info-card-text {
    color: var(--gray-700);
    line-height: 1.7;
}

/* ========================================
   FOOTER
   ======================================== */
.footer-lekol {
    background: var(--gradient-dark);
    color: var(--white);
    padding: 4rem 0 0;
}

.footer-brand {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-description {
    opacity: 0.85;
    line-height: 1.8;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.footer-contact-item i {
    width: 20px;
    margin-right: 1rem;
    color: var(--accent);
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.footer-bottom {
    background: rgba(0,0,0,0.2);
    padding: 1.5rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer-bottom p {
    margin: 0;
    opacity: 0.85;
}

/* ========================================
   BOUTONS GLOBAUX
   ======================================== */
.btn-primary {
    background: var(--gradient-primary) !important;
    border: none !important;
    color: var(--white) !important;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    opacity: 0.95;
}

.btn-outline-primary {
    border: 2px solid var(--primary) !important;
    color: var(--primary) !important;
    background: transparent !important;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    color: var(--white) !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 991px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    .hero-section {
        min-height: 400px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-right: 0;
    }

    .section {
        padding: 2.5rem 0;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .stats-section {
        margin-top: -30px;
    }

    .stat-item {
        border-bottom: 1px solid var(--gray-200);
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .stat-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
}

/* ========================================
   SIDEBAR ADMIN (Mise à jour thème)
   ======================================== */
.sidebar {
    background: var(--gradient-dark) !important;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8) !important;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.1) !important;
    color: var(--white) !important;
}

.sidebar .nav-link i {
    color: var(--accent);
}

/* ========================================
   PAGE ACTUALITÉS
   ======================================== */
.page-header {
    background: var(--gradient-hero);
    padding: 3rem 0;
    color: var(--white);
    margin-bottom: 3rem;
}

.page-header h1 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Breadcrumb pour headers colorés (pages publiques) */
.page-header .breadcrumb-item a {
    color: rgba(255,255,255,0.8);
}

.page-header .breadcrumb-item.active {
    color: var(--white);
}

/* Breadcrumb pour fond blanc (backend/CMS) */
main .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

main .breadcrumb-item a {
    color: var(--primary);
}

main .breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

main .breadcrumb-item.active {
    color: var(--gray-700);
}

main .breadcrumb-item + .breadcrumb-item::before {
    color: var(--gray-500);
}

/* ========================================
   BOUTON WHATSAPP FLOTTANT
   ======================================== */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    background: #128C7E;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.whatsapp-float i {
    margin: 0;
}

/* Animation pulse */
.whatsapp-float::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    animation: whatsapp-pulse 2s infinite;
    z-index: -1;
}

@keyframes whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    70% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Tooltip WhatsApp */
.whatsapp-float .whatsapp-tooltip {
    position: absolute;
    right: 70px;
    background: #333;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.whatsapp-float .whatsapp-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
}

.whatsapp-float:hover .whatsapp-tooltip {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 26px;
    }

    .whatsapp-float .whatsapp-tooltip {
        display: none;
    }
}

.news-list-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1.5rem;
    transition: var(--transition);
}

.news-list-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.news-list-image {
    width: 150px;
    height: 120px;
    border-radius: var(--border-radius-sm);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    flex-shrink: 0;
}

.news-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

/* Animation fade-in */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
