/* Mobile-first styles */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --card-bg: #fff;
    --border-color: #ddd;
    --shadow-color: rgba(0,0,0,0.1);
    --max-mobile-width: 480px;
    --header-bg: #f0f0f0;
    --footer-bg: #f0f0f0;
    --success-color: #4CAF50;
    --error-color: #F44336;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

/* Mobile container to emulate a mobile device on desktop */
.mobile-container {
    max-width: var(--max-mobile-width);
    min-height: 100vh;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px var(--shadow-color);
    background-color: white;
    position: relative;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    padding: 1.2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-weight: 600;
    letter-spacing: 0.5px;
}

main {
    flex: 1;
    padding: 1.8rem;
    overflow-y: auto;
    background-color: white;
}

footer {
    background-color: #f8f8f8;
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    color: #666;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    margin-top: 0.5rem;
    font-size: 1.6rem;
}

h2 {
    margin-top: 2rem;
    font-size: 1.4rem;
    color: var(--primary-color);
}

h3 {
    margin-top: 1.8rem;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

p {
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

p.intro-text {
    font-weight: 500;
    margin-bottom: 1.5rem;
}

p.consent-notice {
    margin-top: 2rem;
    font-weight: 500;
    padding: 1rem;
    background-color: #e3f2fd;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

/* List styling */
ul, ol {
    margin-left: 0;
    margin-bottom: 1.8rem;
    list-style-position: outside;
    padding-left: 1.5rem;
}

ul li, ol li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
    line-height: 1.5;
}

/* Enhanced list styles */
ul.standard-list {
    list-style-type: disc;
}

ul.standard-list li::marker {
    color: var(--primary-color);
}

/* Researcher list styling */
.researcher-list {
    list-style-type: none;
    padding-left: 0.5rem;
    margin-bottom: 2.2rem;
    border-left: 3px solid var(--secondary-color);
}

.researcher-list li {
    margin-bottom: 1rem;
    padding-left: 1rem;
    position: relative;
}

.researcher-list li strong {
    color: #333;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.2rem;
}

/* Privacy list styling */
.privacy-list {
    list-style-type: square;
    padding-left: 1.8rem;
}

.privacy-list li {
    margin-bottom: 1rem;
    padding-left: 0.3rem;
    color: #444;
}

/* Progress bar */
.progress-bar {
    background-color: #e9e9e9;
    border-radius: 20px;
    height: 12px;
    margin: 1.5rem 0;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    position: relative;
}

.progress {
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    height: 100%;
    border-radius: 20px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.progress-text {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 1.8rem;
    color: #555;
    font-weight: 500;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Forms */
.survey-form, .action-form {
    margin-top: 1.5rem;
    background-color: #fff;
    padding: 0;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Consent checkbox with text on right side styling */
.consent-group {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    background-color: #f2f9ff;
    padding: 1.2rem;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

/* Blue consent style to match consent-notice */
.blue-consent {
    display: flex;
    align-items: center;
    background-color: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--secondary-color);
}

.blue-consent input[type="checkbox"] {
    margin-right: 0.8rem;
    transform: scale(1.3);
    accent-color: var(--primary-color);
    cursor: pointer;
}

.blue-consent label {
    margin-bottom: 0;
    font-weight: 500;
    cursor: pointer;
}

.consent-checkbox {
    display: flex;
    align-items: flex-start;
    min-width: 180px;
}

.consent-checkbox input[type="checkbox"] {
    margin-top: 0.3rem;
    margin-right: 0.8rem;
    transform: scale(1.3);
    accent-color: var(--primary-color);
    cursor: pointer;
}

.consent-text {
    flex: 1;
    padding-left: 0.5rem;
    border-left: 1px solid #e0e0e0;
}

.consent-text p {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.4;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 0.5rem;
    font-family: inherit;
    background-color: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

button {
    cursor: pointer;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    display: block;
    text-align: center;
    text-decoration: none;
    padding: 1rem;
    margin-top: 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.btn-primary:active, .btn-secondary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #45a049 0%, #2e7d32 100%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

/* Radio and checkbox styling */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0;
}

.radio-option {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.2s;
    cursor: pointer;
}

.radio-option:hover {
    border-color: var(--secondary-color);
    background-color: #f5f9ff;
}

.radio-option input[type="radio"] {
    margin-right: 0.8rem;
    transform: scale(1.2);
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + label {
    color: var(--secondary-color);
    font-weight: 500;
}

.radio-option label {
    cursor: pointer;
    flex: 1;
}

/* Checkbox group styling for multiple selections */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1rem 0;
}

.checkbox-option {
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: all 0.2s;
    cursor: pointer;
}

.checkbox-option:hover {
    border-color: var(--secondary-color);
    background-color: #f5f9ff;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 0.8rem;
    transform: scale(1.2);
    cursor: pointer;
}

.checkbox-option input[type="checkbox"]:checked + label {
    color: var(--secondary-color);
    font-weight: 500;
}

.checkbox-option label {
    cursor: pointer;
    flex: 1;
    margin: 0;
}

/* Rating scales */
.rating-group {
    margin-bottom: 2.5rem;
    background-color: #fafafa;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.rating-group label {
    font-weight: 600;
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 1rem;
}

.rating-scale {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 1.2rem 0;
    position: relative;
}

.rating-scale::before {
    content: none; /* Remove the horizontal line */
}

.rating-scale span {
    font-size: 0.85rem;
    color: #555;
    text-align: center;
    max-width: 85px;
    font-weight: 500;
    background-color: #fafafa;
    padding: 0 8px;
    position: relative;
    z-index: 1;
}

.rating-options {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 0.8rem 0;
}

.rating-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin: 0 3px;
    position: relative;
    z-index: 1;
}

.rating-option input[type="radio"] {
    margin-bottom: 5px;
    transform: scale(1.2);
    cursor: pointer;
}

.rating-option label {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.9rem;
    color: #444;
    font-weight: 500;
    cursor: pointer;
}

/* Hover effect for better UX */
.rating-option:hover label {
    color: #555;
}

/* Sub-rating styles */
.correctness-details {
    background-color: #fafafa;
    border: 1px solid #eee;
    border-left: 3px solid var(--secondary-color);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.correctness-details > label {
    color: #333;
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
}

.subrating {
    margin-bottom: 1.5rem;
    background-color: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.subrating:last-child {
    margin-bottom: 0;
}

.subrating label {
    color: #444;
    font-weight: 500;
    font-size: 0.95rem;
}

/* Recipe card */
.recipe-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.recipe-card h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    padding-bottom: 0.8rem;
    border-bottom: 2px dotted #e0e0e0;
    position: relative;
}

.recipe-description {
    font-style: italic;
    margin-bottom: 1.2rem;
    color: #555;
    line-height: 1.5;
    padding: 0.5rem;
    background-color: #f8f8f8;
    border-radius: 6px;
}

.recipe-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fafafa;
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
}

.recipe-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #333;
    display: flex;
    align-items: center;
}

.recipe-section h3::before {
    content: "•";
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-right: 0.5rem;
    line-height: 0.8;
}

.recipe-section p {
    line-height: 1.6;
    color: #444;
}

.recipe-nutrition {
    background-color: #f0f8ff;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    border-left: 3px solid #2196F3;
}

.recipe-nutrition h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #333;
    display: flex;
    align-items: center;
}

.recipe-nutrition h3::before {
    content: "•";
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin-right: 0.5rem;
    line-height: 0.8;
}

.recipe-nutrition ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.recipe-nutrition ul li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    background-color: white;
    padding: 0.5rem 0.8rem;
    border-radius: 5px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Introduction section */
.intro {
    margin-bottom: 2rem;
}

.intro h2 {
    color: var(--primary-color);
}

.intro ul, .intro ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

/* Instruction box for recipe pages */
.instruction-box {
    background-color: #f0f8ff;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--secondary-color);
}

.instruction-box p {
    margin: 0;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
}

.study-details {
    margin-top: 3rem;
    margin-bottom: 2.5rem;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.study-details h3 {
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e5e5e5;
    font-weight: 600;
    position: relative;
}

.study-details h3::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 1.2rem;
    width: 0.5rem;
    height: 1.5rem;
    background-color: var(--primary-color);
    border-radius: 0 3px 3px 0;
}

.study-details h3:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.study-details h3:first-child::before {
    top: 0;
}

.study-details ul, .study-details ol {
    margin-bottom: 1.8rem;
    list-style-position: outside;
    padding-left: 1.8rem;
}

.disclaimer {
    background-color: #FFF9C4;
    border-left: 4px solid #FBC02D;
    border-radius: 5px;
    padding: 1rem 1.2rem;
    margin: 2.5rem 0;
    position: relative;
}

.disclaimer::before {
    content: "!";
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-color: #FBC02D;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.disclaimer p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Debriefing section */
.debriefing h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
}

.study-info, .contact-info, .thank-you {
    margin-bottom: 1.5rem;
}

.action-buttons {
    margin-top: 2rem;
}

/* Prolific-specific styles */
.prolific-note {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
    .mobile-container {
        border: none;
        box-shadow: none;
    }
    
    .consent-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .consent-text {
        padding-left: 0;
        border-left: none;
        padding-top: 0.8rem;
        border-top: 1px solid #e0e0e0;
    }
    
    .consent-checkbox {
        min-width: 100%;
    }
    
    .blue-consent {
        padding: 0.8rem;
    }
}

/* Responsive design for desktop/tablet */
@media (min-width: 700px) {
    .mobile-container {
        max-width: 700px;
        min-height: 80vh;
        margin: 2rem auto;
        border-radius: 16px;
        box-shadow: 0 0 32px var(--shadow-color);
        padding: 2rem 2.5rem;
    }
    main {
        padding: 2.5rem 2.5rem;
        font-size: 1.1rem;
    }
    header h1 {
        font-size: 2.2rem;
    }
    h2 {
        font-size: 1.7rem;
    }
    h3 {
        font-size: 1.3rem;
    }
    .survey-form, .action-form {
        padding: 2rem 2.5rem;
    }
    .form-group {
        margin-bottom: 2.2rem;
    }
    input[type="text"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 1.1rem;
        padding: 1.2rem;
    }
    button, .btn-primary, .btn-secondary {
        font-size: 1.1rem;
        padding: 1rem 2rem;
    }
    ul, ol {
        font-size: 1.1rem;
    }
}

/* Desktop layout: wide, centered, with more whitespace and larger elements */
@media (min-width: 1000px) {
    body {
        background-color: #f5f7fa;
    }
    .container, .mobile-container {
        max-width: 900px;
        min-height: 80vh;
        margin: 3rem auto;
        border-radius: 24px;
        box-shadow: 0 0 48px var(--shadow-color);
        padding: 3rem 3.5rem;
        background: #fff;
    }
    main {
        padding: 3rem 3.5rem;
        font-size: 1.2rem;
    }
    header {
        padding: 2rem 0;
        font-size: 2.5rem;
    }
    header h1 {
        font-size: 2.5rem;
    }
    h2 {
        font-size: 2rem;
    }
    h3 {
        font-size: 1.5rem;
    }
    .survey-form, .action-form {
        padding: 2.5rem 3rem;
        border-radius: 16px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    }
    .form-group {
        margin-bottom: 2.5rem;
    }
    input[type="text"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 1.2rem;
        padding: 1.5rem;
        border-radius: 12px;
    }
    button, .btn-primary, .btn-secondary {
        font-size: 1.2rem;
        padding: 1.2rem 2.5rem;
        border-radius: 12px;
    }
    ul, ol {
        font-size: 1.2rem;
    }
    .nutrition-info {
        font-size: 1.1rem;
        padding: 1.5rem 2rem;
        border-radius: 12px;
    }
    .recipe-card {
        margin: 2rem 0;
        padding: 2rem 2.5rem;
        border-radius: 16px;
        box-shadow: 0 2px 12px rgba(0,0,0,0.07);
        background: #f9f9f9;
    }
    .recipe-section {
        margin-bottom: 2rem;
    }
    /* Admin dashboard table and cards */
    .metrics-grid {
        gap: 32px !important;
    }
    .metric-card {
        padding: 32px !important;
        font-size: 1.2rem;
        border-radius: 16px !important;
    }
    .table th, .table td {
        padding: 18px !important;
        font-size: 1.1rem;
    }
    .section {
        margin-bottom: 48px !important;
    }
}
