/* Global styles */
:root {
    --primary-color: #10a37f; /* OpenAI green */
    --secondary-color: #343541; /* OpenAI dark gray */
    --background-color: #f7f7f8; /* OpenAI light background */
    --text-color: #202123; /* OpenAI text color */
    --border-color: #e5e5e5; /* Light border */
    --success-color: #10a37f; /* OpenAI green for success */
    --error-color: #ef4146; /* Red for errors */
    --light-hover: #f0f0f0; /* Light hover color */
    --section-background: #ffffff; /* White section background */
    
    /* New rating selector variables */
    --rating-gradient-0: #f1f5f9; /* Lightest - for rating 0 */
    --rating-gradient-1: #e2eef9;
    --rating-gradient-2: #d3e6f8;
    --rating-gradient-3: #c4ddf7;
    --rating-gradient-4: #b5d5f6; /* Darkest - for rating 4 */
    --rating-selected: var(--primary-color);
    --rating-na: #8e8ea0;
    --rating-border: #dde5ed;
    --rating-hover-shadow: rgba(100, 125, 150, 0.1);
    
    /* Warning colors */
    --warning-bg: #fff3cd;
    --warning-border: #ffeeba;
    --warning-text: #856404;
    
    /* Animation timing - golden ratio based */
    --animation-short: 0.25s;
    --animation-medium: 0.4045s; /* 0.25 * 1.619 = ~0.4 */
    --animation-long: 0.654s; /* 0.4045 * 1.619 = ~0.65 */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Söhne', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    padding: 20px;
    font-size: 16px;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

p {
    margin-bottom: 1rem;
    font-size: 16px;
}

button {
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

button:hover {
    background-color: #0e8c6d; /* Darker green on hover */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Add styles for disabled buttons to indicate they're not clickable */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #aaa;
}

/* Animation for loading state on buttons */
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

button:disabled {
    animation: pulse 1.5s infinite;
}

input[type="number"], select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    width: 200px;
    transition: border-color 0.2s ease;
}

input[type="number"]:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.2);
}

/* Survey container */
#survey-container {
    width: 90%;
    margin: 0 auto;
    background-color: var(--section-background);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.section {
    padding: 2.5rem;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.4s ease;
}

.section.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

/* Section entry animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section:not(.hidden) {
    animation: fadeInUp 0.5s ease-out;
}

/* Consent section */
/* Organization banner */
.organization-banner {
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.qri-logo {
    max-height: 50px;
    width: auto;
    margin-right: 1rem;
}

.organization-banner h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--secondary-color);
}

