body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f7;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: url('https://m1s5.c20.e2-5.dev/files/jeeitunes/img/wallpaper.jpg');
    background-size: cover;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

.imessage-window {
    width: 100%;
    max-width: 800px;
    height: 95vh;
    max-height: 900px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 10px 10px 25px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid white;
    border-block: 0.15rem solid #CCCCCC;
    writing-mode: horizontal-tb;

}

.imessage-header {
    padding: 10px 15px;
    border-bottom: 1px solid #e5e5e5;
    background-color: #f7f7f7;
    text-align: center;
    font-weight: bold;
    background-image: url('https://m1s5.c20.e2-5.dev/files/jeeitunes/img/buttons.svg');
    background-size: 8%;
    background-position: top-left;
    background-repeat: no-repeat;
    background-origin: content-box;
}

.participants-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatars {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
}

.imessage-header .avatar {
    width: 40px;
    height: 40px;
    margin: 0 3px;
    background-size: contain;
    border-radius: 100%;
}

.message-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.message-bubble {
    display: flex;
    align-items: flex-end;
    margin-bottom: 10px;
    max-width: 75%;
}

.message-bubble .avatar {
    width: 30px;
    height: 30px;
    min-width: 30px; /* Ensure it doesn't shrink */
    border-radius: 50%;
    margin-right: 10px;
    cursor: pointer;
    background-color: #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: white;
    background-size: cover;
    background-position: center;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-bubble.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-bubble.sent .avatar {
    margin-left: 10px;
    margin-right: 0;
}

.message-bubble.sent .message-content {
    background-color: #0078fe;
    color: white;
}

.message-bubble.sent .message-content a {
    color: white;
}

.message-bubble.received {
    align-self: flex-start;
}

.message-bubble.received .message-content {
    background-color: #e5e5ea;
    color: black;
}

.message-bubble.received .message-content a {
    color: #DD7164;
}

.imessage-footer {
    padding: 10px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navigation button, #export-btn {
    padding: 8px 15px;
    border: none;
    background-color: #0078fe;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.navigation button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#modal-name-input, #modal-avatar-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 0;
        height: 100vh;
    }
    .imessage-window {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    .message-bubble {
        max-width: 90%;
    }
}
