/**
 * assets/css/user_bar_addons.css
 * 
 * DROPX PRIME ULTIMATE UI ADDONS - V10 (VÉGLEGES, PROFESSZIONÁLIS)
 * 
 * Ez a fájl felelős a felső felhasználói sáv, a lenyíló panelek (Üzenetek, Értesítések)
 * és a lebegő Popup Chat ablakok professzionális megjelenítéséért.
 * 
 * JAVÍTÁSOK:
 * - Bal/Jobb üzenetbuborékok: Szigorú elrendezés avatarokkal és nevekkel.
 * - Fejléc Dropdown: High-tech lebegő menü a partner nevére kattintva.
 * - Kép-előnézet: Optimalizált terület a szövegmező felett a csatolmányoknak.
 * - Minimalizált mód: Professzionális, kompakt megjelenés.
 * - Lightbox fix: Biztosított középre igazítás és láthatóság.
 * - Lightbox: Új stílusok a lapozható galéria gombjaihoz és számlálójához.
 */

/* --- 1. GLOBÁLIS RÖGZÍTÉS ÉS MÉRETEZÉS --- */

.user-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(10, 8, 6, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--color-border-gold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 10001;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

.app-container {
    margin-top: 50px !important; 
    padding-top: 0 !important;
}

.sticky-header-wrapper {
    top: 50px !important; 
    z-index: 10000;
}

/* --- 2. BAL OLDALI RENDSZER-INFORMÁCIÓK (NEON DESIGN) --- */

.user-bar-left {
    display: flex;
    align-items: center;
    gap: 30px;
}

.neon-green-glow {
    color: #00ff66 !important;
    text-shadow: 0 0 10px rgba(0, 255, 102, 0.8), 0 0 20px rgba(0, 255, 102, 0.4);
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gold-orange-glow {
    color: #ff9900 !important;
    text-shadow: 0 0 10px rgba(255, 153, 0, 0.7), 0 0 20px rgba(255, 153, 0, 0.3);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- 3. 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: #fff;
    box-shadow: 0 0 15px var(--color-gold-glow);
}

.header-dropdown-container.active .header-icon-btn {
    background: var(--color-gold);
    color: #000;
    box-shadow: 0 0 20px var(--color-gold);
}

.header-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50% !important;
}

.header-point-bubble {
    background: rgba(229, 158, 0, 0.1);
    border: 1px solid var(--color-border-gold);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-gold);
    text-shadow: 0 0 5px var(--color-gold-glow);
}

/* --- 4. ÉRTESÍTÉSI SZÁMLÁLÓK (BADGES) --- */

.icon-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    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); }
}

/* --- 5. 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 !important;
}

.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';
    font-size: 1.1rem;
    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.75rem;
    padding: 4px 10px;
    cursor: pointer;
    font-family: 'Rajdhani';
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s;
}

.text-btn:hover {
    background: var(--color-gold);
    color: #000;
}

.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: #fff; }

.dropdown-item-avatar, .dropdown-item-favicon {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    border: 1px solid rgba(229, 158, 0, 0.3);
    object-fit: cover;
    background: #111;
    flex-shrink: 0;
}

.dropdown-item-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dropdown-item-title { font-weight: 700; font-size: 0.95rem; color: var(--color-gold); margin-bottom: 2px; }
.dropdown-item-text { font-size: 0.85rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dropdown-item-time { font-size: 0.7rem; color: rgba(255, 255, 255, 0.4); margin-top: 5px; font-family: 'JetBrains Mono'; text-transform: uppercase; }

/* --- 6. POPUP CHAT RENDSZER - PROFESSZIONÁLIS UI --- */

/* Az ablakok gyűjtőhelye */
.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;
}

/* Egyedi Chat ablak */
.chat-popup {
    width: 330px;
    height: 480px;
    background: rgba(12, 10, 8, 0.99);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px); /* Webkit kompatibilitás */
    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;
}

/* Minimalizált állapot */
.chat-popup.minimized {
    height: 48px !important;
    width: 220px;
}

.chat-popup.minimized .chat-popup-messages,
.chat-popup.minimized .chat-popup-form,
.chat-popup.minimized .file-preview-area {
    display: none !important;
}

