/**
 * VICICHAT NOTIF ADDON - AESTHETICS (STABLE 1.2.1)
 * Updated: 2026-06-10
 */

/* 1. THE NOTIF TRIGGER BUTTON */
.vici-notif-trigger {
    position: fixed !important; 
    z-index: 999999 !important; 
    top: 20px !important;
    right: 20px !important;
    padding: 10px 20px !important;
    border-radius: 14px !important;
    font-family: inherit;
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    cursor: pointer !important;
    
    /* DEFAULT HIDDEN STATE */
    display: none !important; 
    align-items: center;
    justify-content: center;
    
    background: rgba(15, 5, 30, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Visibility logic: Button only appears when vici-active is present */
.vici-notif-trigger.vici-active {
    display: flex !important;
}

.vici-notif-trigger.glow-alert {
    background: rgba(255, 40, 90, 0.95) !important; 
    border: 2px solid #fff !important;
    box-shadow: 0 0 30px rgba(255, 40, 90, 0.8), 0 0 10px rgba(255, 40, 90, 0.4) !important;
    color: #fff !important;
    animation: viciSignalPulse 1.2s infinite ease-in-out !important;
}

/* 2. THE NOTIF DRAWER (Styles remain unchanged) */
#vici-notif-drawer {
    position: fixed !important; top: -600px; left: 50%; transform: translateX(-50%); 
    width: 90%; max-width: 420px; max-height: 480px; z-index: 999998 !important; padding: 25px; border-radius: 28px;
    background: rgba(15, 2, 35, 0.92) !important; backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important; border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1); display: flex; flex-direction: column; box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
}
#vici-notif-drawer.is-open { top: 30px; }

