/* css/chat_panel.css */

/* --- 1. OVERLAY & CONTAINER --- */

.chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    /* Deep Dark Overlay */
    z-index: 2000;
    display: flex;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    user-select: none;
    /* Prevent text selection for app-like feel */
}

/* --- 2. HEADER --- */

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    background: #151515;
    border-bottom: 1px solid #222;
    height: 54px;
    flex-shrink: 0;
}

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.green-dot {
    width: 8px;
    height: 8px;
    background: #28a909;
    border-radius: 50%;
    box-shadow: 0 0 6px #28a909;
}

#chat_online_count {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.close-chat-btn {
    color: #888;
    font-size: 22px;
    cursor: pointer;
    font-weight: bold;
    padding: 5px;
}

/* --- 3. CHAT BODY (SCROLL AREA) --- */

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Space between messages */
    background: #000;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll on mobile */
}

/* Custom Scrollbar for Chat */

.chat-body::-webkit-scrollbar {
    width: 4px;
}

.chat-body::-webkit-scrollbar-track {
    background: #000;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

/* --- 4. MESSAGE ROW --- */

.chat-msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
    width: 100%;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #333;
    flex-shrink: 0;
    object-fit: cover;
}

.msg-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-right: 40px;
    /* Space reserved for Like Button */
}

.msg-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.chat-user-id {
    color: #999;
    font-size: 13px;
    font-weight: 500;
}

.chat-text {
    color: #eee;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    font-weight: 400;
}

/* GIF Styling in Chat */

.chat-gif-img {
    width: 100%;
    max-width: 200px;
    /* Limit GIF width */
    border-radius: 8px;
    margin-top: 6px;
    border: 1px solid #333;
    display: block;
}

/* --- 5. LIKE BUTTON (THUMB ICON) --- */

.msg-like {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.1s;
}

.like-icon-svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #666;
    /* Default Grey Outline */
    stroke-width: 2;
    transition: all 0.2s ease;
}

.l-count {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    min-width: 8px;
}

/* Liked State (Red) */

.msg-like.liked .like-icon-svg {
    stroke: #e50539;
    fill: rgba(229, 5, 57, 0.2);
    /* Light Red Fill */
}

.msg-like.liked .l-count {
    color: #e50539;
    font-weight: bold;
}

/* --- 6. BANNED MESSAGE BOX --- */

.banned-box {
    background: rgba(30, 5, 5, 0.9);
    /* Dark Red Tint */
    border: 1px solid #e50539;
    /* Bright Red Border */
    border-radius: 6px;
    padding: 10px;
    color: #ddd;
    font-size: 13px;
    text-align: left;
    margin: 5px 0;
    line-height: 1.5;
    position: relative;
}

.banned-id {
    color: #e50539;
    font-weight: bold;
    font-family: 'Roboto Mono', monospace;
    /* Monospace for ID */
    font-size: 13px;
}

/* --- 7. FOOTER INPUT AREA --- */

.chat-footer {
    background: #111;
    padding: 10px 15px;
    border-top: 1px solid #222;
    flex-shrink: 0;
}

#chat_input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 15px;
    padding: 8px 0;
    outline: none;
}

#chat_input::placeholder {
    color: #555;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
}

.btn-gif {
    background: #222;
    border: 1px solid #444;
    color: #ccc;
    padding: 4px 12px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    transition: background 0.2s;
}

.btn-gif:active {
    background: #333;
}

.char-count {
    color: #444;
    font-size: 12px;
    margin-left: auto;
    margin-right: 15px;
}

.send-arrow {
    color: #666;
    font-size: 22px;
    cursor: pointer;
    transform: rotate(90deg);
    /* Arrow Pointing Right/Up */
    display: inline-block;
    transition: color 0.2s;
}

.send-arrow:active {
    color: #28a909;
}

/* --- 8. GIF MODAL (WITH SEARCH) --- */

.gif-modal {
    position: absolute;
    bottom: 70px;
    /* Above Footer */
    left: 10px;
    right: 10px;
    height: 320px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 12px;
    z-index: 2001;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.gif-header {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    flex-shrink: 0;
}

/* Search Bar */

#gif_search_input {
    flex: 1;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}

#gif_search_input:focus {
    border-color: #555;
}

.close-gif {
    color: #888;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    padding: 5px;
}

/* GIF Grid */

.gif-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* 2 Columns */
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    /* Fills remaining height */
    padding-bottom: 5px;
}

.gif-grid img {
    width: 100%;
    height: 100px;
    /* Fixed height for uniformity */
    object-fit: cover;
    /* Crop to fit */
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #333;
    background: #000;
    transition: opacity 0.2s;
}

.gif-grid img:active {
    opacity: 0.7;
}

.loading-text {
    grid-column: span 2;
    text-align: center;
    color: #666;
    font-size: 12px;
    padding: 20px;
}