/* Chat Section */
.chat-section {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px dashed rgba(99, 102, 241, 0.1);
}

.chat-header-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.profile-img-container {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-img-container:hover {
    transform: scale(1.05);
}

.profile-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-img-container:hover .img-overlay {
    opacity: 1;
}

.text-btn.mini {
    font-size: 0.85rem;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 20px;
}

.online-users-container {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.online-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.online-users-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-badge {
    background: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.mini-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #22c55e;
}

.chat-messages {
    background: white;
    border-radius: 20px;
    padding: 24px;
    height: 350px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
}

.me .message-wrapper {
    align-items: flex-end;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.me .message-header {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-sender {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
}

.chat-content {
    padding: 10px 16px;
    border-radius: 14px;
    max-width: 80%;
    font-size: 0.95rem;
    line-height: 1.4;
}

.me .chat-content {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 2px;
}

.others .chat-content {
    background: #f1f5f9;
    color: var(--text-main);
    border-bottom-left-radius: 2px;
}

.chat-image {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 12px;
    margin-top: 8px;
    display: block;
    cursor: zoom-in;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 3px solid white;
    transition: transform 0.3s;
    object-fit: contain;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.icon-btn-large {
    background: #f0f4ff;
    border: 1.5px solid #c7d2fe;
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.primary-btn.icon-only {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    border-radius: 12px;
}

@media (max-width: 640px) {
    .icon-btn-large, .primary-btn.icon-only {
        width: 48px !important;
        height: 48px !important;
    }
}
