/* =========================================
   USER PROVIDED STYLES (Liquid Glass & Base)
   ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    /* optionnel pour éviter sélection du texte sur mobile */
}

:root {
    --bg: #000;
    --panel-bg: rgba(255, 255, 255, 0.025);
    --panel-border: rgba(255, 255, 255, 0.06);
    --accent: #4898ff;
    --soft-white: rgba(255, 255, 255, 0.92);
    --glass-blur: 10px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: #FFFFFF;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Customization (Merged) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ---------- GLASS BASE ---------- */
.glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(var(--glass-blur)) saturate(120%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.02) inset;
}

/* ---------- HEADER / NAVBAR (Mapped to header) ---------- */
header {
    position: fixed;
    width: calc(100% - 40px);
    left: 20px;
    right: 20px;
    top: 12px;
    z-index: 1000;
    padding: 8px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;

    /* STYLE LIQUID GLASS EXACT */
    border-radius: 19.32px;
    isolation: isolate;
    box-shadow: 0px 6px 24px rgba(0, 0, 0, 0.2), 0 0 5px rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: none;
}

.logo img {
    height: 32px;
    display: block;
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 19.32px;
    backdrop-filter: blur(6px) saturate(220%) brightness(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(220%) brightness(1.2);
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.1) 45%, rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 200%;
    animation: glassShine 8s ease-in-out infinite;
    box-shadow: inset 0 0 15px -5px #000000, inset 0 0 12px rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

header::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 19.32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 40%);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    filter: url(#glass-distortion);
    -webkit-filter: url(#glass-distortion);
    pointer-events: none;
}

/* Ensure content sits above the glass layers */
header>* {
    position: relative;
    z-index: 1;
}

header:active,
header:focus-within {
    transform: none;
}

/* 2. Protection stricte */
header,
header *,
.burger-container,
.burger-container *,
.burger-menu,
.burger-menu *,
.logo,
.burger-icon {
    user-select: none !important;
    -webkit-user-select: none !important;
}

.burger-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.burger-icon {
    position: relative;
    width: 30px;
    height: 25px;
    cursor: pointer;
    display: none;
    /* cacher par défaut en desktop */
    flex-direction: column;
    justify-content: space-between;
}

.burger-icon span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.burger-icon span:nth-child(1) {
    top: 0;
}

.burger-icon span:nth-child(2) {
    top: 8px;
}

.burger-icon span:nth-child(3) {
    top: 16px;
}

.burger-icon.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
}

.burger-icon.active span:nth-child(2) {
    opacity: 0;
}

.burger-icon.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 8px;
}

/* menu */
.burger-menu {
    display: flex;
    flex-direction: row;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 12px;
    align-items: center;
}

.burger-menu li {
    margin: 0 10px;
}

.burger-menu a,
.burger-menu select {
    color: white;
    text-decoration: none;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

/* --- Sexy Language Toggle --- */
.lang-toggle {
    display: flex;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2px;
    width: 64px;
    height: 32px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 10px;
}

.lang-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.lang-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 26px;
    background: #E0E0E0;
    border-radius: 18px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1);
    z-index: 0;
}

.lang-toggle[data-lang-current="en"] .lang-slider {
    transform: translateX(32px);
}

.lang-toggle span {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    font-family: 'Rajdhani', sans-serif;
    color: #666;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.lang-toggle span.active {
    color: #000;
}

@media (max-width: 768px) {
    .lang-toggle {
        margin: 20px auto 10px;
        width: 80px;
        height: 40px;
    }

    .lang-slider {
        width: 36px;
        height: 34px;
    }

    .lang-toggle[data-lang-current="en"] .lang-slider {
        transform: translateX(40px);
    }
}

.burger-menu li a {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .burger-icon {
        display: block;
    }

    .burger-menu {
        display: none;
        flex-direction: column;
        background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.78));
        position: absolute;
        top: 70px;
        right: 0;
        width: 250px;
        padding: 1rem;
        z-index: 1000;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.03);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    }

    .burger-menu.show {
        display: flex;
    }

    .burger-menu li {
        margin: 10px 0;
    }
}

@media (max-width: 768px) {
    header {
        width: calc(100% - 28px);
        left: 14px;
        right: 14px;
        padding: 8px 16px;
    }
}

/* Animation Keyframes */
@keyframes glassShine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* =========================================
   EXISTING UTILITIES (Preserved)
   ========================================= */

.glass-panel {
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bg-grid {
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.video-fallback {
    background: linear-gradient(45deg, #050505, #0f172a);
    position: relative;
    overflow: hidden;
}

.video-fallback::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.05) 0%, transparent 50%);
    animation: spin 15s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Navigation Active State */
.nav-link.active {
    color: var(--accent);
    border-bottom: 1px solid var(--accent);
}

/* =========================================
   LIQUID GLASS SELECTION (Apple Style)
   ========================================= */

/* 1. Réactivation intelligente de la sélection pour le contenu */
body,
p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
span,
div,
a,
section,
article {
    user-select: text;
    -webkit-user-select: text;
}

/* 2. Protection stricte */
header,
header *,
.burger-container,
.burger-container *,
.burger-menu,
.burger-menu *,
.logo,
.burger-icon {
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* 3. L'effet Visuel "Liquid Blue" */
::selection {
    background: rgba(0, 113, 227, 0.35);
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0, 113, 227, 0.6);
}

::-moz-selection {
    background: rgba(0, 113, 227, 0.35);
    color: #ffffff;
    text-shadow: 0 0 12px rgba(0, 113, 227, 0.6);
}

/* ---------- LAYOUT STABILIZATION ---------- */
#app-root {
    min-height: 100vh;
    /* Pushes footer to bottom before content loads */
}

footer {
    min-height: 380px;
    /* Precise height to prevent pop-in shifts */
    display: flex;
    flex-direction: column;
    background-color: #050505;
    /* zaalis-black */
    padding-top: 4rem;
    /* pt-16 */
    padding-bottom: 2rem;
    /* pb-8 */
    position: relative;
    z-index: 10;
    contain: layout style;
    /* Optimize rendering */
}

/* Prevent icon loading shifts */
footer i[data-lucide] {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
}

/* Stabilize footer grid */
footer .grid {
    min-height: 200px;
}

/* Prevent social icons from shifting */
footer .flex.space-x-6 {
    min-height: 2rem;
}

footer .flex.space-x-6 a {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    footer {
        min-height: 600px;
    }

    footer .grid {
        min-height: 400px;
    }
}

/* ---------- LARGE BACKGROUND GRID ---------- */
.large-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-size: 80px 80px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-attachment: fixed;
    /* Stationary grid */
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 90%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 90%);
}

/* Hero stabilization */
#tpl-home+section,
section.hero-main {
    min-height: 100vh;
}

@media (max-width: 768px) {
    .large-grid {
        background-size: 50px 50px;
        background-attachment: scroll !important;
    }

    .glass-panel {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(18, 18, 18, 0.9);
    }

    /* Fix pour l'image Architecture Blindée sur mobile */
    img[alt="Architecture Blindée"] {
        object-fit: contain !important;
        height: auto !important;
        max-height: 100%;
        width: 100%;
    }

    /* Masquer l'espace gris sous l'image Architecture Blindée */
    img[alt="Architecture Blindée"]+* {
        display: none;
    }

    /* Ajuster le conteneur parent pour qu'il s'adapte à l'image */
    .reveal:has(img[alt="Architecture Blindée"])>div {
        height: auto !important;
        overflow: hidden;
    }
}