/* Landing banner and incentive */
.landing-banner {
    background: linear-gradient(135deg, #10a37f 0%, #0a715a 100%);
    color: white;
    padding: 3rem 2.5rem;
    border-radius: 0;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.landing-banner h1 {
    text-align: center;
    margin-bottom: 1.75rem;
    color: white;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.banner-content {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

.study-description {
    flex: 1;
}

.study-description h2 {
    color: white;
    margin-bottom: 1rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.study-description h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.study-description p {
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 0;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.9);
}

.incentive-box {
    flex: 1;
    max-width: 400px;
    background-color: rgba(255, 255, 255, 0.97);
    color: var(--text-color);
    padding: 1.75rem;
    border-radius: 12px;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.incentive-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.incentive-image {
    width: 200px;
    height: auto;
    background-color: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.incentive-image img {
    width: 100%;
    height: auto;
}

.incentive-text h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.info-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    border-bottom: 1px solid var(--primary-color);
    transition: all 0.2s ease;
}

.info-link:hover {
    opacity: 0.8;
}

.content {
    width: 95%;
    margin: 0 auto;
}

/* Welcome section card-based design */
.welcome-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
    margin: 2rem 0 3rem;
}

.welcome-card {
    background-color: var(--section-background);
    padding: 1.75rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #f0f0f0;
    position: relative;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), #0e8c6d);
    border-radius: 10px 10px 0 0;
    opacity: 0.8;
}

.welcome-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-size: 2.25rem;
    margin-bottom: 1.25rem;
    color: var(--primary-color);
}

.welcome-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.welcome-card p {
    color: #555;
    flex-grow: 1;
    font-size: 1rem;
    line-height: 1.6;
}

.welcome-card .welcome-details {
    background-color: rgba(16, 163, 127, 0.05);
    border: none;
    padding: 1rem;
    margin: 0.5rem 0 0 0;
    border-radius: 6px;
}

.welcome-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.welcome-detail-item:last-child {
    margin-bottom: 0;
}

.welcome-detail-label {
    font-weight: 500;
    color: #444;
}

.welcome-detail-value {
    font-weight: 600;
    color: var(--primary-color);
}

.welcome-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.start-button-container {
    text-align: center;
    margin-top: 2.5rem;
}

.contact-info {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: #f9fafb;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
    position: relative;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), #0e8c6d);
    border-radius: 3px;
}

.contact-info h3 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.contact-info p {
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
    color: #444;
}

@media (max-width: 1100px) {
    .banner-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .incentive-box {
        max-width: 100%;
    }
    
    .landing-banner h1 {
        font-size: 2rem;
    }
}

@media (max-width: 767px) {
    .welcome-cards {
        grid-template-columns: 1fr;
    }
    
    .landing-banner {
        padding: 2rem 1.5rem;
    }
    
    .landing-banner h1 {
        font-size: 1.75rem;
    }
    
    .study-description h2 {
        font-size: 1.5rem;
    }
    
    .study-description p {
        font-size: 1rem;
    }
    
    .welcome-card p {
        font-size: 0.95rem;
    }
}

#welcome-next-button {
    min-width: 200px;
    padding: 1rem 2rem;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    border-radius: 8px;
    font-weight: 500;
    background: linear-gradient(to right, var(--primary-color), #0e8c6d);
    box-shadow: 0 4px 15px rgba(16, 163, 127, 0.3);
}

#welcome-next-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 163, 127, 0.4);
}

/* Consent content styles */
.consent-content {
    margin-bottom: 30px;
    overflow: visible;
}

.consent-content h3 {
    margin-top: 2rem;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.consent-content p, 
.consent-content li {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #353740;
}

.consent-content ul {
    padding-left: 1.5rem;
}

.consent-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.important-disclaimers {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 1rem;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.important-disclaimers h4 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.important-disclaimers ul {
    margin-bottom: 0;
}

.important-disclaimers li {
    margin-bottom: 0.5rem;
}

.exclusion-criteria {
    background-color: rgba(239, 65, 70, 0.05);
    border: 1px solid rgba(239, 65, 70, 0.2);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}

.criteria-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.criteria-item input {
    margin-right: 10px;
    margin-top: 3px;
}

.exclusion-note {
    font-style: italic;
    color: #e74c3c;
    font-size: 0.9rem;
}

.consent-checkbox {
    margin: 1rem 0;
    display: flex;
    align-items: flex-start;
    background-color: rgba(16, 163, 127, 0.05);
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.consent-checkbox:hover {
    background-color: rgba(16, 163, 127, 0.08);
}

.consent-checkbox input {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--primary-color);
}

#start-button {
    display: block;
    margin: 0 auto;
    width: 200px;
}

/* Background section */
.background-questions {
    margin: 2rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

#background-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 1.75rem;
}

#background-section > p {
    text-align: center;
    margin-bottom: 1rem;
    color: #666;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Style other substance container to match our new design */
#other-substances-container {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.other-substance-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0;
    align-items: flex-start;
    padding: 1.25rem;
    background-color: var(--section-background);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.other-substance-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.other-substance-row input[type="text"],
.other-substance-row input[type="number"] {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 1rem;
    background-color: #f9fafb;
    transition: all 0.2s ease;
}

.other-substance-row input[type="text"]:focus,
.other-substance-row input[type="number"]:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
    outline: none;
}

.other-substance-row > div {
    flex-grow: 1;
}

.other-substance-row label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
    font-size: 1rem;
    display: block;
}

