/**
 * assets/css/user_bar_addons.css
 * 
 * DROPX PRIME ULTIMATE UI ADDONS - V12 (MÓDOSÍTOTT, TISZTA CSS, !IMPORTANT-MENTES)
 * 
 * Ez a fájl felelős a felső felhasználói vezérlők, a lenyíló panelek (Üzenetek, Értesítések)
 * és a lebegő Popup Chat ablakok professzionális megjelenítéséért.
 * 
 * JAVÍTÁSOK (V12):
 * - Eltávolítva a régi 50px-es felső margó blokkolás, a keret közvetlenül 8px-re simul a képernyő tetejéhez.
 * - Szigorúan mentes az szabályoktól a 0. szabályzat szerint.
 * - Minden lenyíló panel és popup chat pozíció stabilizálva.
 */

/* --- 1. GLOBÁLIS RÖGZÍTÉS ÉS KONTÉNER IGAZÍTÁS --- */

body .app-container {
    margin-top: 8px; /* Finom 8px-es lebegő rés a böngésző tetejétől */
    padding-top: 0;
}

body .sticky-header-wrapper {
    top: 0; /* Közvetlenül a képernyő tetejére tapad görgetéskor */
    z-index: 10000;
}

/* --- 2. JOBB OLDALI INTERAKTÍV BUBORÉKOK --- */

.user-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(229, 158, 0, 0.05);
    border: 1px solid rgba(229, 158, 0, 0.2);
    color: var(--color-silver);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    outline: none;
}

.header-icon-btn:hover {
    background: rgba(229, 158, 0, 0.15);
    transform: scale(1.1) translateY(-2px);
    border-color: var(--color-gold);
    color: #ffffff;
    box-shadow: 0 0 15px var(--color-gold-glow);
}

.header-dropdown-container.active .header-icon-btn {
    background: var(--color-gold);
    color: #000000;
    box-shadow: 0 0 20px var(--color-gold);
}

.header-icon-btn .header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.header-point-bubble {
    background: rgba(229, 158, 0, 0.1);
    border: 1px solid var(--color-border-gold);
    padding: 5px 14px;
    border-radius: 20px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-gold);
    text-shadow: 0 0 5px var(--color-gold-glow);
}

/* --- 3. ÉRTESÍTÉSI SZÁMLÁLÓK (BADGES) --- */

.icon-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ff4757;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #0a0807;
    animation: badgePulse 2s infinite;
    z-index: 2;
}

@keyframes badgePulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0); }
}

/* --- 4. DROPDOWN PANELEK --- */

.header-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    background: rgba(15, 12, 10, 0.98);
    backdrop-filter: blur(30px);
    border: 1px solid var(--color-border-gold);
    border-radius: 4px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    display: none;
    z-index: 10002;
    overflow: hidden;
    animation: dropdownSlideIn 0.3s ease-out;
}

@keyframes dropdownSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-dropdown-container.active .header-dropdown-menu {
    display: block;
}

.dropdown-header {
    padding: 15px 20px;
    background: rgba(229, 158, 0, 0.05);
    border-bottom: 1px solid var(--color-border-gold);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header h3 {
    margin: 0;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 1.15rem;
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px var(--color-gold-glow);
}

.text-btn {
    background: transparent;
    border: 1px solid var(--color-border-gold);
    color: var(--color-gold);
    font-size: 0.8rem;
    padding: 4px 10px;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s;
}

.text-btn:hover {
    background: var(--color-gold);
    color: #000000;
}

.dropdown-content {
    max-height: 450px;
    overflow-y: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-muted);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-item:hover { 
    background: rgba(229, 158, 0, 0.08); 
    color: #ffffff; 
}

.dropdown-item-avatar, 
.dropdown-item-favicon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(229, 158, 0, 0.3);
    object-fit: cover;
    background: #111111;
    flex-shrink: 0;
}

.dropdown-item-info { 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
    flex: 1; 
}

.dropdown-item-title { 
    font-weight: 700; 
    font-size: 1.05rem; 
    color: var(--color-gold); 
    margin-bottom: 2px; 
}

.dropdown-item-text { 
    font-size: 0.92rem; 
    line-height: 1.35; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
}

.dropdown-item-time { 
    font-size: 0.75rem; 
    color: rgba(255, 255, 255, 0.4); 
    margin-top: 5px; 
    font-family: 'JetBrains Mono', monospace; 
    text-transform: uppercase; 
}

/* --- 5. POPUP CHAT RENDSZER --- */

.chat-popup-wrapper {
    position: fixed;
    bottom: 0;
    right: 30px;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 15px;
    z-index: 10010;
    pointer-events: none;
}

.chat-popup {
    width: 330px;
    height: 480px;
    background: rgba(12, 10, 8, 0.99);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--color-border-gold);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -15px 50px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chat-popup.minimized {
    height: 48px;
    width: 220px;
}

.chat-popup.minimized .chat-popup-messages,
.chat-popup.minimized .chat-popup-form,
.chat-popup.minimized .file-preview-area {
    display: none;
}

