/********** Template CSS - Bootstrap 5.3 Compatible **********/

/* ===== VARIABLES CSS BOOTSTRAP 5.3 ===== */
:root {
    /* Couleurs principales compatibles Bootstrap 5.3 */
    --bs-primary: #6244C5;
    --bs-secondary: #FFC448;
    --bs-light: #FAFAFB;
    --bs-dark: #12141D;

    /* Variables Creative héritées */
    --primary: var(--bs-primary);
    --secondary: var(--bs-secondary);
    --light: var(--bs-light);
    --dark: var(--bs-dark);

    /* Nouvelles variables Bootstrap 5.3 pour l'emphase */
    --bs-primary-text-emphasis: #2c1a4f;
    --bs-secondary-text-emphasis: #664d00;
    --bs-primary-bg-subtle: #e8e2ff;
    --bs-secondary-bg-subtle: #fff5cc;
    --bs-primary-border-subtle: #c5b3ff;
    --bs-secondary-border-subtle: #ffe066;

    /* Variables de focus améliorées */
    --bs-focus-ring-width: 0.25rem;
    --bs-focus-ring-opacity: 0.25;
    --bs-focus-ring-color: rgba(98, 68, 197, 0.25);

    /* Variables de navigation Bootstrap 5.3 */
    --bs-navbar-padding-x: 1rem;
    --bs-navbar-padding-y: 0.5rem;
    --bs-navbar-color: var(--bs-dark);
    --bs-navbar-hover-color: var(--bs-primary);
    --bs-navbar-active-color: var(--bs-primary);
    --bs-navbar-brand-color: var(--bs-dark);

    /* Variables de boutons Bootstrap 5.3 */
    --bs-btn-padding-x: 0.75rem;
    --bs-btn-padding-y: 0.375rem;
    --bs-btn-font-size: 1rem;
    --bs-btn-border-radius: 0.375rem;

    /* Variables de modal Bootstrap 5.3 */
    --bs-modal-width: 500px;
    --bs-modal-padding: 1rem;
    --bs-modal-bg: var(--bs-body-bg);
    --bs-modal-border-color: var(--bs-border-color-translucent);

    /* Variables de progress Bootstrap 5.3 */
    --bs-progress-height: 1rem;
    --bs-progress-bg: var(--bs-gray-200);
    --bs-progress-border-radius: 0.375rem;
    --bs-progress-bar-bg: var(--bs-primary);

    /* Variables de spinner Bootstrap 5.3 */
    --bs-spinner-width: 2rem;
    --bs-spinner-height: 2rem;
    --bs-spinner-animation-speed: 0.75s;
    --bs-spinner-border-width: 0.25em;
}

/* ===== MODE SOMBRE VARIABLES ===== */
[data-bs-theme="dark"] {
    --bs-primary-text-emphasis: #a691ff;
    --bs-secondary-text-emphasis: #ffcc33;
    --bs-primary-bg-subtle: #1a0f33;
    --bs-secondary-bg-subtle: #332200;
    --bs-primary-border-subtle: #3d2566;
    --bs-secondary-border-subtle: #664400;

    /* Ajustements pour le mode sombre */
    --bs-focus-ring-color: rgba(166, 145, 255, 0.25);
    --bs-navbar-color: var(--bs-body-color);
    --bs-navbar-hover-color: var(--bs-primary-text-emphasis);
    --bs-navbar-active-color: var(--bs-primary-text-emphasis);
}

/* ===== CLASSES UTILITAIRES MISES À JOUR ===== */
.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
    border-radius: var(--bs-btn-border-radius);
}

.my-6 {
    margin-top: 6rem;
    margin-bottom: 6rem;
}

.py-6 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

/* ===== SPINNER BOOTSTRAP 5.3 ===== */
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/* Spinner avec variables CSS Bootstrap 5.3 */
.spinner-border {
    width: var(--bs-spinner-width);
    height: var(--bs-spinner-height);
    border-width: var(--bs-spinner-border-width);
    animation-duration: var(--bs-spinner-animation-speed);
}

/* ===== BOUTONS BOOTSTRAP 5.3 ===== */
.btn {
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    border-radius: var(--bs-btn-border-radius);
    padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
    font-size: var(--bs-btn-font-size);
}

.btn.btn-primary,
.btn.btn-secondary {
    color: #FFFFFF;
}

/* Variables CSS locales pour les boutons */
.btn-primary {
    --bs-btn-color: #ffffff;
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-hover-bg: color-mix(in srgb, var(--bs-primary), black 15%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-primary), black 15%);
    --bs-btn-focus-shadow-rgb: 98, 68, 197;
    --bs-btn-active-color: #ffffff;
    --bs-btn-active-bg: color-mix(in srgb, var(--bs-primary), black 20%);
    --bs-btn-active-border-color: color-mix(in srgb, var(--bs-primary), black 20%);
}