/* Update add other button styling */
.add-other-button {
    background-color: #f0f0f0;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    margin: 1rem auto;
    display: block;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.add-other-button:hover {
    background-color: #e6e6e6;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Update remove button styling */
.remove-other-button {
    background-color: rgba(239, 65, 70, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 65, 70, 0.2);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: auto;
    flex-shrink: 0;
    align-self: flex-start;
}

.remove-other-button:hover {
    background-color: rgba(239, 65, 70, 0.2);
    box-shadow: 0 2px 4px rgba(239, 65, 70, 0.15);
    transform: translateY(-1px);
}

/* Responsive adjustments for background section */
@media (min-width: 768px) {
    .background-questions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #other-substances-container {
        grid-column: 1 / -1;
    }
}

/* Restore notification */
.restore-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.restore-notification-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 90%;
    width: 500px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.restore-notification-content p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.restore-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.restore-buttons button {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#continue-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

#continue-button:hover {
    background-color: #0d8c6e;
}

#start-fresh-button {
    background-color: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

#start-fresh-button:hover {
    background-color: #f0f0f0;
}

.temp-message {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.demographics-questions {
    margin: 2rem 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.question-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    background-color: var(--section-background);
    padding: 1.25rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.question-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.question-row label {
    width: 100%;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
    font-size: 1rem;
}

.question-row input[type="number"],
.question-row select {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: #f9fafb;
    transition: all 0.2s ease;
}

.question-row input[type="number"]:focus,
.question-row select:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.15);
    outline: none;
}

/* Apple visualization styling improvements */
.apple-visualization-container {
    margin-top: 0.5rem;
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.apple-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.apple-rating {
    display: flex;
    justify-content: space-evenly;
    margin-top: 1rem;
    background-color: white;
    padding: 0.75rem;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.apple-rating .radio-option {
    position: relative;
    text-align: center;
    display: flex;
    justify-content: center;
    flex: 1;
    padding: 0 5px;
}

.apple-rating input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.apple-rating label {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    margin: 0 auto;
    cursor: pointer;
    font-weight: 500;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Individual color styling for each option */
#apple-viz-1 + label {
    background: linear-gradient(135deg, #ef4146 0%, #10a37f 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

#apple-viz-2 + label {
    background-color: #ef4146;
    color: white;
    box-shadow: 0 2px 6px rgba(239, 65, 70, 0.3);
    border-radius: 50%;
}

#apple-viz-3 + label {
    background-color: #f0f0f0;
    color: var(--text-color);
    border-radius: 50%;
}

#apple-viz-4 + label, #apple-viz-5 + label {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 50%;
}

.apple-rating label:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.apple-rating input[type="radio"]:checked + label {
    transform: scale(1.1);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
}

/* Mobile styles for apple rating */
@media (max-width: 767px) {
    .apple-rating {
        padding: 0.5rem;
    }
    
    .apple-rating label {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
        border-radius: 50%;
    }
    
    .apple-rating .radio-option {
        flex: 1;
        display: flex;
        justify-content: center;
    }
}

/* Demographics section header styling */
#demographics-section h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    font-size: 1.75rem;
}

#demographics-section > p {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Enhanced demographics section header */
#demographics-section {
    position: relative;
}

#demographics-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), #0e8c6d);
    border-radius: 5px 5px 0 0;
}

/* Visual indicators for required fields */
.question-row label::after {
    content: ' *';
    color: var(--primary-color);
    font-weight: bold;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .demographics-questions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Make the apple visualization span both columns */
    .demographics-questions .question-row:nth-child(5) {
        grid-column: 1 / -1;
    }
    
    /* Make longer selects span both columns */
    .demographics-questions .question-row:nth-child(6),
    .demographics-questions .question-row:nth-child(7) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .apple-rating label {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .question-row {
        padding: 1rem;
    }
    
    .question-row label {
        font-size: 0.9rem;
    }
}

/* Animation to highlight a field when it receives focus */
.question-row input:focus-within,
.question-row select:focus-within,
.apple-rating:focus-within {
    animation: pulse-border 1.5s ease-in-out;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.3); }
    70% { box-shadow: 0 0 0 6px rgba(16, 163, 127, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0); }
}

