/*
 * os/ghost-cursor.css
 * Curseur fantome de l'Agent global : pointeur + ondes sonar qui emanent
 * vers l'exterieur (dans l'esprit de l'onde du bouton menu d'applications),
 * et onde de clic plus marquee. Habillage uniquement ; le positionnement
 * est pose en JS (transform translate) cf. ghost-cursor.js.
 */

.mio-ghost-cursor-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2147483600; /* au-dessus des fenetres et du panneau agent */
    overflow: hidden;
}

/* Conteneur : simple ancre posee au point exact du curseur (transform JS).
   Tous les enfants sont centres sur ce point via top/left:0 + marges. */
.mio-ghost-cursor {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    will-change: transform;
}

.mio-ghost-cursor.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Rond blanc central */
.mio-ghost-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow:
        0 0 6px rgba(255, 255, 255, 0.85),
        0 0 14px hsla(265, 90%, 70%, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.4);
    z-index: 3;
    transition: transform 0.12s ease;
}

/* Onde fine, en continu, qui emane du rond et s'estompe vers l'exterieur. */
.mio-ghost-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    border: 1px solid hsla(265, 90%, 74%, 0.6);
    opacity: 0;
    transform: scale(0.35);
    z-index: 1;
    will-change: transform, opacity;
}

.mio-ghost-cursor.is-visible .mio-ghost-wave {
    animation: mioGhostWave 2s ease-out infinite;
}

.mio-ghost-cursor.is-visible .mio-ghost-wave:nth-child(2) {
    animation-delay: 1s;
}

@keyframes mioGhostWave {
    0%   { transform: scale(0.35); opacity: 0.55; }
    70%  { opacity: 0; }
    100% { transform: scale(3); opacity: 0; }
}

/* Clic : le rond s'enfonce brievement */
.mio-ghost-cursor.is-pressing .mio-ghost-dot {
    transform: scale(0.6);
}

/* Onde FORTE au clic : anneau epais qui se propage largement au point du clic. */
.mio-ghost-ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 3px solid hsla(265, 90%, 66%, 0.95);
    box-shadow: 0 0 18px hsla(265, 90%, 62%, 0.6);
    opacity: 0;
    will-change: transform, opacity;
    animation: mioGhostRipple 0.62s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes mioGhostRipple {
    0%   { opacity: 0.95; transform: scale(0.4); }
    100% { opacity: 0; transform: scale(6); }
}

/* Pulse du bouton de la barre des taches quand l'agent ouvre une app */
.taskbar-app.agent-opened-pulse {
    animation: mioTaskbarAgentPulse 0.9s ease-out 2;
}

@keyframes mioTaskbarAgentPulse {
    0%   { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.55); }
    60%  { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .mio-ghost-cursor.is-visible .mio-ghost-wave { animation: none; }
    .mio-ghost-ripple { animation-duration: 0.3s; }
    .taskbar-app.agent-opened-pulse { animation: none; }
}