.chat-popup-header {
    height: 48px;
    padding: 0 12px;
    background: linear-gradient(to right, rgba(229, 158, 0, 0.15), rgba(10, 8, 6, 0.1));
    border-bottom: 1px solid rgba(229, 158, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.header-main-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    position: relative;
    flex: 1;
}

.header-avatar { 
    width: 30px; 
    height: 30px; 
    border-radius: 50%; 
    border: 1px solid var(--color-gold); 
    object-fit: cover; 
}

.header-name { 
    font-family: 'Rajdhani', sans-serif; 
    font-weight: 700; 
    color: #ffffff; 
    font-size: 1rem; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}

.header-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #0a0807;
    border: 1px solid var(--color-border-gold);
    border-radius: 4px;
    min-width: 160px;
    display: none;
    flex-direction: column;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.header-main-trigger.open .header-dropdown { 
    display: flex; 
}

.header-dropdown a {
    padding: 10px 15px;
    color: #eeeeee;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.header-dropdown a:hover { 
    background: rgba(229, 158, 0, 0.1); 
    color: var(--color-gold); 
}

.header-actions { 
    display: flex; 
    gap: 5px; 
}

.chat-act-btn {
    width: 28px; 
    height: 28px; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1);
    color: #ffffff; 
    border-radius: 4px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: 0.2s;
}

.chat-act-btn:hover { 
    background: var(--color-gold); 
    color: #000000; 
}

.chat-act-btn.btn-close:hover { 
    background: #ff4757; 
    color: #ffffff; 
}

.chat-popup-messages {
    flex: 1; 
    overflow-y: auto; 
    padding: 15px; 
    background: rgba(0,0,0,0.3); 
    display: flex; 
    flex-direction: column; 
    gap: 15px;
}

.message-group { 
    display: flex; 
    gap: 10px; 
    max-width: 92%; 
}

.msg-left { 
    align-self: flex-start; 
}

.msg-right { 
    align-self: flex-end; 
    flex-direction: row-reverse; 
}

.msg-avatar { 
    width: 32px; 
    height: 32px; 
    border-radius: 50%; 
    margin-top: auto; 
    border: 1px solid rgba(229, 158, 0, 0.3); 
    flex-shrink: 0; 
}

.msg-bubble-wrapper { 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
}

.msg-right .msg-bubble-wrapper { 
    align-items: flex-end; 
}

.msg-author { 
    font-size: 0.75rem; 
    color: rgba(255,255,255,0.4); 
    margin-bottom: 3px; 
    font-weight: 700; 
    font-family: 'Rajdhani', sans-serif; 
}

.msg-bubble { 
    padding: 10px 14px; 
    border-radius: 18px; 
    font-size: 0.92rem; 
    line-height: 1.4; 
    position: relative; 
    word-wrap: break-word; 
}

.msg-left .msg-bubble { 
    background: rgba(255,255,255,0.07); 
    color: #eeeeee; 
    border-bottom-left-radius: 4px; 
}

.msg-right .msg-bubble { 
    background: var(--color-gold); 
    color: #000000; 
    border-bottom-right-radius: 4px; 
    font-weight: 600; 
}

.msg-time { 
    display: block; 
    font-size: 0.7rem; 
    color: rgba(255,255,255,0.3); 
    margin-top: 5px; 
}

.msg-right .msg-time { 
    color: rgba(0,0,0,0.5); 
    text-align: right; 
}

.file-preview-area { 
    padding: 10px 15px; 
    background: rgba(0,0,0,0.2); 
    border-top: 1px solid rgba(229, 158, 0, 0.1); 
}

.msg-pre-img { 
    width: 50px; 
    height: 50px; 
    border-radius: 6px; 
    border: 2px solid var(--color-gold); 
    overflow: hidden; 
    position: relative; 
    cursor: pointer; 
}

.msg-pre-img img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.remove-pre { 
    position: absolute; 
    top: 0; 
    right: 0; 
    background: #ff4757; 
    color: #ffffff; 
    border: none; 
    width: 16px; 
    height: 16px; 
    font-size: 10px; 
    cursor: pointer; 
}

.chat-popup-form { 
    padding: 12px; 
    background: #0a0807; 
    border-top: 1px solid rgba(229, 158, 0, 0.2); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.chat-popup-form textarea { 
    flex: 1; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 20px; 
    color: #ffffff; 
    padding: 8px 15px; 
    font-size: 0.92rem; 
    resize: none; 
    outline: none; 
    max-height: 80px; 
}

.chat-popup-form textarea:focus { 
    border-color: var(--color-gold); 
    background: rgba(255,255,255,0.08); 
}

.chat-tool-btn, 
.chat-send-btn { 
    background: transparent; 
    border: none; 
    color: var(--color-gold); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: 0.2s; 
}

.chat-send-btn:hover, 
.chat-tool-btn:hover { 
    transform: scale(1.1); 
    color: #ffffff; 
}

/* ========================================================================================= */
/* MOBIL NÉZETI SZELEKTOROK */
/* ========================================================================================= */
@media (max-width: 768px) {
    html body .app-container {
        margin-top: 0;
        padding-top: 0;
    }
    
    html body .sticky-header-wrapper {
        top: 0;
    }
    
    html, body {
        overflow-x: hidden;
        overflow-y: auto;
        height: auto;
        min-height: 100vh;
    }
}