/* ============================================
   CHAT.CSS v3.0 - OniList Community Chat
   ============================================ */

/* ===== INLINE CHAT SECTION ===== */
.inline-chat-section { margin-top: 0.5rem; }

.inline-chat-box {
    position: relative;
    background: var(--bg-secondary, #141824);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 380px;
}

.inline-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.07));
    background: rgba(255,255,255,0.02);
    flex-shrink: 0;
}

.inline-chat-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary, #e8eaf2);
}

.inline-chat-online {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: #10b981;
    font-weight: 600;
}

.chat-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    flex-shrink: 0;
    animation: chatDotPulse 2s ease-in-out infinite;
}

@keyframes chatDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== MESSAGES ===== */
.inline-chat-messages {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
    scroll-behavior: smooth;
}

.inline-chat-messages::-webkit-scrollbar { width: 3px; }
.inline-chat-messages::-webkit-scrollbar-track { background: transparent; }
.inline-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

/* ===== MESSAGE BUBBLES ===== */
.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    animation: msgIn 0.2s ease forwards;
}

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

.chat-msg.own { flex-direction: row-reverse; }

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    line-height: 1;
}

.chat-bubble-wrap {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-msg.own .chat-bubble-wrap { align-items: flex-end; }

.chat-sender {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary, #8892a4);
    padding: 0 3px;
}

.chat-bubble {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px 12px 12px 3px;
    padding: 0.45rem 0.7rem;
    font-size: 0.83rem;
    color: var(--text-primary, #c8d0e0);
    line-height: 1.45;
    word-break: break-word;
}

.chat-msg.own .chat-bubble {
    background: rgba(255,51,102,0.18);
    border-color: rgba(255,51,102,0.28);
    border-radius: 12px 12px 3px 12px;
    color: #e8eaf2;
}

.chat-time {
    font-size: 0.66rem;
    color: var(--text-muted, #4b5563);
    padding: 0 3px;
}

.chat-system {
    align-self: center;
    font-size: 0.75rem;
    color: var(--text-muted, #4b5563);
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
    padding: 0.3rem 0.75rem;
    max-width: 90%;
    text-align: center;
}

.chat-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    flex: 1;
}

.chat-loading-dots { display: flex; gap: 5px; align-items: center; }

.chat-loading-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,51,102,0.45);
    animation: ldot 1.2s ease-in-out infinite;
}
.chat-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ldot {
    0%,80%,100% { transform: scale(0.7); opacity: 0.4; }
    40%          { transform: scale(1.1); opacity: 1; }
}

/* ===== GUEST SECTION - Site uyumlu, temiz ===== */
.inline-chat-guest {
    flex-shrink: 0;
    border-top: 1px solid var(--border, rgba(255,255,255,0.07));
}

.icg-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    flex-wrap: wrap;
}

.icg-label {
    font-size: 0.8rem;
    color: var(--text-secondary, #8892a4);
    white-space: nowrap;
    margin: 0;
    flex: 1;
}

.icg-btns {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.icg-btn-login,
.icg-btn-register {
    padding: 0.4rem 0.85rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
    border: none;
    white-space: nowrap;
    line-height: 1;
}

.icg-btn-login {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--text-secondary, #8892a4);
}

.icg-btn-login:hover {
    border-color: rgba(255,255,255,0.28);
    color: var(--text-primary, #e8eaf2);
    background: rgba(255,255,255,0.05);
}

.icg-btn-register {
    background: var(--accent-primary, #ff3366);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,51,102,0.28);
}

.icg-btn-register:hover {
    background: #ff1f55;
    box-shadow: 0 4px 14px rgba(255,51,102,0.42);
    transform: translateY(-1px);
}

/* ===== INPUT AREA ===== */
.inline-chat-input-area {
    flex-shrink: 0;
    border-top: 1px solid var(--border, rgba(255,255,255,0.07));
    padding: 0.55rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    background: rgba(255,255,255,0.01);
}

.inline-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
}

.inline-chat-my-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    line-height: 1;
}

#inlineChatInput {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    color: var(--text-primary, #e8eaf2);
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    resize: none;
    outline: none;
    min-height: 34px;
    max-height: 80px;
    line-height: 1.4;
    transition: border-color 0.2s, background 0.2s;
}

#inlineChatInput:focus {
    border-color: rgba(255,51,102,0.35);
    background: rgba(255,51,102,0.04);
}

#inlineChatInput::placeholder { color: var(--text-muted, #4b5563); font-size: 0.79rem; }

