/* Mobile-First Base Styles */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2E7D32;
    --accent-color: #81C784;
    --text-color: #333;
    --text-light: #666;
    --bg-color: #f9f9f9;
    --white: #ffffff;
    --spacing-unit: 1rem;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding-bottom: 2rem;
}

/* Header & Nav */
header {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-icon {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: none;
    /* Hidden on mobile by default */
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Main Container */
main {
    max-width: 1200px;
    /* Increased for landing page */
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 80vh;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 8rem 1.5rem;
    background: linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45)), url('../assets/hero_bg.webp');
    background-size: cover;
    background-position: center;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cta-button {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1.5rem;
    transition: transform 0.2s, background 0.3s;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    color: var(--white);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: var(--accent-color);
    filter: blur(80px);
    opacity: 0.2;
    z-index: 0;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    line-height: 1.1;
    font-weight: 800;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

/* Feature Sections (Alternating) */
.feature-section {
    padding: 6rem 0;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    align-items: center;
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.feature-content {
    order: 2;
}

.feature-image {
    order: 1;
    position: relative;
}

.feature-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow-hover);
    transition: transform 0.5s ease;
}

.feature-image img:hover {
    transform: scale(1.02);
}

.feature-content h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.feature-content p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.feature-point {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.feature-point-icon {
    background: #e8f5e9;
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: bold;
}

/* How It Works (Visual Update) */
.how-it-works {
    background: var(--white) !important;
    padding: 5rem 2rem !important;
    border-radius: 32px !important;
}

.step-card {
    background: #fcfcfc;
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.step-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Desktop Enhancements */
@media (min-width: 992px) {
    .feature-row {
        grid-template-columns: 1fr 1fr;
        gap: 6rem;
    }

    .feature-content {
        order: unset;
    }

    .feature-image {
        order: unset;
    }

    .feature-row.reverse .feature-content {
        order: 2;
    }

    .feature-row.reverse .feature-image {
        order: 1;
    }

    .hero h1 {
        font-size: 4.5rem;
    }
}

/* Quiz Styles */
.quiz-container {
    max-width: 600px;
}

#quiz-progress {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.question-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.question-step.active {
    display: block;
}

.question-step h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.options.vertical {
    grid-template-columns: 1fr;
}

.option-card {
    background: var(--white);
    border: 2px solid #eee;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.option-card:hover {
    border-color: var(--accent-color);
    background: #f0f9f0;
}

.option-card input:checked+span {
    font-weight: bold;
    color: var(--secondary-color);
}

.option-card input {
    accent-color: var(--primary-color);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.input-group label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
}

.input-group input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.next-btn,
.prev-btn,
.submit-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.3s;
}

.next-btn,
.submit-btn {
    background: var(--primary-color);
    color: var(--white);
    flex: 1;
}

.prev-btn {
    background: #e0e0e0;
    color: #555;
}

/* Result Page */
#loading-screen {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.confidence-score {
    display: inline-block;
    background: #e8f5e9;
    color: var(--secondary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Weekly Plan Styles */
.weekly-plan {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.day-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-top: 5px solid var(--primary-color);
}

.day-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.meal-item {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    border-left: 4px solid var(--accent-color);
}

.meal-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.2rem;
}

.meal-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.meal-macros {
    font-size: 0.8rem;
    color: #777;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.actions button,
.actions a {
    text-align: center;
    padding: 1rem;
    background: var(--white);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.actions button:hover,
.actions a:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Footer */
footer {
    background: #1a1a1a;
    color: var(--white);
    padding: 4rem 1.5rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
}

@media (min-width: 992px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        text-align: left;
    }
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-section p {
    color: #bbb;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: #eee;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Footer Utility Classes */
.footer-text-muted {
    color: #888 !important;
    font-size: 0.8rem;
}

.footer-text-small {
    color: #777 !important;
    font-size: 0.8rem;
}

.footer-legal-note {
    margin-top: 1.5rem !important;
    line-height: 1.4;
}

.link-underline {
    text-decoration: underline !important;
    color: inherit;
}

.link-underline:hover {
    color: var(--primary-color) !important;
}

.full-width-divider {
    grid-column: 1 / -1;
    border-top: 1px solid #333;
    padding-top: 2rem;
    margin-top: 1rem;
}

.disclaimer-container {
    font-style: italic;
    font-size: 0.85rem;
    color: #888;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.6;
}

.disclaimer-link {
    color: var(--primary-color) !important;
    font-weight: 700;
    text-decoration: underline;
    display: inline-block;
    margin-top: 1rem;
}

.disclaimer-link:hover {
    filter: brightness(1.2);
}

.trust-signals {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #999;
    padding-top: 0;
    border: none;
}

.trust-signal-item {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

@media (min-width: 992px) {
    .trust-signal-item {
        justify-content: flex-start;
    }
}

.footer-copyright {
    text-align: center;
    margin-top: 3rem;
    color: #666;
    font-size: 0.85rem;
    border-top: 1px solid #222;
    padding-top: 2rem;
}

/* Blog Index Specific Styles */
.blog-hero {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: var(--white);
    padding: 5rem 1rem;
    text-align: center;
    border-radius: var(--border-radius);
    margin-bottom: 4rem;
}

.blog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.blog-hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 1rem 0;
}

.blog-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    will-change: transform, box-shadow;
}

.blog-card-img {
    width: 100%;
    height: 250px;
    background: #eee;
    /* Placeholder */
    object-fit: cover;
}

.blog-card-img img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.blog-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.blog-card h2 a {
    text-decoration: none;
    color: inherit;
}

.blog-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.read-more {
    color: var(--primary-color);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
}

.read-more:hover {
    gap: 0.8rem;
}

/* Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Desktop Enhancements */
@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .features {
        grid-template-columns: repeat(3, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* Blog Post Content Styling */
.blog-post {
    max-width: 900px !important;
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-left: auto;
    margin-right: auto;
}

.blog-post h1 {
    font-size: 2.8rem;
    color: var(--secondary-color);
    line-height: 1.2;
    margin-bottom: 2rem;
    border-bottom: 4px solid var(--primary-color);
    padding-bottom: 1rem;
    display: inline-block;
}

.blog-post h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.blog-post h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.blog-post p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #444;
}

.blog-post ul,
.blog-post ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.blog-post li {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.blog-post table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.blog-post th {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    text-align: left;
}

.blog-post td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.blog-post tr:hover {
    background: #f0f9f0;
}

.blog-post em {
    color: #888;
    font-style: italic;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .blog-post {
        padding: 2rem 1rem;
    }

    .blog-post h1 {
        font-size: 2rem;
    }

    .blog-post h2 {
        font-size: 1.6rem;
    }
}

/* 404 Page Styling */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 1rem;
}

.error-content h1 {
    font-size: 8rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.error-content h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.error-content p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.redirect-text {
    font-size: 0.9rem !important;
    color: #999 !important;
    margin-bottom: 2rem !important;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.secondary-button {
    padding: 1rem 2rem;
    border-radius: 50px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .error-actions {
        flex-direction: column;
    }

    .error-content h1 {
        font-size: 5rem;
    }

    .error-content h2 {
        font-size: 1.8rem;
    }
}

/* Homepage Enhancement Sections */
.home-demo-section {
    padding: 80px 0;
    text-align: center;
}

.home-demo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: 40px;
}

.demo-output-preview {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    width: 100%;
    text-align: left;
    border: 1px solid #eee;
}

.demo-output-item {
    margin-bottom: 20px;
}

.demo-output-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.demo-output-value {
    font-size: 1.4rem;
    color: var(--secondary-color);
    font-weight: 800;
}

.demo-recipe-brief {
    background: #f0f7f0;
    padding: 15px;
    border-radius: 12px;
    margin-top: 15px;
}

.latest-blogs-section {
    padding: 80px 0;
    background: white;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-post-card {
    background: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.blog-post-card:hover {
    transform: translateY(-5px);
}

.blog-post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-post-body {
    padding: 20px;
}

.blog-post-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
}

.blog-post-title a {
    text-decoration: none;
    color: inherit;
}

.blog-post-title a:hover {
    color: var(--primary-color);
}

.blog-post-snippet {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.reinforced-cta {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    border-radius: 30px;
    margin: 80px 0;
}

.reinforced-cta h2 {
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
}

.reinforced-cta p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    opacity: 0.9;
}

.reinforced-cta .cta-button {
    background: white;
    color: var(--secondary-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.reinforced-cta .cta-button:hover {
    background: #f0f0f0;
}

@media (max-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }

    .reinforced-cta h2 {
        font-size: 2rem;
    }
}