/* Basic layout for WhatsApp Web clone */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    /* Prevent overflow */
}

/* Sidebar styling */
.sidebar {
    width: 300px;
    background-color: #ffffff;
    border-right: 1px solid #ddd;
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.upload-options {
    width: 50%;
    bottom: 19%;
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 32px;
}

.upload-options button {
    display: block;
    margin-bottom: 10px;
    width: 50%;
    border: 0;
    padding: 9px;
    cursor: pointer;
}

button {
    display: block;
    margin-bottom: 10px;
    width: 100px;
    cursor: pointer;
}

.contacts-list h3 {
    margin: 10px 0;
    font-size: 16px;
    color: #333;
}

.wa-id {
    font-size: 0.8em;
    /* Adjust as needed */
    color: gray;
    /* Adjust color */
}

.contacts-list {
    max-height: 500px;
    overflow: auto;
}

.chat-list {
    overflow-y: auto;
    flex: 1;
}

.chat-item {
    display: flex;
    padding: 10px;
    cursor: pointer;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.chat-item:hover {
    background-color: #f0f0f0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.chat-info {
    display: flex;
    flex-direction: column;
}

.chat-name {
    font-weight: bold;
    color: #333;
}

.chat-last-message {
    color: #777;
    font-size: 12px;
}

/* Chat window styling */
.chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #e5ddd5;
}

.message-bubble {
    max-height: 300px;
    overflow: auto;
    max-width: 60%;
    margin: 10px 0;
    padding: 10px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* My messages (right-aligned) */
.my-message {
    background-color: #dcf8c6;
    margin: auto;
    margin-top: 11px;
    margin-right: 4px;
    max-width: 507px;
}

/* Their messages (left-aligned) */
.their-message {
    background-color: #fff;
    align-self: flex-start;
}

/* Timestamp styling */
.time_span {
    display: block;
    font-size: 10px;
    color: #999;
    margin-top: 5px;
    float: right;
}

/* Align the timestamp to the right for my messages */
.my-message .time_span {
    text-align: right;
}

/* Input box styling */
.message-input {
    display: flex;
    border-top: 1px solid #ddd;
    padding: 10px;
    background-color: #f8f9fa;
    height: 93px;
}

#messageInput {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 20px;
    outline: none;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.send-button {
    padding: 10px 20px;
    border: none;
    background-color: #25d366;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
}

.upload-extra {
    margin: auto;
    margin-right: 10px;
    cursor: pointer;
}

.install-app {
    cursor: pointer;
}

.recorder-popup {
    position: absolute;
    bottom: 30%;
    right: 0%;
    transform: translateX(-50%);
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.recorder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer {
    font-size: 24px;
    margin-bottom: 10px;
}

.microphone {
    margin: auto;
    margin-left: 13px;
    margin-right: 10px;
    background: #cdc9c9;
    padding: 13px;
    border-radius: 50%;
    cursor: pointer;

}

.send-button:hover {
    background-color: #128c7e;
}

/* Notification icon that blinks */
.notification-icon {
    position: absolute;
    top: 10px;
    right: 26px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: red;
    display: none;
    /* Hidden by default */
    cursor: pointer;
}

.unread {
    display: inline-block;
    position: relative;
    height: 7px;
    width: 7px;
    top: 0px;
    border-radius: 50%;
    background-color: red;
}

.blinking {
    animation: blinking 1s infinite;
}

@keyframes blinking {
    0% {
        background-color: red;
    }

    50% {
        background-color: transparent;
    }

    100% {
        background-color: red;
    }
}

.chat-item.active {
    background-color: #e0f7fa;
    /* Change background for active contact */
}

.chat-item.new-message {
    border: 2px solid red;
    /* Red border for new message indicator */
}

.notification-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: red;
    /* Red dot for new messages */
    border-radius: 50%;
    margin-left: 5px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }

    .chat-window {
        height: calc(100vh - 60px);
        /* Adjust for header */
    }

    .chat-messages {
        padding: 10px;
    }

    .message-input {
        padding: 5px;
    }

    #messageInput {
        padding: 5px;
    }

    .send-button {
        padding: 5px 10px;
    }
}