body {
    font-family: 'Lexend Deca', sans-serif;
    background-color: #e6f3ff;
    margin: 0;
    padding-top: 10px;
}

.container {
    width: 95%;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 100px;  /* Space for floating container */
}

h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2rem;
    text-align: center;
}

#questionForm {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
}

textarea[name="question"], 
#follow-up-textarea,
#response-container, 
.conversation-item {
    width: 100%;
    border: 2px solid #3498db;
    border-radius: 5px;
    box-sizing: border-box;
}

textarea[name="question"],
#follow-up-textarea {
    padding: 15px;
    margin-bottom: 15px;
    font-size: 16px;
    border-radius: 15px;
    min-height: 60px;
}

#response-container {
    background-color: white;
    padding: 15px;
    margin-top: 20px;
    display: none;
}

#response {
    font-size: 16px;
    color: #2c3e50;
    text-align: left;
    margin: 0;
}

#follow-up-container {
    display: none;
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
}

#follow-up-btn {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 25px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#follow-up-btn:hover {
    background-color: #2980b9;
}

#conversation-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.conversation-item {
    margin-bottom: 30px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.question {
    background-color: #3498db;
    color: white;
    padding: 15px;
    border-radius: 18px 18px 4px 18px;
    margin-bottom: 15px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.answer {
    background-color: white;
    color: #333;
    padding: 15px;
    border-radius: 18px 18px 18px 4px;
    max-width: 85%;
    margin-right: auto;
    margin-left: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#submit-btn, #reset-btn {
    background-color: #3498db;
    color: white;
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(52,152,219,0.2);
}

#submit-btn:active, #reset-btn:active {
    transform: scale(0.98);
}

#reset-btn {
    width: auto;
    padding: 10px 20px;
    border-radius: 25px;
    margin-top: 25px;
    display: none;  /* Hide by default */
}

.credit {
    margin-top: 20px;
    color: #7f8c8d;
}

.spinner-container {
    display: none;
    justify-content: center;
    margin: 20px 0;
}

.spinner {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.dot {
    width: 12px;
    height: 12px;
    background: #3498db;
    border-radius: 50%;
    animation: threeDots 1.4s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes threeDots {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.video-item {
    margin: 15px 0;
    padding: 12px;
    border: none;
    border-radius: 15px;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-item a {
    text-decoration: none;
    color: inherit;
}

.video-item h3 {
    font-size: 15px;
    line-height: 1.4;
    margin: 8px 0;
}

.video-item img {
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.video-item p {
    color: #666;
    font-size: 14px;
    margin: 10px 0 0 0;
    line-height: 1.4;
}

.share-box {
    width: 100%;
    margin-top: 15px;
}

.share-input-group {
    flex-direction: column;
    gap: 10px;
}

#share-url, #copy-button {
    width: 100%;
    padding: 12px;
    border-radius: 15px;
}

#copy-button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
}

#copy-button:hover {
    background-color: #2980b9;
}

.rating-stars {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.star {
    font-size: 28px;
    color: #ddd;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
}

.star:hover {
    transform: scale(1.1);
    color: #ffd700;
}

.star.active {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255,215,0,0.5);
}

@media (min-width: 768px) {
    .container {
        width: 90%;
        padding: 20px;
    }
    
    h1 {
        font-size: 3.375rem;
    }

    #submit-btn, #follow-up-btn {
        width: auto;
        padding: 10px 30px;
    }

    .share-input-group {
        flex-direction: row;
    }

    #copy-button {
        width: auto;
    }
}

/* Scroll button */
.scroll-button {
    position: fixed;
    bottom: 100px;  /* Above the follow-up container */
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 20px;
    z-index: 100;
}

