﻿/* ================================
   GLOBAL CHAT PAGE STYLES
   ================================ */

.chat-page {
    min-height: 100vh;
    background: transparent;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.chat-container {
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ================================
   GLASS PANEL EFFECT
   ================================ */

.glass-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ================================
   CHAT HEADER
   ================================ */

.chat-header {
    padding: 1.5rem;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

    .header-left > i {
        font-size: 2rem;
        color: #2563eb;
    }

.chat-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
}

.chat-header p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: #64748b;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 8px;
    padding: 0.625rem;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .btn-icon:hover:not(:disabled) {
        background: rgba(37, 99, 235, 0.15);
        transform: translateY(-2px);
    }

    .btn-icon:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ================================
   CHAT MESSAGES
   ================================ */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
    min-height: 400px;
}

    .chat-messages::-webkit-scrollbar {
        width: 8px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.05);
        border-radius: 4px;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
    }

        .chat-messages::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 0, 0, 0.3);
        }

/* ================================
   LOADING & EMPTY STATES
   ================================ */

.chat-loading,
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    gap: 1rem;
}

    .chat-loading i,
    .chat-empty i {
        font-size: 3rem;
        color: #2563eb;
    }

    .chat-empty h3 {
        margin: 0;
        color: #1e293b;
        font-size: 1.25rem;
    }

    .chat-empty p {
        margin: 0;
        font-size: 0.875rem;
        color: #64748b;
    }

/* ================================
   CHAT MESSAGE
   ================================ */

.chat-message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.own-message {
    flex-direction: row-reverse;
}

    .chat-message.own-message .message-content {
        align-items: flex-end;
    }

    .chat-message.own-message .message-text {
        background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
        color: #fff;
        border-radius: 16px 4px 16px 16px;
    }

/* ================================
   MESSAGE AVATAR
   ================================ */

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

    .message-avatar[data-tier="none"] {
        background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    }

    .message-avatar[data-tier="basic"] {
        background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
        border-color: #3b82f6;
    }

    .message-avatar[data-tier="intermediate"] {
        background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
        border-color: #8b5cf6;
    }

    .message-avatar[data-tier="vip"] {
        background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
        border-color: #f59e0b;
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
    }

/* ================================
   MESSAGE CONTENT
   ================================ */

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 70%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.message-author {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.message-tier {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

    .message-tier.tier-none {
        background: rgba(107, 114, 128, 0.15);
        color: #6b7280;
        border: 1px solid rgba(107, 114, 128, 0.2);
    }

    .message-tier.tier-basic {
        background: rgba(59, 130, 246, 0.15);
        color: #2563eb;
        border: 1px solid rgba(59, 130, 246, 0.3);
    }

    .message-tier.tier-intermediate {
        background: rgba(139, 92, 246, 0.15);
        color: #7c3aed;
        border: 1px solid rgba(139, 92, 246, 0.3);
    }

    .message-tier.tier-vip {
        background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(239, 68, 68, 0.15));
        color: #d97706;
        border: 1px solid rgba(234, 179, 8, 0.3);
    }

.message-admin-badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #fff;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.message-time {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: auto;
}

.message-text {
    background: #f1f5f9;
    padding: 0.75rem 1rem;
    border-radius: 4px 16px 16px 16px;
    color: #1e293b;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    border: 1px solid #e2e8f0;
}

.message-edited {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    margin-left: 0.5rem;
}

/* ================================
   DELETE MESSAGE BUTTON
   ================================ */

.btn-delete-message {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 0.5rem;
    color: #dc2626;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
}

.chat-message:hover .btn-delete-message {
    opacity: 1;
}

.btn-delete-message:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: scale(1.1);
}

/* ================================
   CHAT INPUT
   ================================ */

.chat-input-container {
    padding: 1.5rem;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-input {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #d1d5db;
    border-radius: 12px;
    padding: 1rem;
    color: #1e293b;
    font-size: 1rem;
    resize: none;
    min-height: 60px;
    max-height: 150px;
    font-family: inherit;
    transition: all 0.3s ease;
}

    .chat-input:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        background: #fff;
    }

    .chat-input::placeholder {
        color: #94a3b8;
    }

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.character-count {
    font-size: 0.75rem;
    color: #64748b;
}

.btn-send {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

    .btn-send:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
    }

    .btn-send:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* ================================
   LOGIN PROMPT
   ================================ */

.chat-login-prompt {
    padding: 1.5rem;
    text-align: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

    .chat-login-prompt i {
        font-size: 2rem;
        color: #2563eb;
    }

    .chat-login-prompt a {
        color: #2563eb;
        text-decoration: none;
        font-weight: 600;
    }

        .chat-login-prompt a:hover {
            text-decoration: underline;
        }

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 768px) {
    .chat-page {
        padding: 0;
    }

    .chat-container {
        height: calc(100vh - 150px);
        max-width: 100%;
        gap: 0.75rem;
    }

    .chat-header,
    .chat-messages,
    .chat-input-container,
    .chat-login-prompt {
        border-radius: 12px;
    }

    .message-content {
        max-width: 85%;
    }

    .message-header {
        font-size: 0.8rem;
    }

    .btn-delete-message {
        opacity: 1;
    }

    .chat-header {
        padding: 1rem;
    }

    .chat-messages {
        padding: 1rem;
    }

    .chat-input-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .chat-header h1 {
        font-size: 1.25rem;
    }

    .header-left > i {
        font-size: 1.5rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .message-content {
        max-width: 80%;
    }

    .chat-container {
        height: calc(100vh - 100px);
    }
}
