/* ============================================================
   Iko — mascotte-assistant IIQARION
   Intro d'accueil (1x/session) + assistant flottant permanent.
   Charte : var(--marine) / var(--orange) (définies dans app.css).
   ============================================================ */

/* ---------- Assistant flottant (permanent) ---------- */
.iko-dock {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 60;
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(24px) scale(.6);
    transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.iko-dock.show { opacity: 1; transform: none; }
.iko-dock::before {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 88, 47, .28), transparent 65%);
    opacity: 0;
    transition: opacity .3s var(--ease);
}
.iko-dock:hover::before { opacity: 1; }
.iko-dock img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 14px 24px rgba(0, 24, 72, .38));
    animation: ikoBob 4s ease-in-out infinite;
}
.iko-dock .iko-dock-tip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    white-space: nowrap;
    background: var(--marine);
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    padding: .5rem .95rem;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: .28s var(--ease);
    box-shadow: var(--shadow);
}
.iko-dock:hover .iko-dock-tip { opacity: 1; transform: translateY(-50%); }
.iko-dock .iko-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    background: var(--orange);
    border-radius: 50%;
    box-shadow: 0 0 0 3px #fff;
    animation: ikoPulse 2s infinite;
    z-index: 1;
}

/* ---------- Intro d'accueil ---------- */
.iko-intro {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s var(--ease), visibility .5s;
    background: radial-gradient(circle at 50% 42%, rgba(0, 24, 72, .55), rgba(0, 16, 47, .88));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.iko-intro.show { opacity: 1; visibility: visible; }
.iko-intro-stage {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    max-width: 760px;
    padding: 1.5rem;
    transform: translateY(18px) scale(.98);
    transition: transform .6s var(--ease);
}
.iko-intro.show .iko-intro-stage { transform: none; }
.iko-intro .iko-avatar {
    width: 230px;
    height: 230px;
    flex: none;
    filter: drop-shadow(0 24px 46px rgba(0, 0, 0, .45));
    animation: ikoBob 3.5s ease-in-out infinite;
}
.iko-bubble {
    position: relative;
    background: #fff;
    border-radius: 22px;
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-lg);
    max-width: 430px;
}
.iko-bubble::before {
    content: "";
    position: absolute;
    left: -13px;
    top: 66px;
    border: 13px solid transparent;
    border-right-color: #fff;
    border-left: 0;
}
.iko-bubble strong { display: block; color: var(--marine); font-size: 1.4rem; margin-bottom: .3rem; letter-spacing: -.02em; }
.iko-bubble span { display: block; color: var(--muted); margin-bottom: 1.1rem; }
.iko-bubble-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.iko-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: .95rem;
    padding: .72rem 1.25rem;
    border-radius: 999px;
    transition: transform .2s var(--ease), color .2s var(--ease);
}
.iko-btn-primary { background: var(--grad-accent); color: #fff; box-shadow: var(--glow-orange); }
.iko-btn-primary:hover { color: #fff; transform: translateY(-2px); }
.iko-btn-ghost { background: transparent; color: var(--muted); }
.iko-btn-ghost:hover { color: var(--marine); }
.iko-intro-close {
    position: absolute;
    top: 1.4rem;
    right: 1.7rem;
    background: transparent;
    border: 0;
    color: #fff;
    opacity: .7;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.iko-intro-close:hover { opacity: 1; }

@keyframes ikoBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes ikoPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: .65; } }

/* ---------- Visite guidée ---------- */
.iko-tour { position: fixed; inset: 0; z-index: 190; display: none; pointer-events: none; }
.iko-tour.show { display: block; }
.iko-tour-hole {
    position: fixed;
    top: 0; left: 0; width: 0; height: 0;
    border-radius: 16px;
    box-shadow: 0 0 0 9999px rgba(0, 16, 47, .82), 0 0 0 3px var(--orange), 0 0 30px rgba(240, 88, 47, .55);
    transition: top .45s var(--ease), left .45s var(--ease), width .45s var(--ease), height .45s var(--ease), opacity .3s;
    opacity: 0;
    pointer-events: none;
}
.iko-tour-panel {
    position: fixed;
    left: 1.6rem;
    bottom: 1.6rem;
    z-index: 191;
    display: flex;
    align-items: flex-end;
    gap: .7rem;
    max-width: 540px;
    pointer-events: auto;
}
.iko-tour-panel .iko-avatar {
    width: 122px; height: 122px; flex: none;
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .45));
    animation: ikoBob 4s ease-in-out infinite;
}
.iko-tour-bubble { position: relative; background: #fff; border-radius: 20px; padding: 1.1rem 1.35rem; box-shadow: var(--shadow-lg); flex: 1; }
.iko-tour-bubble::before {
    content: ""; position: absolute; left: -12px; bottom: 34px;
    border: 12px solid transparent; border-right-color: #fff; border-left: 0;
}
.iko-tour-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .35rem; }
.iko-tour-step { font-size: .78rem; font-weight: 800; letter-spacing: .05em; color: var(--orange); text-transform: uppercase; }
.iko-tour-dots { display: flex; gap: 6px; }
.iko-tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .3s; }
.iko-tour-dots i.on { background: var(--orange); }
.iko-tour-bubble h4 { color: var(--marine); margin: 0 0 .25rem; font-size: 1.15rem; }
.iko-tour-bubble p { color: var(--muted); margin: 0 0 .9rem; font-size: .96rem; line-height: 1.5; }
.iko-tour-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.iko-btn-sm { padding: .55rem 1rem; font-size: .9rem; }
.iko-btn-film { background: var(--marine); color: #fff; }
.iko-btn-film:hover { color: #fff; background: var(--marine-700); transform: translateY(-1px); }
#ikoSkip { margin-right: auto; }

/* ---------- Modale film (lightbox) ---------- */
.iko-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    background: rgba(0, 10, 30, .9);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.iko-modal.show { display: flex; }
.iko-modal-body {
    width: 100%;
    max-width: 1100px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lg);
}
.iko-modal-body video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.iko-modal-close {
    position: absolute;
    top: 1.4rem;
    right: 1.7rem;
    z-index: 1;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    opacity: .85;
}
.iko-modal-close:hover { opacity: 1; }

@media (max-width: 640px) {
    .iko-tour-panel { left: .8rem; right: .8rem; bottom: .8rem; max-width: none; gap: .4rem; }
    .iko-tour-panel .iko-avatar { width: 76px; height: 76px; }
    .iko-tour-bubble::before { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .iko-intro-stage { flex-direction: column; text-align: center; gap: .8rem; }
    .iko-intro .iko-avatar { width: 150px; height: 150px; }
    .iko-bubble::before { display: none; }
    .iko-bubble-actions { justify-content: center; }
    .iko-dock { width: 78px; height: 78px; right: 1rem; bottom: 1rem; }
    .cta-float { bottom: 6.8rem; }  /* remonte l'ancien CTA au-dessus d'Iko */
}

@media (prefers-reduced-motion: reduce) {
    .iko-dock img, .iko-intro .iko-avatar { animation: none; }
}
