.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--dark-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chat-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.chat-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--dark);
    border-radius: 12px 12px 0 0;
    position: relative;
}

.chat-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.chat-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.chat-tab.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.friend-item {
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeInUp 0.4s ease-out;
}

.friend-item:hover {
    background: rgba(100, 108, 255, 0.1);
}

.friend-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
}

.friend-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--light);
}

.friend-status {
    font-size: 0.8rem;
    color: var(--gray);
}

.status-online {
    color: var(--success);
}

.status-offline {
    color: var(--gray);
}

.chat-window {
    flex: 1;
    display: none;
    flex-direction: column;
}

.chat-window.active {
    display: flex;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    position: relative;
    animation: messageSlideIn 0.3s ease-out;
}

.message-sent {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.message-received {
    align-self: flex-start;
    background: var(--dark);
    color: var(--light);
    border-bottom-left-radius: 4px;
}

.message-time {
    color: var(--light);
    opacity: 0.7;
    font-size: 0.7rem;
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    background: var(--dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--light);
    font-family: inherit;
    resize: none;
    max-height: 100px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-send-btn {
    padding: 0.75rem 1rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

.no-friends {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--gray);
}

.chat-back-btn,
.chat-close-btn {
    background: none;
    border: none;
    color: var(--light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
    z-index: 1;
}

.chat-back-btn {
    margin-right: auto;
}


.chat-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-close-btn {
    margin-left: auto;
}

.chat-back-btn:hover,
.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}

/* Friend Status */
.friend-status {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.status-online {
    color: #4ade80;
    position: relative;
    padding-left: 0.8rem;
}

.status-online::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #4ade80;
    box-shadow: 0 0 4px #4ade80;
    animation: pulse 1.5s infinite;
}

.status-offline {
    color: #6b7280;
    position: relative;
    padding-left: 0.8rem;
}

.status-offline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #6b7280;
}

.status-away {
    color: #fbbf24;
    position: relative;
    padding-left: 0.8rem;
}

.status-away::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: #fbbf24;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}