/* ============================================================
   GameVault - Chat System Styles
   Dark theme chat interface for buyer and admin
   ============================================================ */

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px;
    max-height: 500px;
    background: rgba(10,10,26,.4);
    border-radius: 12px;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(0,212,255,.08);
    border-bottom: 1px solid rgba(0,212,255,.15);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
}

/* Status Dot */
.chat-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.chat-status-dot.online {
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0,255,136,.5);
    animation: pulse-dot 2s infinite;
}

.chat-status-dot.pending {
    background: #ff6b35;
    box-shadow: 0 0 8px rgba(255,107,53,.5);
}

.chat-status-dot.offline {
    background: rgba(255,255,255,.3);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.15);
    border-radius: 3px;
}

/* Empty State */
.chat-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted2);
}

.chat-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: .5;
}

/* Date Separator */
.chat-date-sep {
    text-align: center;
    margin: 8px 0;
}

.chat-date-sep span {
    font-size: 11px;
    color: var(--muted2);
    background: rgba(26,26,46,.6);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.06);
}

/* Message Bubbles */
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-msg-sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg-received {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    position: relative;
    word-break: break-word;
    line-height: 1.5;
    font-size: 13.5px;
}

.chat-msg-sent .chat-msg-bubble {
    background: linear-gradient(180deg, rgba(0,212,255,.2), rgba(0,212,255,.12));
    border: 1px solid rgba(0,212,255,.25);
    border-bottom-right-radius: 4px;
}

.chat-msg-received .chat-msg-bubble {
    background: rgba(26,26,46,.6);
    border: 1px solid rgba(255,255,255,.08);
    border-bottom-left-radius: 4px;
}

.chat-msg-text {
    color: var(--text);
}

.chat-msg-time {
    font-size: 10px;
    color: var(--muted2);
    margin-top: 4px;
}

/* Error Message */
.chat-msg-error {
    text-align: center;
    padding: 8px;
    background: rgba(255,68,68,.15);
    border: 1px solid rgba(255,68,68,.3);
    border-radius: 8px;
    color: #ff4444;
    font-size: 12px;
    font-weight: 600;
}

/* Typing Indicator */
.chat-typing {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--muted2);
}

.chat-typing.visible {
    display: flex;
}

.chat-typing-dots {
    display: flex;
    gap: 3px;
}

.chat-typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--muted2);
    border-radius: 50%;
    animation: typing-dot 1.4s infinite;
}

.chat-typing-dots span:nth-child(2) {
    animation-delay: .2s;
}

.chat-typing-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes typing-dot {
    0%, 60%, 100% { opacity: .3; transform: scale(.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,.06);
    background: rgba(10,10,26,.3);
}

.chat-input-area textarea {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(10,10,26,.4);
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    resize: none;
    outline: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4;
}

.chat-input-area textarea:focus {
    border-color: rgba(0,212,255,.35);
}

.chat-input-area textarea::placeholder {
    color: var(--muted2);
}

.chat-input-area textarea:disabled {
    opacity: .5;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(0,212,255,.25);
    background: rgba(0,212,255,.12);
    color: var(--cyan);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .15s ease, background .15s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    background: rgba(0,212,255,.2);
}

.chat-send-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.chat-send-btn i {
    font-size: 16px;
}

/* Admin Chat Styles */
.chat-admin-container .chat-msg-received .chat-msg-bubble {
    background: rgba(0,255,136,.1);
    border-color: rgba(0,255,136,.25);
}

.chat-admin-container .chat-msg-sent .chat-msg-bubble {
    background: rgba(255,107,53,.12);
    border-color: rgba(255,107,53,.25);
}

/* Quick Action Buttons */
.chat-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(255,255,255,.06);
    background: rgba(10,10,26,.2);
}

.chat-quick-btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(26,26,46,.5);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: transform .15s ease, border-color .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chat-quick-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(0,212,255,.35);
}

.chat-quick-btn.payment {
    border-color: rgba(255,107,53,.3);
    color: #ff6b35;
}

.chat-quick-btn.payment:hover {
    border-color: rgba(255,107,53,.6);
}

/* Admin Order Detail Chat Section */
.admin-chat-section {
    margin-top: 16px;
}

.admin-chat-section .chat-container {
    max-height: 600px;
}

/* ============================================================
   4-Option Chat Modal Styles (Account Detail Page)
   ============================================================ */

.chat-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