.vici-drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.vici-drawer-title { font-size: 13px; font-weight: 900; letter-spacing: 2px; color: #fff; text-transform: uppercase; }
.vici-drawer-close { background: none; border: none; color: rgba(255, 255, 255, 0.5); font-size: 24px; cursor: pointer; line-height: 1; }
.vici-drawer-close:hover { color: #ff285a; }

/* 3. NOTIF CARDS */
#vici-notif-list { overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-color: #00f3ff transparent; }
#vici-notif-list::-webkit-scrollbar { width: 4px; }
#vici-notif-list::-webkit-scrollbar-track { background: transparent; }
#vici-notif-list::-webkit-scrollbar-thumb { background: #00f3ff; border-radius: 10px; }

.vici-notif-card { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 20px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s ease; }
.vici-notif-card:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(0, 243, 255, 0.4); transform: translateY(-2px); }
.vici-notif-info { flex: 1; margin-right: 15px; overflow: hidden; }
.vici-notif-handle { display: block; color: #00f3ff; font-weight: 900; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.vici-notif-snippet { margin: 0; color: rgba(255, 255, 255, 0.7); font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vici-notif-open-btn { background: #00f3ff; border: none; color: #000; padding: 8px 16px; border-radius: 12px; font-size: 11px; font-weight: 900; cursor: pointer; box-shadow: 0 4px 15px rgba(0, 243, 255, 0.3); transition: all 0.2s ease; }
.vici-notif-open-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0, 243, 255, 0.5); background: #fff; }

/* 4. ANIMATIONS */
@keyframes viciSignalPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.2); }
    100% { transform: scale(1); filter: brightness(1); }
}
.vici-pulse-update { animation: viciCardFlash 0.6s ease; }
@keyframes viciCardFlash {
    0% { background: rgba(0, 243, 255, 0.2); border-color: #00f3ff; }
    100% { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }
}
.vici-fade-in { animation: viciFadeIn 0.4s ease-out forwards; }
@keyframes viciFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 5. Per-notification READ / CLEAR controls */
.vici-notif-card { min-height: 92px; gap: 10px; }
.vici-notif-info { min-width: 0; margin-right: 2px; }
.vici-notif-actions { flex: 0 0 58px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 5px; }
.vici-notif-actions button { width: 58px; min-height: 23px; padding: 4px 3px; border-radius: 7px; font-size: 8px; line-height: 1.1; font-weight: 900; letter-spacing: .4px; cursor: pointer; }
.vici-notif-read-btn { color: #00191c; background: #00f3ff; border: 1px solid rgba(0,243,255,.8); }
.vici-notif-clear-btn { color: #fff; background: rgba(255,40,90,.78); border: 1px solid rgba(255,100,130,.7); }
.vici-notif-open-btn { color: #032116; background: #19c779; border: 1px solid rgba(25,199,121,.95); box-shadow: 0 2px 8px rgba(25,199,121,.22); padding: 4px 3px !important; }
.vici-notif-open-btn:hover { background: #30e391; border-color: #30e391; }
.vici-notif-read-btn { order: 2; }
.vici-notif-clear-btn { order: 3; }
.vici-notif-open-btn { order: 1; }
.vici-notif-actions button:active { transform: scale(.96); }
@media (max-width: 380px) { .vici-notif-card { padding: 11px; gap: 7px; } .vici-chat-avatar { flex: 0 0 38px; } .vici-chat-avatar img { width: 38px; height: 38px; } .vici-notif-actions { flex-basis: 52px; } .vici-notif-actions button { width: 52px; } .vici-notif-info { margin-right: 0; } }


/* 6. READ ALL control on the right end of the red notification bar */
.vici-notif-trigger { gap: 10px !important; justify-content: space-between !important; }
.vici-notif-trigger-label { min-width: 0; flex: 1 1 auto; text-align: left; }
.vici-notif-read-all-btn { flex: 0 0 auto; padding: 5px 8px !important; border-radius: 8px !important; border: 1px solid rgba(255,255,255,.8) !important; background: rgba(90,0,20,.65) !important; color: #fff !important; font-size: 8px !important; font-weight: 900 !important; letter-spacing: .4px !important; line-height: 1.1 !important; cursor: pointer !important; box-shadow: 0 0 8px rgba(255,255,255,.15) !important; }
.vici-notif-read-all-btn:hover { background: #fff !important; color: #b00032 !important; }
.vici-notif-read-all-btn:active { transform: scale(.96); }


/* 7. Explicit trigger controls: the glowing bar itself is not clickable. */
.vici-notif-trigger { cursor: default !important; }
.vici-notif-trigger-label { cursor: default !important; }
.vici-notif-show-all-btn,
.vici-notif-read-all-btn { flex: 0 0 auto; padding: 5px 7px !important; border-radius: 8px !important; border: 1px solid rgba(255,255,255,.85) !important; color: #fff !important; font-size: 8px !important; font-weight: 900 !important; letter-spacing: .25px !important; line-height: 1.1 !important; cursor: pointer !important; white-space: nowrap; }
.vici-notif-show-all-btn { background: rgba(0,95,55,.92) !important; }
.vici-notif-show-all-btn:hover { background: #19c779 !important; color: #04170d !important; }
.vici-notif-read-all-btn { background: rgba(90,0,20,.78) !important; }
.vici-notif-read-all-btn:hover { background: #fff !important; color: #b00032 !important; }
.vici-notif-show-all-btn:active, .vici-notif-read-all-btn:active { transform: scale(.96); }
@media (max-width: 380px) { .vici-notif-trigger { gap: 5px !important; padding: 8px 9px !important; letter-spacing: .4px !important; } .vici-notif-show-all-btn, .vici-notif-read-all-btn { padding: 5px 5px !important; font-size: 7px !important; } }


/* 7. Compact two-line preview; the complete message remains stored separately for speech. */
.vici-notif-card { align-items: center; }
.vici-notif-info { overflow: hidden; min-width: 0; }
.vici-notif-snippet {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.4;
    max-height: calc(1.4em * 2);
    max-width: 100%;
    user-select: text;
}
.vici-notif-actions { flex-shrink: 0; align-self: center; }





/* 8. Admin-controlled READ ALL visibility: hidden must win over all button styling. */
.vici-notif-trigger .vici-notif-read-all-btn[hidden],
.vici-notif-trigger .vici-notif-read-all-btn.vici-read-all-disabled {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}


/* 8. Never display the notification trigger or drawer on Phase 4.
   JavaScript applies this class on phase transitions; !important also defeats inline display styles. */
.vici-notif-trigger.vici-notif-phase4-hidden,
#vici-notif-drawer.vici-notif-phase4-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}


/* V1.7.5: circular X dismisses only the glowing bar, not the notification list. */
.vici-notif-bar-clear-btn {
    flex: 0 0 24px !important; width: 24px !important; min-width: 24px !important;
    height: 24px !important; min-height: 24px !important; padding: 0 !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    box-sizing: border-box !important; border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,.9) !important; background: rgba(35,35,35,.94) !important;
    color: #fff !important; font-size: 15px !important; font-weight: 900 !important;
    letter-spacing: 0 !important; line-height: 1 !important; cursor: pointer !important;
    white-space: nowrap !important; text-align: center !important;
}
.vici-notif-bar-clear-btn:hover { background: #b00032 !important; color: #fff !important; }
.vici-notif-bar-clear-btn:active { transform: scale(.92); }
.vici-notif-trigger.vici-notif-bar-dismissed { display: none !important; pointer-events: none !important; }
@media (max-width: 380px) { .vici-notif-bar-clear-btn { flex-basis: 24px !important; width: 24px !important; min-width: 24px !important; height: 24px !important; min-height: 24px !important; font-size: 15px !important; padding: 0 !important; } }

.vici-notif-trigger.vici-notif-bar-exiting {
    animation: viciNotifBarSlideAway .26s ease-in forwards !important;
    pointer-events: none !important;
}
@keyframes viciNotifBarSlideAway { to { transform: translateY(-140px); opacity: 0; } }
@-webkit-keyframes viciNotifBarSlideAway { to { -webkit-transform: translateY(-140px); opacity: 0; } }


/* 1.7.4: icon-only trigger with a brighter yellow bell */
.vici-notif-trigger-label {
    color: #fff200 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-shadow: 0 0 5px rgba(255, 242, 0, .95), 0 0 12px rgba(255, 220, 0, .8) !important;
    filter: brightness(1.25) saturate(1.35) !important;
    flex: 0 0 auto !important;
    min-width: 24px !important;
    text-align: center !important;
}


/* V1.7.6: compact notification bar, centered READ ALL, borderless SHOW/X, smaller bell. */
.vici-notif-trigger {
    box-sizing: border-box !important;
    padding: 4px 9px !important;
    gap: 8px !important;
    min-height: 32px !important;
    height: auto !important;
    justify-content: space-between !important;
    border: 0 !important;
}
.vici-notif-trigger-label {
    font-size: 18.7px !important; /* 15% smaller than 22px */
    min-width: 21px !important;
    line-height: 1 !important;
}
.vici-notif-show-all-btn {
    border: 0 !important;
    box-shadow: none !important;
    padding: 5px 8px !important;
    flex: 0 0 auto !important;
}
.vici-notif-read-all-btn {
    order: 3 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    border: 0 !important;
    box-shadow: none !important;
    flex: 0 0 auto !important;
}
.vici-notif-show-all-btn { order: 2 !important; }
.vici-notif-bar-clear-btn {
    order: 4 !important;
    border: 0 !important;
    box-shadow: none !important;
    flex: 0 0 24px !important;
    width: 24px !important; min-width: 24px !important;
    height: 24px !important; min-height: 24px !important;
}
@media (max-width: 380px) {
    .vici-notif-trigger { padding: 4px 7px !important; gap: 5px !important; min-height: 30px !important; }
    .vici-notif-trigger-label { font-size: 18.7px !important; min-width: 20px !important; }
    .vici-notif-show-all-btn, .vici-notif-read-all-btn { padding: 5px 5px !important; }
}


/* V1.7.7: subtle bell giggle every 2 seconds; visual only, no sound. */
.vici-notif-trigger-label {
    display: inline-block !important;
    transform-origin: 50% 12% !important;
    animation: viciBellGiggle 2s ease-in-out infinite !important;
    will-change: transform;
}
@keyframes viciBellGiggle {
    0%, 82%, 100% { transform: rotate(0deg); }
    84% { transform: rotate(-13deg); }
    86% { transform: rotate(13deg); }
    88% { transform: rotate(-10deg); }
    90% { transform: rotate(8deg); }
    92% { transform: rotate(-5deg); }
    94% { transform: rotate(3deg); }
    96% { transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
    .vici-notif-trigger-label { animation: none !important; will-change: auto; }
}


/* V1.7.8: keep the red notification bar steady; shrink the circular X by 5%. */
.vici-notif-trigger.glow-alert {
    animation: none !important;
}
.vici-notif-bar-clear-btn {
    flex-basis: 22.8px !important;
    width: 22.8px !important;
    min-width: 22.8px !important;
    height: 22.8px !important;
    min-height: 22.8px !important;
    font-size: 95% !important;
    padding: 0 !important;
}
@media (max-width: 380px) {
    .vici-notif-bar-clear-btn {
        flex-basis: 22.8px !important;
        width: 22.8px !important;
        min-width: 22.8px !important;
        height: 22.8px !important;
        min-height: 22.8px !important;
        font-size: 95% !important;
    }
}

/* Grouped unread messages: keep sender messages in one card with visible breaks. */
#vici-notif-list .vici-notif-snippet { white-space: pre-line; }
