/* Existing styles */

body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Orbitron', sans-serif;
    background: #000;
    user-select: none;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f0f0f0;
    z-index: 1;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

.overlay-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
}

#instructions-button {
    padding: 10px;
    font-size: 14px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#conversation {
    flex-grow: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    overflow-y: auto;
    z-index: 1;
}

#starsCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.message {
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 15px;
    word-wrap: break-word;
    font-size: 1.2em;
    color: white;
    max-width: 90%;
    width: fit-content;
}

.user-message {
    background-color: #007bff;
    align-self: flex-end;
}

.ai-message {
    background-color: #6c757d;
    align-self: flex-start;
}

/* Updated styles for the record button and spinner */

#record-button {
    width: 50%;
    padding: 20px;
    font-size: 18px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    z-index: 1;
    transition: transform 0.1s ease-in-out;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#record-button:active {
    background-color: #0056b3;
    transform: scale(0.95);
}

@media (min-width: 768px) {
    #record-button {
        width: 33%;
    }
}

/* Spinner styles */
.button-loading {
    display: none; /* Hidden by default */
    width: 20px;
    height: 20px;
    border: 3px solid transparent;
    border-top: 3px solid #ffffff;
    border-right: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#status {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Styles for Instructions Overlay on Mobile Devices */

@media (max-width: 767px) {
    .overlay-content {
        width: 90%; /* Increase width for better visibility on mobile */
        max-width: none; /* Remove max-width restriction */
        padding: 15px; /* Adjust padding if necessary */
        border-radius: 8px; /* Slightly smaller border radius for better fit */
    }

    /* Optional: Adjust font sizes within the overlay for better readability */
    .overlay-content h2 {
        font-size: 1.5em; /* Adjust heading size */
    }

    .overlay-content p {
        font-size: 1em; /* Adjust paragraph text size */
        line-height: 1.5;
    }

    /* Optional: Make buttons within the overlay full-width for easier tapping */
    .overlay-content button {
        width: 100%;
        padding: 10px;
        font-size: 1em;
        margin-top: 20px;
        cursor: pointer;
    }
}

/* Optional: Ensure that the overlay content is properly scrollable on smaller screens */
.overlay-content {
    box-sizing: border-box; /* Ensure padding is included in width calculations */
}

/* Optional: Add transition for smooth opening and closing of the overlay */
.overlay {
    transition: opacity 0.3s ease;
}

.overlay.show {
    display: block;
    opacity: 1;
}

.overlay.hide {
    display: none;
    opacity: 0;
}
