body {
    background-color: black;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-y: auto;
}
.container {
    width: 50%;
    background: #015eba;
    color: white;
    padding: 20px;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
}
.left-side, .right-side {
    width: 25%;
    height: 100vh;
    background-color: black;
    position: fixed;
    top: 0;
}
.left-side {
    left: 0;
}
.right-side {
    right: 0;
}
.container h1 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: bold;
}
.container h3 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 20px;
    opacity: 0.8;
}
.messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    margin-top: 20px;
    flex-grow: 1;
    gap: 1rem;
    min-height: 0; 
}
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 80%;
    border-radius: 16px;
    padding: 10px;
    background-color: #1e5fd1;
    color: white;
    transition: all 0.3s ease, max-height 0.3s ease;
    max-height: 500px; 
    overflow: visible;  
}
.my-message {
    align-self: flex-end;
    background-color: #3b82f6;
    width: 455px;
}
.other-message {
    background-color: #2563eb;
    width: 455px;
}
.guest-message {
    align-self: flex-start;
    background-color: #2563eb;
    max-width: 85%;
    padding: 12px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 16px;
}
.column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.profile-section {
    width: 20%;
    height: 120px;
    display: flex;
    align-items: center; 
    justify-content: center; 
}
.content-section {
    width: 50%;
    display: flex;
    flex-direction: column;
}
.image-section {
    width: 30%;
    display: flex;
    justify-content: center;
    align-items: center; 
}
.profile-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    right: 20%;
}
.profile-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.text-image-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
}
.text {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 80%;
    color: white;
    text-align: left;
    margin-top: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.message-image1 {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    margin-top: auto;
}
.image-container {
    display: flex;
    justify-content: center; 
    align-items: center; 
    width: 100%;
    height: 130px;
}
.message-image {
    width: 100px;
    height: auto;
    border-radius: 5px;
    object-fit: cover;
    display: block;
}
.message.deleted {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}
.top-left, .top-right {
    position: absolute;
    top: 10px;
    cursor: pointer;
}
.top-left {
    left: 10px;
}
.top-left img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    padding: 5px;
}
.top-right {
    right: 12.5px;
    width: 70px;
    height: 70px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
}
.latest-messages {
    text-align: center;
    margin-bottom: 30px;
}
.latest-messages-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    flex-wrap: nowrap;
}
.latest-message {
    background: #416df3;
    padding: 10px;
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 300px;
}
.latest-message .message-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
}
.latest-message .sender {
    font-size: 15px;
    font-weight: bold;
    color: white;
    margin-top: 0px;
}

.latest-message .time {
    font-size: 15px;
    color: white;
    font-size: bold;
}
.latest-message .text {
    font-size: 14px;
    color: white;
    margin-top: 5px;
}
.white-circle {
    width: 75px;
    height: 150px;
    background-color: #ffffff;
    position: absolute; 
    z-index: 1;
    pointer-events: none;
}
.white-circle.left {
    left: 0px; 
    border-top-right-radius: 75px;
    border-bottom-right-radius: 75px;
}
.white-circle.right {
    right: 0px;
    border-top-left-radius: 75px;
    border-bottom-left-radius: 75px;
}

.latest-message .message-image1{
    width: 151.68px;
    height: 80.54px;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    margin: 5px auto 0; 
}
.user-photo {
    width: 150px;
    height: 150px;
    gap: 8px;
    margin-top: 25%;
}
.countdown-container {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
    font-size: 16px;
    font-weight: bold;
    color: white;
}
.message-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 0 -10px; 
    align-self: flex-start;
    margin-right: 150px;
}

.edit-btn, .delete-btn {
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-weight: lighter;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px; 
}
.edit-btn:hover, .delete-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.edit-btn::after, .delete-btn::after {
    content: "";
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    transition: filter 0.2s ease;
}
.edit-btn::after, .delete-btn::after {
    width: 18px; 
    height: 18px; 
}
.edit-btn::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%239ca3af"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75 1.84-1.83zM3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>');
}
.edit-btn:hover::after {
    filter: brightness(1.5);
}
.delete-btn::after {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ef4444"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/></svg>');
}
.delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}
.edit-btn:active, .delete-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

@media (max-width: 768px) {
    .container {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100vh;
        border: 1px solid #ccc;
        padding: 10px;
        box-sizing: border-box;
        overflow-y: auto;
    }

    .left-side, .right-side {
        display: none;
    }

    .messages {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 10px;
        width: 100%;
    }

    .message {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        border-radius: 12px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }

    .my-message {
        align-self: flex-end;
        background-color: #3b82f6;
        color: white;
        flex-direction: row-reverse;
        text-align: right;
        width: 85%;
        margin-right: 15px;
    }

    .other-message {
        align-self: flex-start;
        background-color: #2563eb;
        color: white;
        flex-direction: row;
        text-align: left;
        width: 85%;
    }

    .profile-section {
        flex-shrink: 0;
    }

    .profile-icon {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        margin-bottom: -20%;
    }

    .content-section {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 100%;
    }

    .text-image-wrapper {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .text {
        font-size: 14px;
        padding: 6px 10px;
        background-color: rgba(255, 255, 255, 0.15);
        border-radius: 8px;
        max-width: 100%;
        word-wrap: break-word;
    }

    .message-image1 {
        height: auto;
        border-radius: 6px;
        object-fit: contain;
    }
    .message-image {
        width: 75px;
        height: auto;
        border-radius: 6px;
        object-fit: contain;
    }
    .top-left img {
        width: 40px;
        height: 40px;
    }
    .top-right {
        width: 50px;
        height: 50px;
        right: 10px;
        font-size: 12px;
    }

    .latest-messages-container {
        flex-direction: column;
        align-items: center;
    }

    .latest-message {
        width: 90%;
    }

    .white-circle {
        display: none;
    }

    .user-photo {
        width: 100px;
        height: 100px;
        margin-top: 20%;
    }

    .countdown-container {
        top: 10px;
        right: 10px;
        font-size: 14px;
    }

    .message-actions {
        margin-right: 0;
        flex-direction: row;
        align-self: flex-end;
    }

    .edit-btn, .delete-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}