/* Next button improvement */
.next-button {
    display: block;
    margin: 2.5rem auto 0;
    width: 200px;
    cursor: pointer;
    padding: 0.9rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(16, 163, 127, 0.2);
    /* Additional styles to ensure the button is clickable */
    position: relative;
    z-index: 10;
}

.next-button:hover {
    background-color: #0e8c6d; /* Darker green on hover */
    box-shadow: 0 6px 12px rgba(16, 163, 127, 0.3);
    transform: translateY(-2px);
}

.next-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(16, 163, 127, 0.2);
}

/* Animation section */
#animation-section {
    padding: 1.5rem;
}

#animation-title {
    margin-bottom: 0.5rem;
}

#animation-instructions {
    margin-bottom: 1.5rem;
    font-style: italic;
    color: #555;
}

.animation-rating-container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 2rem;
    width: 100%;
    margin: 0 auto;
    max-width: 100%;
    align-items: start;
}

#animation-container {
    width: 100%;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--section-background);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    height: fit-content;
    max-height: none;
    overflow: visible;
}

/* Sticky video container for desktop */
@media (min-width: 992px) {
    #animation-container {
        position: sticky;
        top: 20px;
        z-index: 100;
    }
}

#video-container {
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

#animation-video {
    width: 100%;
    max-width: 800px;
    max-height: none;
    border-radius: 8px;
}

.progress-indicator {
    text-align: center;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: var(--text-color);
}

.instruction-toggle-container {
    margin-top: 0.75rem;
    text-align: center;
}

.instruction-toggle {
    display: inline-flex;
    align-items: center;
    background-color: #f8f9fa;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.instruction-checkbox {
    margin-right: 8px;
}

/* Rating form */
#rating-form {
    display: flex;
    flex-direction: column;
    background-color: var(--section-background);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
    overflow-x: hidden;
}

#rating-form h3 {
    width: 100%;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Creating a grid to organize questions */
.rating-questions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    max-height: none;
    overflow: visible;
}

.rating-subtitle {
    font-weight: normal;
    font-size: 0.8rem;
    font-style: italic;
    color: #666;
    display: block;
    margin-top: 0.4rem;
}

.rating-question {
    background-color: var(--background-color);
    border-radius: 8px;
    padding: 15px;
    transition: all var(--animation-short) ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: visible;
}

.rating-question:hover {
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
}

.rating-question label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.rating-radio-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.radio-option {
    position: relative;
    text-align: center;
    flex: 1;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0;
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    border-radius: 4px;
    transition: all var(--animation-short) ease;
    position: relative;
    font-size: 0.85rem;
}

.radio-option label:hover {
    background-color: rgba(0, 0, 0, 0.02);
    box-shadow: 0 2px 4px var(--rating-hover-shadow);
}

.radio-option label:before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--rating-border);
    background-color: white;
    display: block;
    margin-bottom: 0.2rem;
    transition: all var(--animation-short) ease;
}