#inlineChatSendBtn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-primary, #ff3366);
    border: none;
    color: #fff;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255,51,102,0.28);
}

#inlineChatSendBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,51,102,0.42);
}

#inlineChatSendBtn:disabled {
    background: rgba(255,255,255,0.07);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.45;
}

.inline-chat-hint {
    font-size: 0.67rem;
    color: var(--text-muted, #4b5563);
    padding-left: 34px;
}

/* ===== FLOATING CHAT BUTTON ===== */
#chatToggleBtn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 8000;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff3366, #ff5580);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255,51,102,0.4);
    transition: all 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
}

#chatToggleBtn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 28px rgba(255,51,102,0.55);
}

#chatBadge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    background: #fbbf24;
    color: #07090f;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 9px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #07090f;
    line-height: 1;
}

#chatBadge.show { display: flex; }

/* ===== FLOATING CHAT WINDOW ===== */
#chatWindow {
    position: fixed;
    bottom: 4.8rem;
    right: 1.5rem;
    z-index: 7999;
    width: 320px;
    max-height: 500px;
    background: var(--bg-secondary, #141824);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    box-shadow: 0 20px 70px rgba(0,0,0,0.65);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.93) translateY(10px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.175,0.885,0.32,1.275), opacity 0.25s ease;
}

#chatWindow.open { transform: scale(1) translateY(0); opacity: 1; }

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 0.9rem;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.chat-header-icon { font-size: 1.1rem; line-height: 1; }
.chat-header-info { flex: 1; min-width: 0; }

.chat-header-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary, #e8eaf2);
    line-height: 1.2;
}

.chat-header-sub {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-secondary, #8892a4);
    margin-top: 1px;
}

.chat-close-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    color: var(--text-secondary, #8892a4);
    width: 26px;
    height: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-close-btn:hover {
    background: rgba(239,68,68,0.14);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
    scroll-behavior: smooth;
}

#chatMessages::-webkit-scrollbar { width: 3px; }
#chatMessages::-webkit-scrollbar-track { background: transparent; }
#chatMessages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.chat-guest-prompt {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.chat-guest-icon { font-size: 1.5rem; margin-bottom: 0.3rem; }

.chat-guest-prompt h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary, #e8eaf2);
    margin-bottom: 0.2rem;
}

.chat-guest-prompt p {
    font-size: 0.75rem;
    color: var(--text-secondary, #8892a4);
    margin-bottom: 0.65rem;
}

.chat-guest-prompt button {
    background: var(--accent-primary, #ff3366);
    color: white;
    border: none;
    padding: 0.42rem 1rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.chat-guest-prompt button:hover { background: #ff1f55; transform: translateY(-1px); }

.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    padding: 0.6rem 0.7rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.01);
    flex-shrink: 0;
    position: relative;
}

.chat-input-area.hidden { display: none !important; }

.chat-input-area textarea {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    padding: 0.48rem 0.65rem;
    color: var(--text-primary, #e8eaf2);
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    resize: none;
    outline: none;
    min-height: 34px;
    max-height: 90px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.chat-input-area textarea:focus {
    border-color: rgba(255,51,102,0.35);
    background: rgba(255,51,102,0.04);
}

.chat-input-area textarea::placeholder { color: var(--text-muted, #4b5563); font-size: 0.79rem; }

.chat-char-count {
    position: absolute;
    bottom: 1.4rem;
    right: 3.2rem;
    font-size: 0.65rem;
    color: var(--text-muted, #4b5563);
    background: var(--bg-secondary, #141824);
    padding: 1px 4px;
    border-radius: 4px;
    pointer-events: none;
}

.chat-char-count.warn { color: #f59e0b; }
.chat-char-count.over { color: #ef4444; }

#chatSendBtn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-primary, #ff3366);
    border: none;
    color: white;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255,51,102,0.28);
}

#chatSendBtn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,51,102,0.42);
}

#chatSendBtn:disabled {
    background: rgba(255,255,255,0.07);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.45;
}


/* ===== SCROLL INDICATOR ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    #chatWindow { width: calc(100vw - 1.5rem); right: 0.75rem; bottom: 4.2rem; }
    #chatToggleBtn { bottom: 0.9rem; right: 0.9rem; width: 46px; height: 46px; font-size: 1.1rem; }
    .inline-chat-box { height: 320px; }
    .icg-inner { flex-wrap: wrap; gap: 0.5rem; }
    .icg-label { flex: unset; }
    .icg-btns { margin-left: 0; }
}