/* Digital Hero Section */
.digital-hero {
  background: linear-gradient(45deg, #0d47a1 0%, #1a237e 100%) !important;
  color: #fff;
  position: relative;
  overflow: hidden; /* To contain pseudo-elements */
}

/* Optional: Add some subtle animated shapes for a more "digital" feel */
.digital-hero::before {
  content: '';
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  animation: float 15s infinite linear;
}

.digital-hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 45%;
  animation: float 20s infinite linear reverse;
}

@keyframes float {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-20px) translateX(20px); }
  100% { transform: translateY(0) translateX(0); }
}


/* Glassmorphism Card */
.hero-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* For Safari */
  transition: all 0.3s ease;
  height: 100%; /* Make cards equal height */
}

.hero-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-card .card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hero-card .card-title {
  font-weight: 600;
}

.hero-card .btn-outline-light {
  border-width: 2px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: auto; /* Pushes button to the bottom */
}

.hero-card .btn-outline-light:hover {
  background: #fff;
  color: #1a237e;
}

#comments {
  scroll-margin-top: 90px; /* ajuste 90px selon hauteur de ta navbar sticky */
}

/* Thème sombre pour les blocs de code dans CKEditor */
pre code {
    display: block;
    background-color: #1e1e1e !important; /* fond sombre */
    color: #e8e8e8 !important;             /* texte clair */
    padding: 1rem;
    border-radius: 8px;
    font-family: "Fira Code", Consolas, monospace;
    overflow-x: visible;
    line-height: 1.4em;
}

/* Améliore le contraste pour les mots-clés, chaînes, etc. */
pre code .hljs-keyword,
pre code .hljs-selector-tag,
pre code .hljs-name {
    color: #c792ea;
}
pre code .hljs-string {
    color: #ecc48d;
}
pre code .hljs-number,
pre code .hljs-literal {
    color: #f78c6c;
}
pre code .hljs-comment {
    color: #5c6370;
    font-style: italic;
}

.carousel-image {
  /* On définit une hauteur qui occupe 70% de la hauteur de l'écran (viewport height) */
  height: 70vh; 
  /* Mais on s'assure qu'elle ne dépasse jamais 450px sur les grands écrans pour garder ton design initial */
  max-height: 450px;
  /* Garde les proportions de l'image tout en remplissant l'espace. C'est crucial ! */
  object-fit: cover; 
  /* On déplace le filtre ici pour un code plus propre */
  filter: brightness(60%); 
}

/* Ceci est une Media Query : ces styles ne s'appliqueront que sur les écrans
   dont la largeur est inférieure ou égale à 768px (la plupart des mobiles) */
@media (max-width: 768px) {
  .carousel-image {
    /* On réduit la hauteur sur mobile pour un meilleur affichage */
    height: 40vh; 
  }
}