.radio-option label:hover:before {
    border-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked + label:before {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.radio-option .rating-desc {
    display: block;
    font-size: 0.65rem;
    margin-top: 0.1rem;
    color: #888;
    line-height: 1.1;
}

.radio-option input[type="radio"]:checked + label {
    font-weight: 500;
    color: var(--primary-color);
    background-color: rgba(16, 163, 127, 0.05);
}

.radio-option input[type="radio"]:checked + label .rating-desc {
    color: var(--primary-color);
}

/* Tutorial section */
.tutorial-content {
    width: 95%;
    margin: 0 auto;
    padding: 1rem;
}

.tutorial-steps {
    margin: 2.5rem 0;
}

.tutorial-step {
    display: flex;
    margin-bottom: 2.5rem;
    align-items: flex-start;
    background-color: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Stimulus categories section */
.stimulus-categories-container {
    margin: 2.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.collapsible-button {
    width: 100%;
    background-color: #f8f9fa;
    color: #666;
    padding: 0.75rem;
    text-align: left;
    border: none;
    border-bottom: 1px solid var(--border-color);
    font-weight: 400;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.collapsible-button:hover {
    background-color: #f0f0f0;
}

.collapse-icon {
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.collapsible-button.active .collapse-icon {
    transform: rotate(90deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
}

.collapsible-content.active {
    max-height: 2000px; /* Large enough to accommodate content */
}

.categories-instructions {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    font-style: italic;
    color: #666;
}

.stimulus-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
}

.stimulus-category {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.category-example {
    width: 100%;
    padding: 0.75rem;
    background-color: #f8f9fa;
}

.example-video {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 4px;
}

.category-info {
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
    background-color: #f8f9fa;
}

.category-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.category-checkbox label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.tutorial-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-top: 0;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tutorial-image {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 1rem;
}

.sample-animation {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    overflow: visible;
}

.sample-video-container {
    width: 100%;
    margin: 20px 0;
    text-align: center;
    overflow: visible;
}

.sample-video-container video,
.sample-video-container iframe {
    width: 100%;
    height: 400px;
    border-radius: 4px;
    box-sizing: border-box;
}

.tutorial-notice {
    background-color: rgba(16, 163, 127, 0.08);
    border: 1px solid rgba(16, 163, 127, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2.5rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Comment section */
#animation-container .comment-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.comment-section {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.comment-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.comment-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
    min-height: 80px;
}

/* Navigation buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 1rem;
}

#rating-form .navigation-buttons {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.nav-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    min-width: 150px;
    max-width: 200px;
}

.nav-button:hover {
    background-color: #0d8c6e;
}

.nav-button.secondary {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid var(--border-color);
}

.nav-button.secondary:hover {
    background-color: #e9ecef;
}

/* Completion section */
#completion-section {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
}

#completion-section h2 {
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.75rem;
}

.tshirt-signup {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.tshirt-signup h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.instructions-box {
    background-color: #f0f8ff;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.instructions-box h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.instructions-box ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.instructions-box li {
    margin-bottom: 0.5rem;
}

.privacy-note {
    font-style: italic;
    color: #555;
    font-size: 0.9rem;
    margin-top: 1rem;
    border-top: 1px dashed #ddd;
    padding-top: 1rem;
}

.action-button {
    margin: 2rem 0;
    text-align: center;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}

.primary-button:hover {
    background-color: #2a75e6;
    text-decoration: none;
    color: white;
}

a.primary-button {
    text-decoration: none;
    color: white;
}

.completion-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 991px) {
    .completion-layout {
        grid-template-columns: 1fr;
    }
}

.resources-section {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    height: fit-content;
}

.resources-section h3 {
    margin-top: 0;
    color: #333;
    text-align: left;
}

.resource-links {
    list-style-type: none;
    padding: 0;
    text-align: left;
}

.resource-links li {
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.resource-links li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.resource-links a {
    color: #2672e3;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

.resource-links a:hover {
    color: #1a4fa3;
    text-decoration: underline;
}

.final-notes {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.final-notes p {
    color: #666;
    font-size: 0.9rem;
}

.footer-logo {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1rem;
}

.footer-logo img {
    max-height: 50px;
    width: auto;
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.footer-logo p {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0.5rem 0;
    color: var(--secondary-color);
    opacity: 0.8;
}

#completion-status {
    margin-top: 2rem;
    padding: 1rem;
    border-radius: 4px;
}

.success-message {
    background-color: rgba(56, 176, 0, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.error-message {
    background-color: rgba(230, 57, 70, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.notice-message {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid #3b82f6;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* Responsive styles */
/* Responsive breakpoints adjusted for the two-column layout */
@media (max-width: 1400px) {
    /* Keep two columns at this size */
    .rating-questions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .animation-rating-container {
        grid-template-columns: 1fr;
    }
    
    #animation-container {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
        max-height: none;
        overflow: visible;
    }
    
    #rating-form {
        width: 100%;
    }
}

@media (max-width: 991px) {
    .animation-rating-container {
        grid-template-columns: 1fr;
    }
    
    /* On mobile, don't make the video sticky */
    #animation-container {
        width: 100%;
        max-height: none;
        position: static;
    }
    
    #rating-form h3 {
        font-size: 1.2rem;
    }
    
    #animation-video {
        max-height: none;
    }
    
    .rating-questions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 20px;
    }
    
    .banner-content {
        flex-direction: column;
    }
    
    .incentive-box {
        margin-top: 20px;
    }
    
    #animation-container {
        max-height: none;
    }
    
    .navigation-buttons {
        flex-direction: column;
    }
    
    .nav-button {
        margin: 5px 0;
    }
    
    .rating-scale {
        flex-direction: column;
    }
    
    .rating-scale span:not(.value-display) {
        display: none;
    }
    
    .slider {
        width: 100%;
    }
    
    .rating-scale .value-display {
        margin-top: 5px;
        font-size: 1rem;
    }
    
    /* Stimulus categories responsive */
    .stimulus-categories-grid {
        grid-template-columns: 1fr;
    }
    
    .example-video {
        height: 180px;
    }
    
    [role="button"],
    button,
    input,
    select,
    textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
}

@media (max-width: 576px) {
    .rating-questions-grid {
        grid-template-columns: 1fr;
    }
    
    #animation-container {
        max-height: none;
    }
    
    .radio-option label {
        font-size: 0.9rem;
    }
}

@media (max-width: 500px) {
    .navigation-buttons {
        flex-direction: column;
    }
    
    .nav-button {
        width: 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Browser compatibility warning */
.browser-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--warning-bg);
    color: var(--warning-text);
    border-bottom: 1px solid var(--warning-border);
    padding: 10px 20px;
    z-index: 9999;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.browser-warning p {
    margin: 0;
}

.browser-warning button {
    background-color: var(--warning-text);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 15px;
}

.custom-substance-rating {
    background-color: #f0faf5 !important; /* Light green background to distinguish custom substances */
    border: 1px solid rgba(16, 163, 127, 0.3) !important;
    box-shadow: 0 2px 8px rgba(16, 163, 127, 0.1) !important;
}

/* Improved focus states for accessibility */
input:focus, 
select:focus, 
button:focus,
textarea:focus,
input[type="radio"]:focus + label,
input[type="checkbox"]:focus + label {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.2);
}

/* Focus visible (keyboard navigation) */
input:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Completion section card-based design */
.completion-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
    color: #555;
    font-size: 1.1rem;
}

.completion-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto 3rem;
}

.completion-card {
    background-color: var(--section-background);
    padding: 1.75rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.completion-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.completion-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.completion-card p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.primary-card {
    grid-column: 1;
    grid-row: span 2;
    background-color: #f0faf5;
    border: 1px solid rgba(16, 163, 127, 0.2);
}

.secondary-card {
    grid-column: 2;
    background-color: #f9fafb;
}

.info-card, .share-card {
    background-color: white;
}

.completion-section h2 {
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.75rem;
}

.instructions-box {
    background-color: white;
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
    border: 1px solid rgba(16, 163, 127, 0.2);
}

.instructions-box ul {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.instructions-box li {
    margin-bottom: 0.5rem;
    color: #333;
}

.privacy-note {
    font-style: italic;
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    border-top: 1px dashed #ddd;
    padding-top: 0.75rem;
}

.resources-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.resource-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.resource-link:hover {
    background-color: #f0f0f0;
    border-color: #ccc;
    transform: translateX(3px);
}

.resource-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    flex: 1;
    padding-right: 0.5rem;
}

.resource-arrow {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
}

.secondary-button {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-block;
    font-weight: 500;
    transition: all 0.2s ease;
}

.secondary-button:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 163, 127, 0.2);
}

.share-options {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.share-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #1da1f2;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.share-button:hover {
    background-color: #0d8ad6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(29, 161, 242, 0.3);
}

@media (max-width: 767px) {
    .completion-cards {
        grid-template-columns: 1fr;
    }
    
    .primary-card, .secondary-card {
        grid-column: auto;
        grid-row: auto;
    }
}

#completion-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), #0e8c6d);
    border-radius: 5px 5px 0 0;
}