body {
    background-color: rgb(12, 12, 12);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.msgBox {
    background: url('wall.jpg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border: 2px solid rgb(53, 53, 53);
    height: 70vh;
    margin: 20px 40px;
    border-radius: 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.message {
    width: fit-content;
    max-width: 70%;
    margin: 6px 15px;
    word-wrap: break-word;
}

.left .textbox {
    background-color: rgba(87, 86, 86, 0.911);
    color: white;
    padding: 8px 12px;
    border-radius: 18px 18px 18px 4px;
    font-size: 15px;
    line-height: 1.4;
}

.left {
    float: left;
    clear: both;
}

.right {
    float: right;
    clear: both;
}

.right .textbox {
    background-color: rgba(0, 123, 255, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 18px 18px 4px 18px;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
}

.right .username {
    float: right;
}

.message .username {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    margin-top: 2px;
}

.center {
    background-color: rgba(87, 86, 86, 0.75);
    color: rgba(255, 255, 255, 0.9);
    padding: 5px 15px;
    border-radius: 15px;
    float: none;
    clear: both;
    margin: auto;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.sendMsg {
    margin: 20px 40px;
    display: flex;
    flex-direction: row;
    position: sticky;
    bottom: 0;
    background-color: rgb(12, 12, 12);
    padding: 10px 0;
    z-index: 100;
}

input[type='text'] {
    background-color: rgb(29, 29, 29);
    border: none;
    flex: 1;
    padding: 12px 15px;
    color: white;
    border: 2px solid rgb(53, 53, 53);
    border-radius: 10px;
    margin-right: 10px;
    font-size: 16px;
}

.button {
    padding: 12px 20px;
    border: none;
    border: 2px solid rgb(53, 53, 53);
    border-radius: 10px;
    background-color: black;
    color: white;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
}





#popupBox {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    height: 100vh;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.726);
}

.my-modal {
    width: 90%;
    max-width: 360px;
    border: 2px solid rgb(53, 53, 53);
    border-radius: 20px;
    min-height: 230px;
    color: white;
    padding: 20px;
    box-shadow: 10px 10px 60px rgba(85, 85, 85, 0.315), inset 10px 10px 20px rgba(80, 80, 80, 0.205);
    position: relative;
}

.my-modal #userName {
    margin: 10px 0px;
    width: 100%;
    font-size: 16px;
    padding: 10px;
}

.my-modal #submitName {
    margin: 0px 0px 10px 0px;
    width: 100%;
}

.modal-branding {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.button:hover {
    background-color: rgb(61, 61, 61);
    color: white;
}

@media screen and (max-width: 768px) {
    .msgBox {
        margin: 15px 10px;
        height: calc(100vh - 260px);
        border-radius: 10px;
    }

    .sendMsg {
        margin: 10px 10px;
        padding: 10px 0;
    }

    .message {
        max-width: 80%;
        margin: 5px 10px;
    }

    .left .textbox,
    .right .textbox {
        padding: 7px 11px;
        font-size: 14px;
        line-height: 1.3;
    }

    .message .username {
        font-size: 10px;
        margin-top: 1px;
    }

    .center {
        padding: 4px 12px;
        font-size: 12px;
        margin-top: 6px;
        margin-bottom: 6px;
    }

    .member-class {
        margin: 0px 10px;
        font-size: 13px;
        padding: 7px;
    }

    #nameTag {
        margin-left: 10px;
        font-size: 13px;
    }

    .container h2 {
        font-size: 1.4rem;
        margin: 12px 0px 8px 0px !important;
    }

    input[type='text'] {
        padding: 10px 12px;
        font-size: 16px;
    }

    .button {
        padding: 10px 15px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .msgBox {
        margin: 10px 5px;
        height: calc(100vh - 270px);
    }

    .sendMsg {
        margin: 10px 5px;
    }

    .message {
        max-width: 85%;
        margin: 4px 8px;
    }

    .left .textbox,
    .right .textbox {
        padding: 6px 10px;
        font-size: 13px;
    }

    .message .username {
        font-size: 9px;
    }

    .center {
        padding: 3px 10px;
        font-size: 11px;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .member-class {
        margin: 0px 5px;
        font-size: 12px;
        overflow-x: auto;
        white-space: nowrap;
        padding: 6px;
    }

    #nameTag {
        margin-left: 5px;
        font-size: 12px;
    }

    .container h2 {
        font-size: 1.1rem;
        padding: 0 5px;
        margin: 10px 0px 8px 0px !important;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .my-modal {
        width: 95%;
        padding: 15px;
    }
}

/* <span id="your-status">•</span> */
#nameTag {
    color: white;
    text-align: center;
    margin-left: 40px;
}

#nameTag::before {
    content: "• ";
    font-size: 1.2em;
    padding-top: 5px;
    animation: k1 1s infinite;
    transition: all;
}

@keyframes k1 {
    0% {
        color: rgb(146, 255, 96);
    }

    50% {
        color: rgb(0, 180, 0);
    }

    100% {
        color: rgb(146, 255, 96);
    }
}

.member-class {
    border: 2px solid rgb(53, 53, 53);
    margin: 0px 40px;
    color: white;
    padding: 10px;
    border-radius: 10px;
    overflow-x: auto;
    white-space: nowrap;
}

/* Smooth scrolling for message box */
.msgBox::-webkit-scrollbar {
    width: 8px;
}

.msgBox::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.msgBox::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.msgBox::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Image sharing styles */
.attach-btn {
    padding: 12px;
    border: 2px solid rgb(53, 53, 53);
    border-radius: 10px;
    background-color: black;
    color: white;
    cursor: pointer;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.attach-btn:hover {
    background-color: rgb(61, 61, 61);
}

.image-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.chat-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    object-fit: cover;
}

.chat-image:hover {
    transform: scale(1.05);
}

.image-filename {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    word-break: break-all;
}

/* Image modal styles */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.image-modal-close:hover {
    color: #ccc;
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
}

.modal-filename {
    color: white;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    word-break: break-all;
}

/* Mobile responsive for image features */
@media screen and (max-width: 768px) {
    .attach-btn {
        padding: 10px;
        min-width: 40px;
    }

    .chat-image {
        max-width: 150px;
        max-height: 150px;
    }

    .image-modal-content {
        max-width: 95%;
        max-height: 95%;
    }

    .modal-image {
        max-height: 70vh;
    }
}

@media screen and (max-width: 480px) {
    .attach-btn {
        padding: 8px;
        min-width: 36px;
        margin-right: 8px;
    }

    .chat-image {
        max-width: 120px;
        max-height: 120px;
    }

    .image-filename {
        font-size: 10px;
    }

    .modal-filename {
        font-size: 12px;
    }
}