/* ============================================================
   AYIRA — METAVERSE PAGE
   public/css/metaverse.css
   ✅ Utilise les variables de style.css — compatible thème clair/sombre
   ============================================================ */

/* ── Variables locales bridgées vers le système global ────── */
.metaverse-container {
    --m-orange  : var(--ayira-orange, #F39C12);
    --m-gold    : var(--gold,         #D4AF37);
    --m-red     : var(--ayira-red,    #C0392B);
    --m-bg      : var(--bg-primary,   #080808);
    --m-surface : var(--bg-secondary, #111111);
    --m-surface2: var(--bg-tertiary,  #191919);
    --m-border  : rgba(212, 175, 55, 0.25);
    --m-text    : var(--text-color,   rgba(255,255,255,.85));
    --m-muted   : var(--text-muted,   rgba(255,255,255,.45));
}

/* ── Thème clair ─────────────────────────────────────────── */
body.light-theme .metaverse-container {
    --m-bg      : var(--bg-primary,  #f5f5f5);
    --m-surface : var(--bg-secondary,#ffffff);
    --m-surface2: var(--bg-tertiary, #e8e8e8);
    --m-border  : rgba(180, 140, 30, 0.3);
    --m-text    : var(--text-color,  #1a1a1a);
    --m-muted   : var(--text-muted,  #5a6c7d);
}

/* ── Container global ────────────────────────────────────── */
.metaverse-container {
    min-height: 100vh;
    padding-bottom: 5rem;
    background: var(--m-bg);
    transition: background 0.3s ease;
}

/* ─────────────────────────────────────────────────────────────
   HEADER
───────────────────────────────────────────────────────────── */
.metaverse-header {
    text-align: center;
    padding: 4rem 2rem 3rem;
    position: relative;
}

.metaverse-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--m-gold));
}

.metaverse-eyebrow {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--m-gold);
    margin-bottom: 1.25rem;
}

.metaverse-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 900;
    background: linear-gradient(135deg, var(--m-orange) 0%, var(--m-gold) 60%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

body:not(.light-theme) .metaverse-title {
    filter: drop-shadow(0 0 24px rgba(243,156,18,.45));
}
body.light-theme .metaverse-title {
    filter: none;
}

.metaverse-subtitle {
    font-size: 1.05rem;
    color: var(--m-muted);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
    font-weight: 300;
    font-family: 'Outfit', sans-serif;
}

/* ─────────────────────────────────────────────────────────────
   UNITY PLAYER
───────────────────────────────────────────────────────────── */
.unity-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.unity-frame {
    background: #000;
    border: 1px solid var(--m-border);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s ease;
}

body:not(.light-theme) .unity-frame {
    box-shadow:
        0 0 0 1px rgba(212,175,55,.08),
        0 40px 80px rgba(0,0,0,.7);
}
body.light-theme .unity-frame {
    box-shadow:
        0 0 0 1px rgba(180,140,30,.12),
        0 20px 50px rgba(0,0,0,.15);
}

.unity-canvas-area {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
}

#unity-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ─────────────────────────────────────────────────────────────
   LOADING SCREEN
───────────────────────────────────────────────────────────── */
.loading-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.6s ease;
}

body:not(.light-theme) .loading-screen { background: #080808; }
body.light-theme       .loading-screen { background: #f0f0f0; }

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-ring {
    width: 72px;
    height: 72px;
    border: 2px solid rgba(212,175,55,.15);
    border-top-color: var(--m-gold);
    border-radius: 50%;
    animation: m-spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes m-spin { to { transform: rotate(360deg); } }

.loading-label {
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    color: var(--m-gold);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.progress-track {
    width: 240px;
    height: 2px;
    background: rgba(128,128,128,.15);
    border-radius: 1px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--m-orange), var(--m-gold));
    width: 0%;
    transition: width 0.3s;
}

/* ─────────────────────────────────────────────────────────────
   BARRE DE CONTRÔLES
───────────────────────────────────────────────────────────── */
.control-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--m-border);
    background: var(--m-surface);
    flex-wrap: wrap;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(128,128,128,.18);
    color: var(--m-muted);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.control-btn:hover {
    border-color: var(--m-gold);
    color: var(--m-gold);
    background: rgba(212,175,55,.06);
}

body.light-theme .control-btn {
    border-color: rgba(0,0,0,.15);
    color: var(--m-muted);
}
body.light-theme .control-btn:hover {
    border-color: var(--m-orange);
    color: var(--m-orange);
    background: rgba(243,156,18,.08);
}

.control-btn i { font-size: 0.85rem; }

.control-bar-spacer { flex: 1; }

.status-dot {
    width: 7px;
    height: 7px;
    background: #2ECC71;
    border-radius: 50%;
    box-shadow: 0 0 6px #2ECC71;
    animation: m-pulse-dot 2s ease-in-out infinite;
}

@keyframes m-pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.status-label {
    font-size: 0.75rem;
    color: var(--m-muted);
    letter-spacing: 0.05em;
    font-family: 'Outfit', sans-serif;
}

/* ─────────────────────────────────────────────────────────────
   EN-TÊTE DE SECTION (partagé)
───────────────────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-line {
    flex: 1;
    height: 1px;
    background: var(--m-border);
    transition: background 0.3s ease;
}

.section-title {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--m-gold);
    white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────
   CARROUSEL INSTRUCTIONS
───────────────────────────────────────────────────────────── */
.carousel-section {
    max-width: 700px;
    margin: 3rem auto 0;
    padding: 0 2rem 4rem;
}

/* Conteneur principal */
.carousel-track {
    border-radius: 16px;
    border: 1px solid var(--m-border);
    background: var(--m-surface);
    overflow: hidden;
    transition: border-color 0.3s ease, background 0.3s ease;
}

body:not(.light-theme) .carousel-track {
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
body.light-theme .carousel-track {
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}

/* Barre de progression en haut */
.carousel-progress {
    height: 2px;
    background: rgba(212,175,55,0.1);
}

.carousel-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--m-orange), var(--m-gold));
    width: 16.66%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wrapper des slides */
.carousel-slides {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chaque slide */
.carousel-slide {
    min-width: 100%;
    padding: 2rem 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    box-sizing: border-box;
    text-align: center;
}

/* ── Image de l'instruction ─────────────────────────────── */
.carousel-img-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: var(--m-bg);
    border: 1px solid rgba(212,175,55,0.15);
    transition: border-color 0.2s ease;
}

body.light-theme .carousel-img-wrap {
    border-color: rgba(180,140,30,0.2);
    background: #e8e8e8;
}

.carousel-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.carousel-img-wrap:hover img {
    transform: scale(1.03);
}

/* Placeholder affiché si l'image est absente */
.carousel-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(212,175,55,0.25);
    font-size: 0.7rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.light-theme .carousel-img-placeholder {
    color: rgba(180,140,30,0.4);
}

.carousel-img-placeholder i {
    font-size: 1.8rem;
}

/* Badge touche clavier */
.carousel-key {
    display: inline-block;
    background: var(--m-bg);
    border: 1px solid rgba(212,175,55,0.5);
    border-radius: 8px;
    padding: 0.3rem 0.9rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--m-gold);
    letter-spacing: 0.08em;
    transition: background 0.3s ease;
}

body.light-theme .carousel-key {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* Titre du contrôle */
.carousel-name {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--m-text);
    line-height: 1.2;
    transition: color 0.3s ease;
}

/* Description */
.carousel-desc {
    font-size: 0.95rem;
    color: var(--m-muted);
    line-height: 1.7;
    max-width: 420px;
    font-weight: 300;
    font-family: 'Outfit', sans-serif;
    transition: color 0.3s ease;
}

/* Compteur numérique */
.carousel-counter {
    font-size: 0.72rem;
    color: rgba(212,175,55,0.45);
    letter-spacing: 0.2em;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* Barre de contrôles du carrousel */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.25rem;
    border-top: 1px solid var(--m-border);
    background: var(--m-surface2);
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* Boutons précédent / suivant */
.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(212,175,55,0.35);
    color: var(--m-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: rgba(212,175,55,0.1);
    border-color: rgba(212,175,55,0.7);
    transform: scale(1.06);
}

.carousel-btn:active {
    transform: scale(0.95);
}

body.light-theme .carousel-btn {
    border-color: rgba(180,140,30,0.4);
}

/* Points de navigation */
.carousel-dots {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(212,175,55,0.2);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}

.carousel-dot.active {
    background: var(--m-gold);
    transform: scale(1.4);
}

body.light-theme .carousel-dot {
    background: rgba(180,140,30,0.25);
}
body.light-theme .carousel-dot.active {
    background: var(--m-orange);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .metaverse-header  { padding: 3rem 1.5rem 2rem; }
    .unity-wrapper     { padding-inline: 1rem; }
    .carousel-section  { padding-inline: 1rem; }
    .carousel-slide    { padding: 1.5rem 1.25rem 2rem; }
    .carousel-name     { font-size: 1.15rem; }
    .control-bar-spacer { display: none; }
    .status-dot,
    .status-label      { display: none; }
}