/* FEJLÉC ÉS DROPDOWN MENÜ */
.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'; font-weight: 700; color: #fff; font-size: 0.95rem; display: flex; align-items: center; gap: 5px; }

/* Fejléc Dropdown stílusa */
.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: #eee;
    text-decoration: none;
    font-size: 0.85rem;
    font-family: 'Rajdhani';
    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: #fff; 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: #000; }
.chat-act-btn.btn-close:hover { background: #ff4757; color: #fff; }

/* ÜZENETEK ÉS BUBORÉKOK (BAL/JOBB) */
.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.7rem; color: rgba(255,255,255,0.4); margin-bottom: 3px; font-weight: 700; font-family: 'Rajdhani'; }

.msg-bubble { padding: 10px 14px; border-radius: 18px; font-size: 0.85rem; line-height: 1.4; position: relative; word-wrap: break-word; }

.msg-left .msg-bubble { background: rgba(255,255,255,0.07); color: #eee; border-bottom-left-radius: 4px; }
.msg-right .msg-bubble { background: var(--color-gold); color: #000; border-bottom-right-radius: 4px; font-weight: 600; }

.msg-time { display: block; font-size: 0.65rem; color: rgba(255,255,255,0.3); margin-top: 5px; }
.msg-right .msg-time { color: rgba(0,0,0,0.5); text-align: right; }

/* MÉDIA ÉS KÉP ELŐNÉZET */
/* JAVÍTVA: Ezeket a stílusokat most már a messages.css kezeli, a messages.php-val összhangban.
.msg-media { margin-top: 8px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); cursor: pointer; max-width: 100%; }
.msg-media img { width: 100%; display: block; transition: 0.3s; }
.msg-media:hover img { opacity: 0.8; }
*/

.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: #fff; border: none; width: 16px; height: 16px; font-size: 10px; cursor: pointer; }

/* BEVITELI MEZŐ */
.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: #fff; padding: 8px 15px; font-size: 0.85rem; 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: #fff; }

/* --- 8. LIGHTBOX ÉS MODÁLIS FIXEK --- */
#image-modal-overlay.active { 
    display: flex !important; 
    align-items: center; 
    justify-content: center; 
    z-index: 2147483647; /* Nagyon magas z-index, hogy biztosan minden felett legyen */
    background: rgba(0,0,0,0.9); /* Sötétebb, jobban elhomályosító háttér */
}
.modal-image-wrapper {
    position: relative; /* Ahhoz, hogy a gombok pozicionálhatók legyenek hozzá képest */
    max-width: 90vw; 
    max-height: 90vh; 
    display: flex; /* Hogy a kép középen legyen a wrapperben */
    align-items: center; 
    justify-content: center;
}
.modal-image-content { 
    max-width: 100%; /* Hogy a kép ne lógjon ki a wrapperből */
    max-height: 100%; /* Hogy a kép ne lógjon ki a wrapperből */
    border: 2px solid var(--color-gold); 
    border-radius: 8px; 
    box-shadow: 0 0 50px rgba(0,0,0,1); 
    object-fit: contain; /* Tartalmazza az egész képet az arányok megőrzésével */
}

/* ÚJ: Lightbox navigációs gombok */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    border: none;
    color: #fff;
    font-size: 30px;
    padding: 10px;
    cursor: pointer;
    z-index: 2147483647; /* Még magasabb, mint az overlay */
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
.lightbox-nav-btn:hover:not(:disabled) {
    background: rgba(0,0,0,0.8);
}
.lightbox-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
#lightbox-prev-btn { left: -60px; }
#lightbox-next-btn { right: -60px; }

/* ÚJ: Lightbox számláló */
#lightbox-counter {
    position: absolute;
    bottom: -40px; /* Kép alatt helyezkedik el */
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-family: 'Chakra Petch', sans-serif;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 2147483647; /* Még magasabb, mint az overlay */
}

/* ÚJ: CSS a fájl ikonhoz az előnézetben */
.image-preview-item .file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #222; /* Sötétebb háttér a fájl ikonnak */
    color: var(--color-gold);
}
.image-preview-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7em;
    padding: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}