/* ============================================
   CINEVERSE REAL-TIME CHAT
   ============================================ */

/* CHAT FLOATING BUTTON */
.chat-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff3cac, #784ba0, #2b86c5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 10px 30px rgba(255, 60, 172, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
}

.chat-float-btn:hover {
    transform: scale(1.1) rotate(5deg);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0055;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #000;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(255, 0, 85, 0.5); }
    100% { transform: scale(1); }
}

/* CHAT PANEL */
.chat-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.98), rgba(10, 10, 20, 0.99));
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 9997;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.chat-panel.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

/* CHAT HEADER */
.chat-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
}

.chat-back-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
}

/* CONVERSATION LIST */
.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.chat-item-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.chat-item-time {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
}

.chat-item-preview {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item.unread .chat-item-preview {
    color: #fff;
    font-weight: 600;
}

.chat-item.unread::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    margin-left: 10px;
}

/* ACTIVE CHAT VIEW */
.chat-view {
    flex: 1;
    display: none;
    flex-direction: column;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.message-sent {
    align-self: flex-end;
    background: linear-gradient(135deg, #ff3cac, #784ba0);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-received {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    color: #eee;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 5px;
    display: block;
    text-align: right;
}

/* CHAT INPUT */
.chat-input-area {
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 18px;
    color: #fff;
    font-size: 0.9rem;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 480px) {
    .chat-panel {
        width: calc(100% - 40px);
        height: 80vh;
        right: 20px;
        bottom: 90px;
    }
}