/* Floating follow-up container */
.floating-container {
    width: 100%;
    max-width: 90%;
    margin: 15px auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.follow-up-inner {
    display: flex;
    gap: 10px;
    flex-direction: column;  /* Stack on mobile */
}

@media (min-width: 768px) {
    .follow-up-inner {
        flex-direction: row;  /* Side by side on desktop */
    }
}

/* Move rating and share into conversation flow */
.rating-share-container {
    width: auto;
    max-width: 85%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 20px;
    margin-right: auto;
    margin-left: 0;
    padding: 15px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rating-container, .share-box {
    width: 100%;
    max-width: 400px; /* Make smaller */
    text-align: left; /* Left-align text */
    margin-bottom: 10px;
}

.rating-stars {
    display: flex;
    justify-content: flex-start; /* Left-align stars */
    gap: 10px;
    margin: 10px 0;
}

.share-input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Left-align inputs */
    gap: 10px;
    width: 100%;
}

/* Inline follow-up form styling */
.follow-up-form {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin: 20px 0;
    width: 100%;
}

.inline-follow-up-textarea {
    width: 80%;
    padding: 15px;
    border: 2px solid #3498db;
    border-radius: 15px;
    font-size: 16px;
    margin-bottom: 10px;
    margin-left: auto;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}

.inline-follow-up-submit {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 25px;
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.inline-follow-up-submit:hover {
    background-color: #2980b9;
}

/* Voice button styles */
.voice-button:hover {
    background-color: #F0C800;
}

.voice-button:disabled {
    background-color: #F0E68C;
    color: #666;
    cursor: not-allowed;
}

.recording-status {
    margin-top: 8px;
    color: #e74c3c;
    font-size: 14px;
    font-weight: bold;
    padding: 5px;
    border-radius: 4px;
    display: none;
}

.recording-animation {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #e74c3c;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

.speak-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 10px;
    display: block;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: fit-content;
    line-height: 1.5;
    margin-left: 0;
    margin-top: 0;
}

.speak-button:hover {
    background-color: #45a049;
}

.speak-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Fix button text alignment */
.voice-button, #submit-btn {
    text-align: center;
    justify-content: center;
    align-items: center;
    width: 100%; /* Ensure full width consistency */
}

/* Make the buttons wrapper center the buttons properly */
.buttons-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    margin: 0 auto;
}

.buttons-wrapper button {
    width: 100%;
    margin: 5px 0;
    border-radius: 25px;
}

/* Position the speak button properly */
.answer {
    position: relative;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
    .voice-button, #submit-btn {
        width: 100%;
        margin: 5px 0;
        padding: 10px;
        font-size: 16px;
        text-align: center;
        justify-content: center;
    }
    
    .speak-button {
        padding: 8px 12px;
        font-size: 14px;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .conversation-item {
        padding: 10px;
    }
    
    .answer, .question {
        font-size: 16px;
        line-height: 1.5;
    }
}

@media screen and (max-width: 480px) {
    .voice-button, #submit-btn {
        font-size: 14px;
    }
    
    .recording-status {
        font-size: 12px;
    }
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 5px;
}

.site-logo {
    max-height: 351px;
    width: auto;
    margin: 0;
}

/* Make the header responsive */
@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }
    
    .site-logo {
        max-height: 293px;
        margin: 10px 0 0 0;
    }
}

#voice-input-btn {
    width: 100% !important;
    background-color: #FFD700;
    color: #000;
    border: none;
    margin-top: 10px;
    margin-bottom: 10px;
}

#submit-btn, .voice-button {
    width: 100%;
    max-width: 100%;
    display: block;
    margin: 10px auto;
    border-radius: 25px;
    padding: 10px 20px;
    text-align: center;
    box-sizing: border-box;
}

#submit-btn {
    background-color: #3498db;
    color: white;
    border: none;
}

#buttons-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px 0;
}

#submit-btn, #voice-input-btn {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border-radius: 25px;
    border: none;
    font-family: 'Lexend Deca', sans-serif;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#submit-btn {
    background-color: #3498db;
    color: white;
}

#voice-input-btn {
    background-color: #FFD700;
    color: #000;
}

/* Clear previous button styling that might interfere */
.voice-button {
    /* Reset any existing styles */
    margin: 0;
    max-width: none;
    display: flex;
}

/* Media query for responsive design */
@media (min-width: 768px) {
    #buttons-container {
        flex-direction: column;
    }
}

/* CRITICAL BUTTON STYLING - DO NOT MODIFY */
#questionForm #buttons-container {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 15px 0 !important;
    box-sizing: border-box !important;
}

#questionForm #buttons-container #submit-btn,
#questionForm #buttons-container #voice-input-btn {
    width: 100% !important;
    padding: 12px !important;
    margin: 5px 0 !important;
    border-radius: 25px !important;
    border: none !important;
    font-family: 'Lexend Deca', sans-serif !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    max-width: none !important;
    min-width: 100% !important;
    height: auto !important;
}

#questionForm #buttons-container #submit-btn {
    background-color: #3498db !important;
    color: white !important;
}

#questionForm #buttons-container #voice-input-btn {
    background-color: #FFD700 !important;
    color: #000 !important;
}

.footer-links {
    margin-top: 15px;
    text-align: center;
    width: 100%;
}

.experiment-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.experiment-link:hover {
    background-color: #f0f8ff;
    text-decoration: underline;
}