/* 6.2. États de chargement */
.content-container.loading {
    opacity: 0;
}

/* ===== Loader Hexagonal ===== */
#main {
    display: none;
    position: fixed;
    z-index: 99999;
    inset: 0;
    background: rgba(10, 25, 40, 0.96);
    justify-content: center;
    align-items: center;
}

.hex-loader {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Anneaux hexagonaux */
.hex-ring {
    position: absolute;
    inset: 0;
    clip-path: polygon(
        50% 0%, 93.3% 25%, 93.3% 75%,
        50% 100%, 6.7% 75%, 6.7% 25%
    );
}

.hex-ring-outer {
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--color-accent) 60deg,
        var(--color-accent-light) 120deg,
        transparent 180deg,
        var(--color-accent) 240deg,
        var(--color-accent-light) 300deg,
        transparent 360deg
    );
    animation: hex-spin 4s linear infinite;
    opacity: 1;
}

.hex-ring-outer::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: rgba(10, 25, 40, 0.96);
    clip-path: polygon(
        50% 0%, 93.3% 25%, 93.3% 75%,
        50% 100%, 6.7% 75%, 6.7% 25%
    );
}

.hex-ring-inner {
    inset: 24px;
    border: 2px solid var(--color-accent);
    background: transparent;
    clip-path: polygon(
        50% 0%, 93.3% 25%, 93.3% 75%,
        50% 100%, 6.7% 75%, 6.7% 25%
    );
    animation: hex-spin 6s linear infinite reverse;
    opacity: 0.7;
}

.hex-ring-inner::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(10, 25, 40, 0.96);
    clip-path: polygon(
        50% 0%, 93.3% 25%, 93.3% 75%,
        50% 100%, 6.7% 75%, 6.7% 25%
    );
}

/* Contenu central */
.hex-core {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: hex-pulse 2.5s ease-in-out infinite;
}

.hex-text {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--color-accent-light);
    text-shadow: 0 0 25px rgba(119, 92, 49, 0.6), 0 0 50px rgba(119, 92, 49, 0.2);
}

.hex-sub {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    animation: hex-fade 2s ease-in-out infinite;
}

/* Halo ambiant */
.hex-loader::before {
    content: '';
    position: absolute;
    inset: -40px;
    background: radial-gradient(
        circle,
        rgba(119, 92, 49, 0.25) 0%,
        transparent 70%
    );
    animation: hex-halo 3s ease-in-out infinite;
    pointer-events: none;
}

/* ===== Loader Light Mode ===== */
html.light-mode #main {
    background: rgba(245, 235, 224, 0.97) !important;
}

html.light-mode .hex-ring-outer {
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        #6B5328 60deg,
        #B8963A 120deg,
        transparent 180deg,
        #6B5328 240deg,
        #B8963A 300deg,
        transparent 360deg
    );
}

html.light-mode .hex-ring-outer::after,
html.light-mode .hex-ring-inner::after {
    background: rgba(245, 235, 224, 0.97);
}

html.light-mode .hex-ring-inner {
    border-width: 3px;
    border-color: #6B5328;
    opacity: 0.8;
}

html.light-mode .hex-text {
    color: #5A3A14;
    text-shadow: 0 0 20px rgba(90, 58, 20, 0.4), 0 0 45px rgba(119, 92, 49, 0.15);
}

html.light-mode .hex-sub {
    color: var(--color-text-secondary);
}

html.light-mode .hex-loader::before {
    background: radial-gradient(
        circle,
        rgba(107, 83, 40, 0.2) 0%,
        transparent 70%
    );
}
