/* =============================================
   HULYX TOP NOTIFICATION
   Style: minimalist dark — X/Twitter inspired
   Version: 1.1.0 - Header Sync (20px + 10px offset)
   ============================================= */

#hulyx-top-notif {
    /* Position */
    position: fixed;
    /* Calcul : Header (20px) + Marge (10px) = 30px */
    top: 60px; 
    left: 50%;
    /* On utilise translateZ(0) pour forcer l'accélération GPU */
    transform: translateX(-50%) translateY(-150%) translateZ(0);
    z-index: 100; /* Augmenté pour être sûr de passer au dessus de tout sauf les overlays de blocage */
    
    /* Size — matches video width on all screens */
    width: calc(var(--h-video-width, 100vw) - 24px);
    max-width: 420px;
    min-width: 280px;

    /* Layout */
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    box-sizing: border-box;

    /* Visual */
    background: var(--h-bg-surface);
    border: 1px solid #222;
    border-radius: 14px;
    overflow: visible; /* allow dot to overflow border */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);

    /* Transition — slow smooth slide from top */
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                opacity   0.75s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    will-change: transform, opacity;
}

/* Visible state */
#hulyx-top-notif.htn-show {
    transform: translateX(-50%) translateY(0) translateZ(0);
    opacity: 1;
    pointer-events: auto;
}

/* Exit state */
#hulyx-top-notif.htn-hide {
    transform: translateX(-50%) translateY(-150%) translateZ(0);
    opacity: 0;
    pointer-events: none;
}

/* --- Avatar --- */
.htn-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.htn-avatar img,
.htn-avatar svg,
.htn-avatar dotlottie-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.htn-avatar svg {
    padding: 6px;
    box-sizing: border-box;
}

/* --- Content --- */
.htn-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.htn-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.htn-body {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    line-height: 1.5;
    word-break: break-word;
}

/* Typewriter cursor — hidden, logic kept in JS */
.htn-cursor {
    display: none;
}

/* --- HUD status dot — top LEFT corner --- */
.htn-dot {
    position: absolute;
    top: 9px;
    left: 13px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff0000;
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
}

#hulyx-top-notif.htn-show .htn-dot {
    opacity: 1;
    animation: htn-dot-pulse 1.8s ease-in-out infinite;
}

@keyframes htn-dot-pulse {
    0%   { opacity: 1;    box-shadow: 0 0 0 0   rgba(255, 0, 0, 0.7); }
    50%  { opacity: 0.4;  box-shadow: 0 0 0 6px rgba(255, 0, 0, 0);   }
    100% { opacity: 1;    box-shadow: 0 0 0 0   rgba(255, 0, 0, 0);   }
}

/* --- Close button — top right --- */
.htn-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #444;
    font-size: 14px;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    align-self: flex-start;
}

.htn-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* --- Link cursor when notif has a link --- */
#hulyx-top-notif.htn-has-link {
    cursor: pointer;
}

#hulyx-top-notif.htn-has-link:hover {
    border-color: #444;
}

/* --- Hover feedback --- */
#hulyx-top-notif.htn-show:hover {
    border-color: #333;
    background: #111;
}

/* --- Mobile adjustments --- */
@media (max-width: 480px) {
    #hulyx-top-notif {
        /* On garde top: 30px ici aussi pour respecter la règle du header de 20px */
        top: 60px; 
        padding: 12px 14px;
        gap: 12px;
        /* Sur mobile, on peut élargir un peu pour utiliser l'espace */
        width: calc(100% - 20px);
    }
    .htn-avatar {
        width: 36px;
        height: 36px;
    }
    .htn-title {
        font-size: 10px;
    }
    .htn-body {
        font-size: 11px;
    }
}