/* ══════════════════════════════════════════════════════
 *  SPHERA — Mini-Sphère Avatar (composant partagé)
 *  Inclure sur toutes les pages sauf login.html
 * ══════════════════════════════════════════════════════ */

/* ── ORB CONTAINER ── */
#avatar-orb {
    position: fixed; top: 20px; right: 20px;
    z-index: 9999;
    pointer-events: all;
    opacity: 0;
    animation: orbFadeIn 1s 1.5s forwards;
}

@keyframes orbFadeIn {
    from { opacity: 0; transform: scale(0.8) translateX(20px); }
    to   { opacity: 1; transform: scale(1) translateX(0); }
}

/* ── ORB BUTTON ── */
.orb-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(0,255,255,0.4);
    background: radial-gradient(circle at 35% 35%, rgba(0,255,255,0.15), rgba(0,10,30,0.8));
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0,255,255,0.15), inset 0 0 15px rgba(0,255,255,0.05);
    transition: all 0.3s ease;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.orb-btn:hover {
    border-color: rgba(0,255,255,0.7);
    box-shadow: 0 0 30px rgba(0,255,255,0.3), inset 0 0 20px rgba(0,255,255,0.1);
    transform: scale(1.08);
}
.orb-btn.open {
    border-color: var(--color-cyan, #00f0ff);
    box-shadow: 0 0 40px rgba(0,255,255,0.4);
}

/* ── AVATAR IMAGE (centre crop en filigrane) ── */
.orb-avatar-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
    opacity: 0.5;
    filter: saturate(0.6) brightness(0.7);
    pointer-events: none;
    z-index: 0;
}
.orb-avatar-bg.loaded {
    opacity: 0.55;
}

/* ── FALLBACK INITIALS ── */
.orb-fallback {
    font-family: var(--font-hud, 'Orbitron', monospace);
    font-size: 0.7em; font-weight: 700;
    color: var(--color-cyan, #00f0ff);
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 1;
    position: relative;
}

/* ── ORBITAL RINGS ── */
.orb-ring {
    position: absolute; inset: -4px;
    border: 1px solid transparent;
    border-top-color: rgba(0,255,255,0.3);
    border-right-color: rgba(255,0,170,0.2);
    border-radius: 50%;
    animation: orbSpin 4s linear infinite;
    pointer-events: none;
}
.orb-ring-inner {
    position: absolute; inset: -8px;
    border: 1px solid transparent;
    border-bottom-color: rgba(0,255,255,0.15);
    border-left-color: rgba(255,0,170,0.1);
    border-radius: 50%;
    animation: orbSpin 6s linear infinite reverse;
    pointer-events: none;
}

@keyframes orbSpin { to { transform: rotate(360deg); } }

/* ── STATUS DOT ── */
.orb-status {
    position: absolute; bottom: 2px; right: 2px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #00ff88;
    border: 2px solid rgba(0,10,20,0.9);
    box-shadow: 0 0 6px #00ff88;
    pointer-events: none;
    z-index: 2;
}

/* ── DROPDOWN MENU ── */
.orb-menu {
    position: absolute; top: 60px; right: 0;
    display: flex; flex-direction: column; gap: 6px;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 170px;
}
.orb-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── MENU ITEMS ── */
.orb-menu-item {
    display: flex; align-items: center; gap: 10px;
    background: rgba(2,10,25,0.85);
    border: 1px solid rgba(0,255,255,0.15);
    backdrop-filter: blur(12px);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-hud, 'Orbitron', monospace);
    font-size: 0.55em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
}
.orb-menu-item:hover {
    background: rgba(0,255,255,0.08);
    border-color: rgba(0,255,255,0.4);
    transform: translateX(-4px);
}
.orb-menu-icon {
    font-size: 1em;
    width: 20px; text-align: center;
}

/* ── DANGER ITEM (Déconnexion) ── */
.orb-menu-item.danger {
    color: rgba(255,100,100,0.8);
    border-color: rgba(255,80,80,0.15);
}
.orb-menu-item.danger:hover {
    background: rgba(255,50,50,0.08);
    border-color: rgba(255,80,80,0.4);
}

/* ── CURRENT PAGE HIGHLIGHT ── */
.orb-menu-item.current {
    border-color: rgba(0,255,255,0.4);
    background: rgba(0,255,255,0.06);
    opacity: 0.5;
    pointer-events: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
    #avatar-orb { top: 14px; right: 14px; }
    .orb-btn { width: 44px; height: 44px; }
    .orb-status { width: 8px; height: 8px; }
    .orb-menu { min-width: 150px; }
    .orb-menu-item { padding: 9px 12px; font-size: 0.5em; }
}
