/* ---
STYLE GLOBAL - CALENDRIER DE L'AVENT 2.0
---
*/ 

/* ---
    STRUCTURE DE BASE
---
*/
html {
    position: relative;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-clip: content-box;
    background-origin: content-box;
    padding-bottom: 130px; /* réserve la place du footer */
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #212529;
    background: transparent !important; /* Supprime le fond blanc */
}

/* Supprime le fond blanc du container principal */
.container {
    max-width: none;
    padding: 0 15px;
    background: transparent !important;
}

/* Cartes avec fond blanc uniquement */
.card {
    max-width: 100%;
    margin: 0 auto;
    background: white !important;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    border: none;
    margin-bottom: 1.5rem;
}

/* Pour les pages spécifiques - largeurs réduites */
.row.justify-content-center .col-md-6,
.row.justify-content-center .col-md-8 {
    max-width: 800px;
    margin: 0 auto;
}

/* HEADER / NAVBAR */
.site-header {
    background-image: url('../img/header.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 110px;
    position: relative;
}

.navbar.bg-dark {
    background-color: transparent !important;
}

.site-header .navbar-brand,
.site-header .nav-link {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.65);
    color: #fff !important;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
}

.site-header .navbar-brand:hover,
.site-header .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff !important;
}

.site-header .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 8px;
}

.site-header .dropdown-item {
    color: #333;
}

.site-header .dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* ---
    FOOTER SMART STICKY
--- */
.footer-bg {
    position: relative;
    bottom: 0;
    left: 0;
    width: 100%;
    min-height: 50px;
    /*background-image: url('../img/footer.png') !important;*/
    background-position: bottom center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
    text-align: center;
    padding: 0.5rem 0.5rem;
    background-color: transparent !important;
    border-top: 3px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.footer-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0,0,0,0.1));
    z-index: 0;
}

.footer-bg * {
    position: relative;
    z-index: 1;
}

/* ---
    CONTENUS / CARTES / BOUTONS
--- */ 

/* Supprime tous les fonds blancs sauf pour les cartes */
body .container:not(.site-header .container):not(.footer-bg .container) {
    background: transparent !important;
}

/* Style des cartes uniquement */
.card {
    background: white !important;
    color: #212529;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    border: none;
    margin-bottom: 1.5rem;
}

/* Boutons */
.btn-primary {
    background: linear-gradient(45deg, #d32f2f, #f57c00);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #b71c1c, #e65100);
}

/* TEXTES ET COULEURS */
.text-danger { color: #dc3545 !important; }
.text-success { color: #198754 !important; }
.text-primary { color: #0d6efd !important; }

.statsCards {
    color: black !important;
}

/* ---
    BACKGROUNDS PAR PAGE - CORRIGÉS
--- */

/* Page Accueil - Rennes */
body.page-index {
    background: url('../img/rennes.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page QCM - Père Noël */
body.page-qcm {
    background: url('../img/perenoel.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page Question du jour - Sapin */
body.page-daily {
    background: url('../img/sapin.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page Connexion - Rennes */
body.page-login {
    background: url('../img/rennes.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page Archives - Noeud */
body.page-recap {
    background: url('../img/noeud.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page Statistiques - Rennes */
body.page-stats {
    background: url('../img/rennes.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page Admin - Rennes */
body.page-admin {
    background: url('../img/rennes.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page Inscription - Noeud */
body.page-register {
    background: url('../img/noeud.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Page Déconnexion - Rennes */
body.page-logout {
    background: url('../img/rennes.png') center center / cover no-repeat fixed !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Assurez-vous que le container principal est transparent */
.container-fluid {
    background: transparent !important;
}

/* ---
    FLOCONS DE NEIGE ❄️
--- */
.snowflake {
    position: fixed;
    top: -10px;
    color: white;
    font-size: 1rem;
    user-select: none;
    pointer-events: none;
    opacity: 0.9;
    z-index: 9999;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.8;
    }
}

/* ---
    EFFETS SUPPLEMENTAIRES
---
*/ 
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/*
    RESPONSIVE BOOTSTRAP AMÉLIORÉ
--- */

/* Tablettes */
@media (max-width: 992px) {
    .container {
        padding: 0 15px;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    /* Ajustement de la grille pour les stats */
    .row.text-center .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .border-end {
        border-right: none !important;
    }
}

/* Mobiles */
@media (max-width: 768px) {
    .site-header .navbar-brand,
    .site-header .nav-link {
        padding: 0.2rem 0.4rem;
        font-size: 0.9rem;
    }
    
    .footer-bg {
        min-height: 100px;
        padding: 1.5rem 0.5rem;
        background-position: bottom;
    }
    
    /* Cartes pleine largeur sur mobile */
    .row.justify-content-center .col-md-6,
    .row.justify-content-center .col-md-8 {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Ajustement des boutons de navigation */
    .d-flex.flex-wrap.justify-content-center.gap-2 {
        gap: 0.5rem !important;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    /* Meilleur affichage pour les stats */
    .h1, .h2, .h3, .h4, .h5, .h6 {
        font-size: 1.1rem;
    }
    
    .stat-number {
        font-size: 2em;
    }
}

/* Très petits mobiles */
@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Navigation compacte */
    .d-flex.flex-wrap.justify-content-center.gap-2 .btn {
        flex: 0 0 calc(50% - 0.25rem);
        text-align: center;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    /* Texte plus lisible sur petits écrans */
    body {
        font-size: 14px;
    }
    
    .h1, .h2, .h3, .h4, .h5, .h6 {
        font-size: 1rem;
    }
}

/* Classes utilitaires pour le responsive */
.mobile-stack {
    flex-direction: column;
}

.mobile-center {
    text-align: center;
}

.mobile-full {
    width: 100% !important;
    max-width: 100% !important;
}