/* ============================================
   CHAT BOX & USER PROFILE HOVER STÍLUSOK
   SZÍN: #1167ff (weboldal fő kék színe)
   ============================================ */

/* ============================================
   CHAT WRAPPER (Chat + Online Users Box)
   ============================================ */

.chat-wrapper {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    pointer-events: none;
}

.chat-wrapper > * {
    pointer-events: all;
}

.forum-hero-side {
    width: 460px;
    max-width: 100%;
    display: grid;
    gap: 12px;
    justify-self: end;
}

.forum-hero-side .forum-stats {
    min-width: 0;
    width: 100%;
}

.chat-restore-dock {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.chat-restore-dock[hidden],
.chat-restore-card[hidden] {
    display: none !important;
}

.chat-restore-card {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #fff;
    text-align: left;
    background: rgba(12, 20, 37, 0.88);
    border: 1px solid rgba(17, 103, 255, 0.42);
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.chat-restore-card:hover {
    transform: translateY(-1px);
    border-color: rgba(17, 103, 255, 0.85);
    background: rgba(17, 103, 255, 0.16);
}

.chat-restore-card i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #1167ff;
    background: rgba(17, 103, 255, 0.16);
    border-radius: 8px;
    font-size: 16px;
}

.chat-restore-card span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.chat-restore-card strong {
    font-size: 14px;
    line-height: 1.1;
}

.chat-restore-card small {
    color: #9ba7bd;
    font-size: 12px;
}

/* ============================================
   ONLINE USERS BOX (Becsukható/Kinyitható)
   ============================================ */

.online-users-box {
    width: 280px;
    height: 450px;
    background: rgba(10, 15, 25, 0.95);
    border: 1px solid rgba(17, 103, 255, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.3s ease;
    cursor: grab;
    position: relative;
}

.online-users-box.minimized {
    height: 60px;
}

.online-users-header {
    padding: 15px 20px;
    background: rgba(17, 103, 255, 0.1);
    border-bottom: 1px solid rgba(17, 103, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.online-users-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1167ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-window-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.online-users-count {
    background: rgba(17, 103, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 13px;
}

.online-users-toggle,
.chat-toggle,
.chat-window-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    width: 30px;
    height: 30px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 16px;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.online-users-toggle:hover,
.chat-toggle:hover {
    color: #1167ff;
    background: rgba(17, 103, 255, 0.14);
}

.chat-window-close:hover {
    color: #fff;
    background: rgba(255, 83, 101, 0.2);
}

.online-users-box.minimized .online-users-toggle i {
    transform: rotate(180deg);
}

.online-users-list-wrap {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.online-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.online-user-item:hover {
    background: rgba(17, 103, 255, 0.1);
}

.online-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(17, 103, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #1167ff;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.online-user-avatar img,
.chat-message-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.online-user-status {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #00ff88;
    border: 2px solid rgba(10, 15, 25, 0.95);
    border-radius: 50%;
}

.online-user-info {
    flex: 1;
    min-width: 0;
}

.online-user-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-user-rank {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin: 2px 0 0 0;
}

/* Rang színek az online usersnél */
.online-user-name.owner { color: #ff0055; }
.online-user-name.developer { color: #c084fc; }
.online-user-name.admin { color: #1167ff; }
.online-user-name.moderator { color: #00ff88; }
.online-user-name.member { color: rgba(255, 255, 255, 0.9); }

/* ============================================
   FÓRUM TETEJÉN ONLINE USERS SÁV (REJTVE)
   ============================================ */

.forum-online-bar {
    display: none;
}

.forum-online-user {
    border: 1px solid rgba(17, 103, 255, 0.35);
    background: rgba(17, 103, 255, 0.12);
    color: #1167ff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.forum-online-user:hover {
    background: rgba(17, 103, 255, 0.2);
}

/* ============================================
   CHAT BOX
   ============================================ */

.chat-box {
    width: 380px;
    height: 500px;
    background: rgba(10, 15, 25, 0.95);
    border: 1px solid rgba(17, 103, 255, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: height 0.3s ease;
    cursor: grab;
    position: relative;
}

.chat-box.minimized {
    height: 60px;
}

.chat-box.is-closed,
.online-users-box.is-closed {
    display: none !important;
}

.chat-box.is-dragging,
.online-users-box.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.chat-box button,
.chat-box input,
.online-users-box button,
.online-users-box input,
.online-user-item,
.chat-message-name {
    cursor: pointer;
}

.chat-header {
    padding: 15px 20px;
    background: rgba(17, 103, 255, 0.1);
    border-bottom: 1px solid rgba(17, 103, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1167ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-box.minimized .chat-toggle i {
    transform: rotate(180deg);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-info {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin: auto;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: chatMessageSlide 0.3s ease;
    position: relative;
}

.chat-message:hover .chat-message-delete {
    opacity: 1;
}

@keyframes chatMessageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(17, 103, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #1167ff;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-message-content {
    flex: 1;
    min-width: 0;
}

.chat-message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.chat-message-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

.chat-message-name:hover {
    color: #1167ff;
    text-decoration: underline;
}

.chat-message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.chat-message-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 85, 0.8);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-message-delete:hover {
    background: rgba(255, 0, 85, 1);
    transform: scale(1.1);
}

.chat-input-wrap {
    padding: 15px;
    border-top: 1px solid rgba(0, 174, 255, 0.3);
    display: flex;
    gap: 10px;
    background: rgba(0, 174, 255, 0.05);
}

/* RANG ALAPÚ NÉV SZÍNEK A CHATBEN */
.chat-message-name.owner { color: #ff0055; }
.chat-message-name.developer { color: #c084fc; }
.chat-message-name.admin { color: #1167ff; }
.chat-message-name.moderator { color: #00ff88; }
.chat-message-name.member { color: rgba(255, 255, 255, 0.9); }

.chat-input-wrap input {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input-wrap input:focus {
    border-color: #1167ff;
    background: rgba(255, 255, 255, 0.08);
}

.chat-input-wrap input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-input-wrap button {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1167ff, #0047ff);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-wrap button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(17, 103, 255, 0.4);
}

.chat-input-wrap button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   USER PROFILE HOVER CARD
   ============================================ */

.user-profile-card {
    position: fixed;
    width: 300px;
    background: rgba(10, 15, 25, 0.98);
    border: 1px solid rgba(17, 103, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    z-index: 11000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    overflow: hidden;
}

.user-profile-card.show {
    opacity: 1;
    pointer-events: auto;
}

.profile-card-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(17, 103, 255, 0.2), rgba(0, 71, 255, 0.2));
    border-bottom: 1px solid rgba(17, 103, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-card-avatar {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    border-radius: 50%;
    background: rgba(17, 103, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #1167ff;
    font-weight: 700;
    position: relative;
    border: 2px solid #1167ff;
    overflow: hidden;
}

.profile-card-avatar::before {
    content: attr(data-initial);
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.profile-card-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.profile-card-avatar img[hidden] {
    display: none !important;
}

.profile-card-info {
    flex: 1;
    min-width: 0;
}

.profile-card-info strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.rank-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rank-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.rank-owner {
    background: linear-gradient(135deg, #ff0055, #ff5555);
    color: #fff;
}

.rank-developer {
    background: linear-gradient(135deg, #b24bff, #da4bff);
    color: #fff;
}

.rank-admin {
    background: linear-gradient(135deg, #1167ff, #0047ff);
    color: #fff;
}

.rank-moderator {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
    color: #000;
}

.rank-member {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.profile-card-body {
    padding: 20px;
}

.profile-card-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.profile-card-row:last-child {
    border-bottom: none;
}

.profile-card-row i {
    width: 20px;
    text-align: center;
    color: #1167ff;
}

.profile-card-row strong {
    color: #fff;
    font-weight: 600;
}

.profile-card-open {
    width: 100%;
    min-height: 38px;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: linear-gradient(135deg, #1167ff, #0047ff);
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.profile-card-open:hover {
    filter: brightness(1.08);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .forum-hero-side {
        width: 100%;
    }

    .chat-restore-dock {
        grid-template-columns: 1fr;
    }

    .chat-wrapper {
        bottom: 10px;
        right: 10px;
        left: 10px;
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .online-users-box {
        width: 100%;
        max-height: 200px;
    }

    .chat-box {
        width: 100%;
        height: 400px;
    }

    .user-profile-card {
        max-width: 90%;
        left: 50% !important;
        transform: translateX(-50%);
    }
}

/* Online users sidebar (régi, rejtve) */
.chat-online-users {
    display: none;
}