.btn-secondary {
    --bs-btn-color: #000000;
    --bs-btn-bg: var(--bs-secondary);
    --bs-btn-border-color: var(--bs-secondary);
    --bs-btn-hover-color: #000000;
    --bs-btn-hover-bg: color-mix(in srgb, var(--bs-secondary), black 15%);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-secondary), black 15%);
    --bs-btn-focus-shadow-rgb: 255, 196, 72;
}

/* Boutons carrés avec variables Bootstrap 5.3 */
.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    border-radius: var(--bs-btn-border-radius);
}

/* ===== NAVBAR BOOTSTRAP 5.3 ===== */
.navbar.fixed-top {
    display: none;
    transition: .5s;
}

/* Utilisation des nouvelles variables Bootstrap 5.3 pour la navbar */
.navbar {
    --bs-navbar-padding-x: var(--bs-navbar-padding-x);
    --bs-navbar-padding-y: var(--bs-navbar-padding-y);
    --bs-navbar-color: var(--bs-navbar-color);
    --bs-navbar-hover-color: var(--bs-navbar-hover-color);
    --bs-navbar-active-color: var(--bs-navbar-active-color);
    --bs-navbar-brand-color: var(--bs-navbar-brand-color);
}

.navbar .navbar-nav .nav-link {
    padding: 20px 15px;
    color: var(--bs-navbar-color);
    font-size: 18px;
    font-weight: 600;
    outline: none;
    transition: color 0.15s ease-in-out;
}

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--bs-navbar-hover-color);
}

/* Responsive navbar */
@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link {
        padding: 10px 0;
    }
}

/* ===== HEADER AVEC SUPPORT MODE SOMBRE ===== */
#home {
    margin-bottom: 6rem;
    background: url("../img/bg-header.3a9d11f0b714.png") left top no-repeat;
    background-size: cover;
}

[data-bs-theme="dark"] #home {
    background-blend-mode: multiply;
    background-color: rgba(0, 0, 0, 0.3);
}

.typed-cursor {
    font-size: 30px;
    color: var(--bs-dark);
}

[data-bs-theme="dark"] .typed-cursor {
    color: var(--bs-light);
}

/* Bouton play avec variables CSS */
.btn-play {
    position: relative;
    display: block;
    box-sizing: content-box;
    width: 16px;
    height: 26px;
    border-radius: 100%;
    border: none;
    outline: none !important;
    padding: 18px 20px 20px 28px;
    background: var(--bs-primary);
    transition: all 0.3s ease;
}

.btn-play:before {
    content: "";
    position: absolute;
    z-index: 0;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    display: block;
    width: 60px;
    height: 60px;
    background: var(--bs-primary);
    border-radius: 100%;
    animation: pulse-border 1500ms ease-out infinite;
}

.btn-play:after {
    content: "";
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    display: block;
    width: 60px;
    height: 60px;
    background: #FFFFFF;
    border-radius: 100%;
    transition: all 200ms;
}

.btn-play span {
    display: block;
    position: relative;
    z-index: 3;
    width: 0;
    height: 0;
    left: -1px;
    border-left: 16px solid var(--bs-primary);
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
}

@keyframes pulse-border {
    0% {
        transform: translateX(-50%) translateY(-50%) translateZ(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) translateY(-50%) translateZ(0) scale(2);
        opacity: 0;
    }
}

/* ===== MODAL BOOTSTRAP 5.3 ===== */
.modal-video .modal-dialog {
    position: relative;
    max-width: var(--bs-modal-width, 800px);
    margin: 60px auto 0 auto;
}

.modal-video .modal-body {
    position: relative;
    padding: 0px;
}

.modal-video .btn-close {
    position: absolute;
    width: 30px;
    height: 30px;
    right: 0px;
    top: -30px;
    z-index: 999;
    font-size: 30px;
    font-weight: normal;
    color: #FFFFFF;
    background: #000000;
    opacity: 1;
    border: none;
    border-radius: 0;
}

/* ===== ABOUT SECTION ===== */
#about .years .display-1 {
    font-size: 10rem;
    line-height: 9rem;
}

#about .years h5 {
    letter-spacing: 30px;
    margin-right: -30px;
}

/* ===== SKILLS AVEC PROGRESS BOOTSTRAP 5.3 ===== */
#skill .progress {
    height: var(--bs-progress-height, 5px);
    border-radius: var(--bs-progress-border-radius, 5px);
    background-color: var(--bs-progress-bg);
}

