/* Chat Main Section */
.chat-mainsec {
    padding: 20px;
}

/* Chat Sidebar */
.chat-main-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

/* Left Sidebar (Online Friends & Chats) */
.messages {
    width: 30%; /* Left sidebar for Chats and Online Friends */
    border-right: 1px solid #ddd;
    padding-right: 20px;
    padding-top: 20px;
    overflow-y: auto;
}

.msg {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
}

.f-img img {
    margin-right:13px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.f-name h5 {
    margin: 0;
}

.f-name p {
    margin: 0;
    font-size: 0.9rem;
}

.badge-danger {
    margin-left: 5px;
}

/* Active User Styling */
.active-user {
    background-color: #d1ffd6;
    border-left: 4px solid #5cb85c;
}

/* Chat Main Area */
.chat-main {
    width: 60%; /* Main chat area */
    padding-left: 20px;
    padding-top: 20px;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    padding: 10px;
}

.username-main {
    flex-grow: 1;
    padding-left: 15px;
}

.username-main h4 {
    margin: 0;
}

.username-main p {
    margin: 0;
    font-size: 0.9rem;
}

/* Chat Messages */
.chat-messages {
    max-height: 500px;
    overflow-y: scroll;
    padding: 20px;
}

.chat-message-left1 {
    background-color: #f1f1f1;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
    max-width: 70%;
}

.chat-message-right1 {
    background-color: #d1ffd6;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
    max-width: 70%;
    margin-left: auto;
}

/* Message Input Box */
.message-box {
    display: flex;
    padding-top: 10px;
}

.message-box input {
    flex-grow: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ddd;
}

.send-btn {
    background-color: #5cb85c;
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
}

.send-btn i {
    font-size: 20px;
}

/* Right Sidebar (Pending Requests & Add Friends) */
.friends-section {
    width: 30%; /* Right sidebar */
    padding-left: 20px;
    padding-top: 20px;
    overflow-y: auto;
}

.pending-requests, .add-friends {
    margin-bottom: 30px;
}

/* Styling for Pending Requests and Add Friends */
.pending-requests h6, .add-friends h6 {
    font-weight: bold;
    margin-bottom: 10px;
}

.list-group-item {
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.list-group-item .btn-sm {
    margin-left: 5px;
}

.list-group-item .btn-success {
    background-color: #5cb85c;
}

.list-group-item .btn-danger {
    background-color: #f44336;
}

.list-group-item .btn-primary {
    background-color: #007bff;
}

/* Search bar styling */
#friend-search {
    margin-bottom: 20px;
    width: 100%;
    padding: 8px;
    border: none;
    border-bottom: 1px solid #e5e5e9;
    outline: none;
    font-size: 14px;
}

#friend-search:focus {
    border-bottom: 1px solid #5cb85c;  /* Optional: Change border color on focus */
}

/* Online Friends */
.online-friends {
    margin-top: 20px;
}

.threedots {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threedots h5 {
    margin: 0;
}

.mem-profiles img {
    width: 35px;
    height: 35px;
    margin-right: 5px;
    border-radius: 50%;
}

/* Hover Effect on Messages */
.msg:hover {
    background-color: #e6f7ff;
    cursor: pointer;
    border-left: 4px solid #5cb85c;
}

.mem-profiles {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
}

.mem-profiles img {
    margin-right: 10px;
    cursor: pointer;
}

/* Adjustments for mobile responsiveness */
@media (max-width: 768px) {
    .chat-main-inner {
        flex-direction: column;
    }

    .messages, .chat-main, .friends-section {
        width: 100%;
        margin: 0;
        padding-right: 0;
        padding-left: 0;
    }

    .chat-main {
        padding-left: 10px;
    }

    .friends-section {
        padding-top: 10px;
    }
}
