/* Base styles */
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #151515;
    overflow: hidden; /* Hide scrollbars if the content is bigger than the screen */
}

/* Fullscreen webcam container */
#webcam-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* Lower z-index for webcam feed */
}

/* Webcam and canvas styling for full window */
#webcam, #canvas, #drop_area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2; /* Ensure webcam feed is below buttons and chat */
}

/* Button container for top-right positioning */
#button-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000; /* High z-index to ensure buttons are clickable and visible */
}

/* Button styling */
#capture, #switch-camera, #start-camera, #uploadButton {
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent for visibility */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Message container at the bottom of the window */
#message-container {
    display: none; /* This will hide the element */
    position: absolute;
    width: 80vw;
    height: 20vw;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* High z-index to ensure message box is above other content */
}


/* Image container within the message container, make it smaller */
#captureImg {
    flex: 0 0 200px; /* Adjust the size as needed, here it's set to 50px width */
    padding-right: 10px; /* Add some space between the image and the message input */
    display: flex; /* Use flex to enable alignment */
    align-items: center; /* Center the image vertically */
}

/* Adjust the image size if needed */
#captureImg img {
    max-width: 100%; /* Make sure the image is not larger than the container */
    max-height: 100%; /* Make sure the image is not taller than the container */
}

/* Message input and send button container */
#message {
    flex: 1; /* Grow to fill the remaining space */
    display: flex; /* Use flexbox for internal layout */
    flex-direction: column; /* Stack the children vertically */
    align-items: stretch; /* Stretch the children to fill the width */
}

/* Message text area styling */
#message textarea {
    flex: 1; /* Allow the textarea to grow and fill the space vertically */
    margin-bottom: 5px; /* Add some space between the textarea and the button */
    padding: 10px; /* Add some padding inside the textarea for aesthetics */
    border: 1px solid #ccc; /* A light border around the textarea */
    border-radius: 4px; /* Slightly rounded corners for the textarea */
    resize: vertical; /* Allow the user to resize the textarea vertically */
}

/* Send button styling */
#message button {
    padding: 10px 15px; /* Padding inside the button */
    border: none; /* Remove the default border */
    background-color: rgb(40, 41, 41); /* A nice blue background color */
    color: rgb(243, 236, 236); /* White text color */
    border-radius: 4px; /* Slightly rounded corners for the button */
    cursor: pointer; /* Change the cursor to indicate the button is clickable */
}

/* Add a hover effect for the button */
#message button:hover {
    background-color: #747a78; /* A darker blue on hover */
}

/* Chatbox overlaying the webcam feed */
#chatbox {
    display: none;
    position: absolute;
    bottom: 90px; /* Positioned above the message container */
    left: 0;
    width: 90%;
    max-height: 650px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    margin: 15px;
    padding: 10px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

#userInputText {
    margin: 15px 0;
    width: 70%;
    border: 2px solid #ccc;
    background-color: transparent;
    color: white;
    font-size: 16px;
    resize: none;
}

#userInputButton {
    margin: 15px;
    position: absolute;
    padding: 20px 35px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Media query for smaller screens */
@media (max-width: 768px) {
    /* Adjust the message container for smaller screens */
    #message-container {
        flex-wrap: wrap; /* Allow items to wrap to the next line */
        padding: 5px;
        width: 80vw;
        height: auto;
    }

    /* Adjust the image container for smaller screens */
    #captureImg {
        flex-basis: 100%; /* Let the image take full width */
        justify-content: center; /* Center the image horizontally */
        padding: 5px 0; /* Add padding above and below the image */
    }

    /* Adjust the message section for smaller screens */
    #message {
        width: 100%; /* Let the message area take full width */
        padding: 5px 0; /* Add padding above and below the message area */
    }

    /* Adjust the message textarea for smaller screens */
    #message textarea {
        margin-bottom: 5px; /* Ensure space between textarea and button */
    }

    /* Ensure the button is full width for smaller screens */
    #message button {
        width: 100%;
    }
}