#skill .progress .progress-bar {
    width: 0px;
    border-radius: var(--bs-progress-border-radius, 5px);
    transition: width 3s ease;
    background-color: var(--bs-progress-bar-bg);
}

/* Navigation pills avec mode sombre */
#skill .nav-pills .nav-link {
    color: var(--bs-dark);
    transition: all 0.15s ease-in-out;
}

[data-bs-theme="dark"] #skill .nav-pills .nav-link {
    color: var(--bs-light);
}

#skill .nav-pills .nav-link.active {
    color: #FFFFFF;
    background-color: var(--bs-primary);
}

#skill .tab-content hr {
    width: 30px;
    border-color: var(--bs-primary);
}

/* ===== SERVICE AVEC MODE SOMBRE ===== */
.service-item .bg-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url("../img/bg-icon.4351e52f0b62.png") center center no-repeat;
    background-size: cover;
    color: var(--bs-primary);
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .service-item .bg-icon {
    filter: brightness(0.8);
}

/* ===== PORTFOLIO AVEC FILTRES ===== */
#portfolio-flters li {
    display: inline-block;
    font-weight: 500;
    color: var(--bs-dark);
    cursor: pointer;
    transition: all .5s ease;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 1rem;
}

[data-bs-theme="dark"] #portfolio-flters li {
    color: var(--bs-light);
}

#portfolio-flters li:hover,
#portfolio-flters li.active {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.portfolio-img {
    position: relative;
    overflow: hidden;
    border-radius: var(--bs-border-radius, 0.375rem);
}

.portfolio-btn {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: color-mix(in srgb, var(--bs-primary), transparent 10%);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 30px;
    padding-bottom: 100px !important;
    opacity: 0;
    transition: all .5s ease;
}

.portfolio-item:hover .portfolio-btn {
    opacity: 1;
    padding-bottom: 30px !important;
}

/* ===== TEAM AVEC ANIMATIONS ===== */
.team-item img {
    transition: all .5s ease;
    border-radius: var(--bs-border-radius, 0.375rem);
}

.team-item:hover img {
    opacity: .7;
    transform: scale(1.05);
}

.team-item .team-text {
    position: absolute;
    left: 0;
    right: 60px;
    bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transition: all .5s ease;
}

.team-item:hover .team-text {
    right: 30px;
    opacity: 1;
}

.team-item .team-text div {
    transition: all .5s ease;
}

.team-item:hover .team-text div {
    margin-left: 30px;
}

/* ===== TESTIMONIALS AVEC MODE SOMBRE ===== */
.testimonial-left,
.testimonial-right {
    position: relative;
}

.testimonial-left img,
.testimonial-right img {
    position: absolute;
    padding: 5px;
    border: 1px solid var(--bs-secondary);
    border-radius: 70px;
    transition: all 0.3s ease;
}

.testimonial-left img:nth-child(1),
.testimonial-right img:nth-child(3) {
    width: 70px;
    height: 70px;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.testimonial-left img:nth-child(2),
.testimonial-right img:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
}

.testimonial-left img:nth-child(3),
.testimonial-right img:nth-child(1) {
    width: 50px;
    height: 50px;
    bottom: 10%;
    right: 10%;
}

/* Owl Carousel avec mode sombre */
.testimonial-carousel .owl-item img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.testimonial-carousel .testimonial-icon {
    position: absolute;
    width: 40px;
    height: 40px;
    left: 50%;
    bottom: -15px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-secondary);
    border-radius: 60px;
    transition: all 0.3s ease;
}

.testimonial-carousel .owl-dots {
    height: 40px;
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 0 5px;
    width: 30px;
    height: 30px;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-secondary);
    border-radius: 30px;
    transition: all .5s ease;
    cursor: pointer;
}

.testimonial-carousel .owl-dot::after {
    position: absolute;
    content: "";
    width: 16px;
    height: 16px;
    top: 5px;
    left: 5px;
    border-radius: 16px;
    background: var(--bs-secondary);
    transition: all .5s ease;
}

.testimonial-carousel .owl-dot.active::after {
    background: var(--bs-primary);
}

/* ===== AMÉLIORATIONS RESPONSIVES ===== */
@media (max-width: 768px) {
    .btn-play {
        padding: 15px 17px 17px 25px;
    }

    #about .years .display-1 {
        font-size: 6rem;
        line-height: 5rem;
    }

    .portfolio-btn {
        padding: 20px;
        padding-bottom: 80px !important;
    }

    .portfolio-item:hover .portfolio-btn {
        padding-bottom: 20px !important;
    }
}

