* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Hind Siliguri', sans-serif;
}
body {
    background-color: #f4f6f5;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.chat-container {
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.05);
    display: flex;
    overflow: hidden;
}

/* Sidebar Styles */
.chat-sidebar {
    width: 350px;
    background: #ffffff;
    border-right: 1px solid #eef2f0;
    display: flex;
    flex-direction: column;
}
.sidebar-header {
    padding: 20px;
    background: #1b4332;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}
.back-btn {
    color: white;
    font-size: 20px;
    text-decoration: none;
}
.sidebar-header h2 {
    font-size: 22px;
    font-weight: 600;
}
.search-box {
    padding: 15px;
    border-bottom: 1px solid #eef2f0;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 10px 10px 10px 35px;
    border: 1px solid #d1d9d5;
    border-radius: 8px;
    outline: none;
    background: #f9fbfaf3;
}
.search-box i {
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}
.contact-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}
.contact-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f4f6f5;
    cursor: pointer;
    transition: 0.2s;
}
.contact-item:hover, .contact-item.active {
    background: #e8f0eb;
}
.contact-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #c5a880;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    margin-right: 15px;
}
.contact-info {
    flex: 1;
}
.contact-info h4 {
    font-size: 16px;
    color: #112d22;
    margin-bottom: 3px;
}
.contact-info p {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Chat Window Styles */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f0f4f2;
}
.chat-header {
    padding: 15px 25px;
    background: #ffffff;
    border-bottom: 1px solid #eef2f0;
    display: flex;
    align-items: center;
    gap: 15px;
}
.mobile-back-btn {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: #1b4332;
    cursor: pointer;
}
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1b4332;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}
.chat-user-info h3 {
    font-size: 18px;
    color: #112d22;
}
.status.online {
    font-size: 12px;
    color: #2e7d32;
    font-weight: 600;
}
.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Message Bubbles */
.message {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
}
.message .time {
    display: block;
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.7;
    text-align: right;
}
.message.received {
    background: #ffffff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.message.sent {
    background: #1b4332;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* System Alert Card */
.message.system-alert {
    background: #fff8e1;
    border: 1px solid #ffecb3;
    color: #3e2723;
    align-self: center;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
}
.system-alert i {
    font-size: 24px;
    color: #f57f17;
    margin-bottom: 8px;
}
.system-alert.wallet { background: #e8f5e9; border-color: #c8e6c9; }
.system-alert.wallet i { color: #2e7d32; }

/* Input Area */
.chat-input-area {
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #eef2f0;
    display: flex;
    gap: 15px;
}
.chat-input-area input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #d1d9d5;
    border-radius: 30px;
    outline: none;
    font-size: 15px;
}
.chat-input-area input:focus {
    border-color: #1b4332;
}
.send-btn {
    width: 48px;
    height: 48px;
    background: #c5a880;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: 0.3s;
}
.send-btn:hover {
    background: #b0936b;
}

/* Responsive for Mobile */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
    }
    .chat-sidebar {
        width: 100%;
    }
    .chat-window {
        display: none;
        width: 100%;
    }
    .mobile-back-btn {
        display: block;
    }
    /* Mobile Toggle Classes */
    .show-chat .chat-sidebar { display: none; }
    .show-chat .chat-window { display: flex; }
}