* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f2f5;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    background: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.sidebar {
    width: 30%;
    border-right: 1px solid #e9edef;
    display: flex;
    flex-direction: column;
}

.user-info {
    padding: 20px;
    border-bottom: 1px solid #e9edef;
}

.user-info h2 {
    margin-bottom: 15px;
    color: #111b21;
}

.current-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-user input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e9edef;
    border-radius: 5px;
    outline: none;
}

.online-users {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.online-users h3 {
    margin-bottom: 15px;
    color: #111b21;
}

#user-list {
    list-style: none;
}

#user-list li {
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 5px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#user-list li:hover {
    background-color: #f5f6f6;
}

#user-list li.active {
    background-color: #e9edef;
    font-weight: 500;
}

.badge {
    background-color: #25d366;
    color: #fff;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e9edef;
}

.chat-header h2 {
    color: #111b21;
    font-size: 1.2rem;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29-22c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zM32 63c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-7c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23e6e6e6' fill-opacity='0.3' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 7.5px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.sent {
    background-color: #d9fdd3;
    margin-left: auto;
    border-top-right-radius: 0;
}

.message.received {
    background-color: white;
    margin-right: auto;
    border-top-left-radius: 0;
}

.message .time {
    font-size: 0.7rem;
    color: #667781;
    margin-top: 3px;
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    background-color: #e9edef;
    color: #54656f;
    padding: 8px 12px;
    border-radius: 7.5px;
    display: inline-block;
    margin: 5px 0;
    font-size: 0.9em;
    max-width: 70%;
    position: relative;
    clear: both;
    float: left;
    margin-left: 15px;
    margin-bottom: 5px;
}

.message-input {
    display: flex;
    padding: 15px;
    background-color: #f0f2f5;
    border-top: 1px solid #e9edef;
    position: relative;
}

.message-input .typing-indicator {
    position: absolute;
    top: -25px;
    left: 15px;
    background-color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #667781;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.typing-indicator.visible {
    opacity: 1;
}

.message-input input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 20px;
    outline: none;
    font-size: 0.95rem;
    background-color: white;
}

.message-input button {
    margin-left: 10px;
    padding: 0 20px;
    border: none;
    border-radius: 20px;
    background-color: #00a884;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message-input button:hover {
    background-color: #017561;
}

.message-input button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