/* ===== AMÉLIORATIONS ACCESSIBILITÉ ===== */
.btn:focus-visible,
.nav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 var(--bs-focus-ring-width) var(--bs-focus-ring-color);
}

/* Réduction de mouvement */
@media (prefers-reduced-motion: reduce) {
    .btn-play:before {
        animation: none;
    }

    .team-item img,
    .portfolio-btn,
    .testimonial-carousel .owl-dot {
        transition: none;
    }
}

/* ===== CLASSES UTILITAIRES BOOTSTRAP 5.3 ===== */
.text-body-secondary {
    color: var(--bs-secondary-color) !important;
}

.bg-primary-subtle {
    background-color: var(--bs-primary-bg-subtle) !important;
}

.bg-secondary-subtle {
    background-color: var(--bs-secondary-bg-subtle) !important;
}

.border-primary-subtle {
    border-color: var(--bs-primary-border-subtle) !important;
}

.border-secondary-subtle {
    border-color: var(--bs-secondary-border-subtle) !important;
}

/* ===== SUPPORT POUR LES THÈMES PERSONNALISÉS ===== */
.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Application de la transition aux éléments principaux */
body,
.navbar,
.btn,
.card,
.modal-content {
    @extend .theme-transition;
}
/* ===== Footer "Explore" links (navbar grouping refactor) ===== */
.creative-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.5rem;
    padding-left: 0;
}

.creative-footer-links li {
    list-style: none;
    display: inline-block;
}

.creative-footer-links .footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.creative-footer-links .footer-link:hover,
.creative-footer-links .footer-link:focus {
    color: var(--bs-primary);
}


/* =========================================
   AUDIT CONTRASTE — lisibilité (jour + nuit)
   ========================================= */

/* Les variables --model-* pilotent fonds/textes du thème mais ne sont définies
   que par la customization d'un tenant. En démo (sans customization) elles sont
   absentes -> fonds transparents (ex. CTA blanc sur blanc) et textes non pilotés.
   On fournit des valeurs par défaut ; un <style> tenant injecté après surcharge. */
:root {
    --model-accent: #6244C5;
    --model-text: #3a3a4a;
    --model-body-color: #3a3a4a;
    --model-heading: #16122b;
    --model-secondary: #5a6169;
    --model-body-bg: #ffffff;
    --model-contrast: #ffffff;
    --model-nav-hover: #6244C5;
    --model-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --model-border-radius: 8px;
    --model-container-width: 1200px;
}

/* Nuit : surfaces/textes model sombres + liens en violet clair (l'accent plein
   #6244C5 est trop sombre sur fond nuit). Spécificité :root[...] (0,2,0) pour
   reprendre la main sur dark-mode.css partagé (chargé APRÈS, mais [..]=0,1,0). */
:root[data-bs-theme="dark"] {
    --model-text: #e6e6e6;
    --model-body-color: #e6e6e6;
    --model-heading: #ffffff;
    --model-secondary: #a8b3bd;
    --model-body-bg: #161c24;
    --bs-primary-bg-subtle: #1a0f33;
    --bs-link-color: #a691ff;
    --bs-link-color-rgb: 166, 145, 255;
    --bs-link-hover-color: #c0b0ff;
}

/* Nuit : badges .bg-primary-subtle.text-primary lisibles (violet clair). */
[data-bs-theme="dark"] .bg-primary-subtle.text-primary,
[data-bs-theme="dark"] a.page-link {
    color: #a691ff !important;
}

/* Nuit : l'accent violet employé en COULEUR DE TEXTE (chiffres de stats, icônes,
   filets) est trop sombre sur fond nuit -> violet clair. On épargne les éléments
   qui utilisent l'accent en FOND (leur texte blanc reste correct). */
[data-bs-theme="dark"] [style*="color: var(--model-accent)"]:not([style*="background-color: var(--model-accent)"]):not(.btn),
[data-bs-theme="dark"] .accordion-button {
    color: #a691ff !important;
}

/* AUDIT AA nuit : l'accent violet #6244c5 en outline-primary / .text-primary /
   icônes flèches est trop sombre sur fond nuit (ratio ~2.6). Violet clair. */
[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #a691ff; --bs-btn-border-color: #a691ff;
    color: #a691ff !important;
}
[data-bs-theme="dark"] .btn-outline-primary .bi,
[data-bs-theme="dark"] .text-primary,
[data-bs-theme="dark"] .link-primary,
[data-bs-theme="dark"] a.text-primary,
[data-bs-theme="dark"] .text-primary .bi { color: #a691ff !important; }
