/**
 * Variables globales de couleurs et thème
 * Définit les couleurs principales et le dégradé utilisé dans l'application
 */
:root {
    --primary-color: #2563eb;    /* Bleu principal */
    --secondary-color: #7c3aed;  /* Violet secondaire */
    --accent-color: #3b82f6;     /* Bleu accent */
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --text-color: #2d3748;       /* Couleur du texte principal */
    --light-bg: #f8fafc;         /* Fond clair */
}

/**
 * Configuration de base du document
 * Définit le comportement de défilement et la police par défaut
 */
html,
body {
    scroll-behavior: smooth;      /* Défilement fluide */
    height: 100%;
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/**
 * Structure des sections
 * Chaque section occupe la hauteur complète de l'écran
 */
section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
    background-color: var(--light-bg);
}

/* Alternance des couleurs de fond des sections */
section:nth-child(even) {
    background-color: white;
}

/**
 * Style des titres de section
 * Inclut une barre décorative en dessous
 */
.section-title {
    color: var(--text-color);
    font-weight: 800;
    margin-bottom: 2.5rem;
    position: relative;
    font-size: 2.5rem;
}

/* Barre décorative sous les titres */
.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient);
    margin: 15px auto;
    border-radius: 2px;
}

/**
 * Style des boutons personnalisés
 * Utilise le dégradé défini dans les variables
 */
.btn-custom {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    transition: transform 0.3s ease;
}

/* Animation au survol des boutons */
.btn-custom:hover {
    transform: translateY(-3px);
    color: white;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

/**
 * Navigation
 * Style de la barre de navigation avec effet de flou
 */
.bg-custom-nav {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Style du logo dans la navigation */
.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
}

/* Style des liens de navigation */
.nav-link {
    color: #333 !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
}

/**
 * Composants de carte
 * Style des cartes avec effet d'élévation au survol
 */
.card-custom {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card-custom:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/**
 * Barres de progression
 * Style des conteneurs et des barres de progression
 */
.progress {
    height: 8px;
    background-color: rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: var(--gradient);
}

/**
 * Pied de page
 * Style général et icônes sociales
 */
footer {
    padding: 2rem 0;
}

.social-icon {
    color: #333;
    transition: color 0.3s ease;
}

.social-icon:hover {
    color: var(--accent-color);
}

/**
 * Formulaires
 * Style des champs de saisie et états
 */
.form-control {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color);
    color: #333;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/**
 * Page d'accueil (garde)
 */
#accueil {
    background: linear-gradient(
        160deg,
        var(--light-bg) 0%,
        rgba(37, 99, 235, 0.06) 50%,
        rgba(124, 58, 237, 0.08) 100%
    );
}

.accueil-intro {
    max-width: 36rem;
}

.accueil-scroll {
    transition: transform 0.3s ease, color 0.3s ease;
}

.accueil-scroll:hover {
    transform: translateY(4px);
    color: var(--primary-color) !important;
}

/**
 * Menu flottant des pages AP
 */
.ap-nav-floating {
    z-index: 1000;
}

/**
 * Carousel des captures AP EPOKA
 */
.epoka-carousel .carousel-indicators [data-bs-target] {
    background-color: var(--primary-color);
}

.epoka-carousel-frame {
    height: 44vh;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    overflow: hidden;
}

.epoka-carousel-image {
    max-height: 92%;
    max-width: 92%;
    height: auto;
    width: auto;
    object-fit: contain;
}

.epoka-carousel-image-home {
    max-height: 88%;
}

.epoka-carousel .carousel-caption {
    background: rgba(15, 23, 42, 0.75);
    border-radius: 0.5rem;
    padding: 0.5rem 0.8rem;
}

.carousel-zoomable-image {
    cursor: zoom-in;
}

/**
 * Navigation mobile
 * Animation de la barre de navigation
 */
.navbar-collapse {
    transition: all 0.3s ease;
}

/**
 * Timeline
 * Style de la ligne temporelle et des éléments
 */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-item {
    position: relative;
    padding-left: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-color);
}

.timeline-date {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

/**
 * Veille informationnelle
 * Intégration responsive des captures (FreshRSS / Notion)
 */
.veille-captures .card {
    overflow: hidden;
}

.veille-image {
    width: 100%;
    height: clamp(180px, 28vh, 280px);
    object-fit: contain;
    background: #f8fafc;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/**
 * Styles des cartes et badges
 */
.card-custom {
    background: var(--bg-light);
    border: none;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.badge {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
}

.card ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.card ul li {
    margin-bottom: 0.5rem;
}

.card-title i {
    margin-right: 0.5rem;
}

/**
 * Media Queries
 * Ajustements responsifs pour différentes tailles d'écran
 */
@media (max-width: 768px) {
    .epoka-carousel-frame {
        height: 34vh;
    }

    .timeline-item {
        padding-left: 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/**
 * Page de détails des stages
 * Styles spécifiques pour la page de détails
 */
body.stage-details-page .navbar {
    display: none !important;
}

.btn-retour-flottant {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1050;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.stage-detail {
    margin-bottom: 3rem;
}

.stage-detail .card-title {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.stage-detail .list-unstyled li {
    margin-bottom: 0.75rem;
}

.stage-detail .badge {
    font-size: 0.9rem;
    padding: 0.5em 1em;
    margin: 0.25rem;
}

.stage-detail .card-text i {
    width: 1.5rem;
}

/* Ajustements responsifs pour la page de détails */
@media (max-width: 768px) {
    .btn-retour-flottant {
        top: 10px;
        left: 10px;
    }
    
    .stage-detail .card-body {
        padding: 1rem;
    }
}