.text-gradient {
    background: linear-gradient(90deg, #0d6efd, #6610f2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hover-shadow {
  transition: all 0.3s ease;
}
.hover-shadow:hover {
  transform: translateY(-4px);
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}
.object-fit-cover {
  object-fit: cover;
}

:root {
    --main-navbar-height: 72px; /* hauteur de la navbar fixed-top */
    --secondary-navbar-height: 56px; /* hauteur estimée de la navbar secondaire (ajustez si besoin) */
}

.logo-img {
    height: 30px;
    margin-right: 8px;
}

body {
    padding-top: 72px;
    padding-bottom: 3rem; /* Revert to original padding-bottom */
    color: #5a5a5a;
    transition: background-color 0.3s, color 0.3s;
}
.navbar-brand img {
    height: 32px;
    margin-right: 8px;
}
.search-input {
    max-width: 250px;
}

body.with-main-navbar {
    padding-top: var(--main-navbar-height);
}

body.with-two-navbars {
    padding-top: calc(var(--main-navbar-height) + var(--secondary-navbar-height));
}

body.with-main-navbar-only-sticky-secondary {
    padding-top: var(--main-navbar-height);
}

footer a:hover {
  text-decoration: underline;
  color: #0d6efd !important;
}
footer .btn-outline-light:hover {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* --- Stacking Order Fixes --- */

/* CMS Toolbar z-index fix */
.cms-toolbar {
    z-index: 99999 !important;
}

/* Main Navbar */
.navbar.fixed-top {
    z-index: 1030;
}

/* Secondary Navbar */
.navbar_secondaire.sticky-top {
    z-index: 1020;
    top: var(--main-navbar-height);
}

/* CKEditor toolbar z-index fix */
.cke_top,
.ck.ck-editor__top .ck-sticky-panel__content {
    z-index: 1051 !important; /* Higher than modals (1050) */
}

/* Adjustments when CMS toolbar is shown */
html.cms-toolbar-shown .navbar.fixed-top {
    top: 46px; /* Height of CMS toolbar */
}

html.cms-toolbar-shown .navbar_secondaire.sticky-top {
    top: calc(var(--main-navbar-height) + 46px);
}

/* Modern Navbar Link Styles */
.navbar.fixed-top .nav-link {
    transition: color 0.3s ease;
}

.navbar.fixed-top .nav-link.active,
.navbar.fixed-top .nav-link:hover {
    color: #ffffff;
    font-weight: bold;
}

.navbar.fixed-top .nav-link:not(.active) {
    color: rgba(255, 255, 255, 0.7);
}

/*
-------------------------------------------------- */
/*           STYLES DE L'EXEMPLE CAROUSEL           */
/*
-------------------------------------------------- */


/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */

/* Carousel base class */
.carousel {
  margin-bottom: 4rem;
}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
  bottom: 3rem;
  z-index: 10;
}

/* Declare heights because of positioning of img element */
.carousel-item {
  height: 32rem;
}
.carousel-item > img {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  height: 32rem;
}


/* MARKETING CONTENT
-------------------------------------------------- */

/* Center align the text within the three columns below the carousel */
.marketing .col-lg-4 {
  margin-bottom: 1.5rem;
  text-align: center;
}
.marketing h2 {
  font-weight: 400;
}
/* rtl:begin:ignore */
.marketing .col-lg-4 p {
  margin-right: .75rem;
  margin-left: .75rem;
}
/* rtl:end:ignore */


/* Featurettes
------------------------- */

.featurette-divider {
  margin: 5rem 0; /* Space out the Bootstrap
more */
}

/* Thin out the marketing headings */
.featurette-heading {
  font-weight: 300;
  line-height: 1;
  /* rtl:remove */
  letter-spacing: -.05rem;
}


/* RESPONSIVE CSS
-------------------------------------------------- */

@media (min-width: 40em) {
  /* Bump up size of carousel content */
  .carousel-caption p {
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .featurette-heading {
    font-size: 50px;
  }
}

@media (min-width: 62em) {
  .featurette-heading {
    margin-top: 7rem;
  }
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .card,
body.dark-mode .modal-content {
    background-color: #2b2b2b;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .list-group-item {
    background-color: #2b2b2b;
    border-color: #444;
    color: #e0e0e0;
}

body.dark-mode .card-header,
body.dark-mode .modal-header {
    border-bottom-color: #444;
}

body.dark-mode .card-footer,
body.dark-mode .modal-footer {
    border-top-color: #444;
}

body.dark-mode a {
    color: #8ab4f8;
}

body.dark-mode a:hover {
    color: #a9c7fd;
}

body.dark-mode .text-dark {
    color: #e0e0e0 !important;
}

body.dark-mode .text-muted {
    color: #888 !important;
}

body.dark-mode .form-control {
    background-color: #333;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .form-control:focus {
    background-color: #333;
    color: #e0e0e0;
    border-color: #8ab4f8;
    box-shadow: 0 0 0 0.25rem rgba(138, 180, 248, 0.25);
}

body.dark-mode .navbar_secondaire {
    background-color: #212121 !important;
}

body.dark-mode .btn-light {
    background-color: #444;
    border-color: #555;
    color: #e0e0e0;
}

.link-preview-card {
    max-width: 500px;
    border: 1px solid #ddd;
    transition: box-shadow 0.2s ease-in-out;
}
.link-preview-card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.05);
}
body.dark-mode .link-preview-card {
    border-color: #444;
}

/* static/css/main.css */

/* Transition douce pour le changement de couleur */
body, .card, .navbar, .list-group-item {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-bs-theme="dark"] body {
    background-color: #121212 !important; /* Un noir plus doux que #000 */
}

/* Ajustements pour les cartes en mode sombre */
[data-bs-theme="dark"] .card {
    background-color: #1e1e1e;
    border-color: #2d2d2d;
}

/* Ajustements pour les inputs en mode sombre */
[data-bs-theme="dark"] .form-control {
    background-color: #2b2b2b;
    border-color: #444;
    color: #fff;
}

/* Animation de chargement squelette */
.skeleton {
    background-color: #e0e0e0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Effet de brillance qui passe */
.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Adaptation mode sombre */
[data-bs-theme="dark"] .skeleton {
    background-color: #2d2d2d;
}
[data-bs-theme="dark"] .skeleton::after {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

/* Classes utilitaires pour la structure */
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-title { height: 1.5rem; margin-bottom: 1rem; width: 70%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-img { width: 100%; height: 300px; border-radius: 8px; }

/* --- GESTION DU HEADER MOBILE --- */

/* Par défaut (Desktop), on garde les 72px définis dans base.html */
/* Pas besoin de changer le défaut */

/* Uniquement sur Mobile (moins de 768px) */
@media (max-width: 767.98px) {
    body {
        /* On augmente le padding car notre header mobile fait 2 étages (~106px) */
        padding-top: 106px !important; 
    }
    
    /* Petit ajustement pour que la navbar secondaire (si elle existe) ne soit pas cachée */
    body.with-two-navbars {
        padding-top: calc(106px + var(--secondary-navbar-height)) !important;
    }
    
    /* Ajustement de la position de la navbar secondaire sticky */
    .navbar_secondaire.sticky-top {
        top: 106px !important;
    }
}