/*
Theme Name: Viltmat Helsereise
Theme URI: https://viltmat.no/
Author: Jon Erik
Description: Moderne helsereise-tema med norsk språk, AI, oppskrifter, helse- og treningslogg, motivasjon og adminpanel. Matcher den originale designen.
Version: 1.0.0
*/

@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary: #2C5F2D;
    --primary-dark: #1a3a1b;
    --secondary: #97BC62;
    --accent: #D4A373;
    --accent-dark: #B8865F;
    --forest: #1a4d2e;
    --lake: #4A90A4;
    --salmon: #FA8072;
    --deer: #8B4513;
    --light: #F5F5F0;
    --white: #FFFFFF;
    --dark: #1a1a1a;
    --gray: #6c757d;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   NAVIGATION
   ======================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--shadow);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 30px var(--shadow-dark);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 300;
}

.logo i {
    font-size: 1.8rem;
}

.logo strong {
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu li a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--primary);
    background: rgba(44, 95, 45, 0.1);
}

.nav-menu li a.admin-link {
    color: var(--accent);
}

.nav-menu li a.admin-link:hover {
    background: rgba(212, 163, 115, 0.1);
}

.nav-item-with-submenu {
    position: relative;
}

.nav-item-with-submenu:hover .submenu {
    display: block;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    min-width: 200px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    z-index: 1000;
}

.submenu li {
    list-style: none;
}

.submenu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: all 0.2s ease;
}

.submenu a:hover {
    background: rgba(44, 95, 45, 0.1);
    color: var(--primary);
}

.burger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.burger span {
    width: 25px;
    height: 3px;
    background: var(--primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--forest) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(151, 188, 98, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(212, 163, 115, 0.1) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    padding: 2rem;
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.title-main {
    font-size: 5rem;
    font-weight: 800;
    letter-spacing: -2px;
    text-shadow: 2px 4px 10px rgba(0, 0, 0, 0.3);
}

.title-sub {
    font-size: 2rem;
    font-weight: 300;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.badge-item i {
    font-size: 2rem;
    color: var(--secondary);
}

.badge-item span {
    font-size: 0.9rem;
    font-weight: 500;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    color: var(--primary);
    padding: 1rem 2.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

/* ========================================
   STATS SECTION
   ======================================== */

.stats-section {
    padding: 4rem 0;
    background: var(--light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--gray);
    font-weight: 500;
}

/* ========================================
   MOTIVATION SECTION
   ======================================== */

.motivation-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.motivation-card {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
}

.motivation-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.motivation-text {
    font-size: 1.5rem;
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.motivation-author {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 500;
}

/* ========================================
   AI TIP SECTION
   ======================================== */

.ai-tip-section {
    position: relative;
    padding: 5rem 0;
    overflow: hidden;
}

.parallax-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI2MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJhIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6IzJDNUYyRCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzFhM2ExYiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjYikiLz48L3N2Zz4=');
    opacity: 0.1;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.section-header h2 i {
    margin-right: 0.5rem;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--gray);
}

.ai-tip-card {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 8px 40px var(--shadow);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.ai-tip-content {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    color: var(--gray);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--secondary);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* ========================================
   RECIPES SECTION
   ======================================== */

.recipes-section {
    padding: 5rem 0;
    background: var(--white);
}

.recipe-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.recipe-search {
    flex-grow: 1;
    max-width: 300px;
}

.recipe-search input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.recipe-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(44, 95, 45, 0.1);
}

.recipe-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0; /* Fjernet margin-bottom for å passe i flexbox */
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.2);
}

.servings-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.servings-buttons {
    display: flex;
    gap: 0.5rem;
}

.serving-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray);
    background: transparent;
    color: var(--gray);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.serving-btn.active,
.serving-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.recipe-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.recipe-card:hover {
    transform: translateY(-5px);
}

.recipe-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.recipe-card-content {
    padding: 1.5rem;
}

.recipe-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.recipe-card p {
    color: var(--gray);
    line-height: 1.5;
}

/* ========================================
   RECIPE ARCHIVE PAGE
   ======================================== */

.recipe-archive-page {
    background-color: #f8f9fa;
    padding: 4rem 0;
}

.recipe-archive-header {
    text-align: center;
    margin-bottom: 3rem;
}

.recipe-archive-header h1 {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.recipe-archive-header p {
    font-size: 1.2rem;
    color: var(--gray);
}

.recipe-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.recipe-search {
    flex-grow: 1;
    max-width: 300px;
}

.recipe-search input {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.recipe-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(44, 95, 45, 0.1);
}

.recipe-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0; /* Fjernet margin-bottom for å passe i flexbox */
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(44, 95, 45, 0.2);
}

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.recipe-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.recipe-card-image {
    height: 220px;
    background-size: cover;
    background-position: center;
}

.recipe-card-image.placeholder-image {
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ced4da;
    font-size: 2rem;
}
.recipe-card-image.placeholder-image::before {
    content: '🍳'; /* Placeholder emoji */
}

.recipe-card-content {
    padding: 1.5rem;
}

.recipe-card-title {
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.recipe-card-excerpt {
    color: var(--gray);
    line-height: 1.6;
}

.recipe-loader {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s ease infinite;
    margin: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   PROGRESS SECTION
   ======================================== */

.progress-section {
    padding: 5rem 0;
    background: var(--light);
}

.progress-grid {
    display: grid;
    /* Endret for å sentrere innholdet */
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
}

.quick-log-card h3,
.chart-card h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Fiks for Chart.js: Gi containeren en definert høyde */
.chart-card {
    position: relative;
    height: 450px; /* Gir en fast høyde for grafen */
    width: 100%;
    max-width: 800px; /* Begrenser bredden på større skjermer */
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.progress-stories-section {
    margin-top: 3rem;
}

.stories-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.stories-header h3 {
    color: var(--primary);
    font-size: 1.8rem;
}

.progress-timeline {
    position: relative;
}

/* ========================================
   AI COACH SECTION
   ======================================== */

.ai-coach-section {
    position: relative;
    padding: 5rem 0;
    overflow: hidden;
}

.ai-coach-section .parallax-bg {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTkyMCIgaGVpZ2h0PSI4MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3R5bGU9InN0b3AtY29sb3I6IzFhM2ExYiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6IzJDNUYyRCIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjYikiLz48L3N2Zz4=');
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.chat-messages {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 40px var(--shadow);
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 2rem;
}

.chat-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
}

.message-content p {
    margin: 0;
    line-height: 1.5;
}

.ai-message .message-avatar {
    background: var(--secondary);
}

.chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

#clear-chat-history {
    padding: 12px 16px;
    min-width: 50px;
}

#clear-chat-history i {
    font-size: 1.1rem;
}

/* Thinking animation */
.chat-message.thinking .message-content {
    opacity: 0.8;
}

.thinking-animation {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.thinking-animation span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    animation: thinking-bounce 1.4s infinite ease-in-out both;
}

.thinking-animation span:nth-child(1) {
    animation-delay: -0.32s;
}

.thinking-animation span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes thinking-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.thinking-text {
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

/* Fade in animation for messages */
.chat-message.fade-in {
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improved message styling */
.message-content strong {
    font-weight: 600;
    color: var(--primary);
}

.message-content em {
    font-style: italic;
    color: #555;
}

.user-message .message-avatar {
    background: var(--accent);
}

.user-message .message-content {
    background: #f5f5f5;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border-top-right-radius: 4px;
}

.ai-message .message-content {
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--primary);
    color: var(--white);
    padding: 4rem 0 2rem 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto 2rem auto;
}

.footer-section {
    flex: 1 1 250px;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1200px;
    margin: 0 auto;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 4px 20px var(--shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-menu.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .burger {
        display: flex;
    }

    .hero-title .title-main {
        font-size: 3rem;
    }

    .hero-title .title-sub {
        font-size: 1.5rem;
    }

    .hero-badges {
        gap: 1rem;
    }

    .badge-item {
        min-width: 100px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .progress-grid {
        grid-template-columns: 1fr;
    }

    .recipes-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-content {
        padding: 1rem;
    }

    .title-main {
        font-size: 2.5rem;
    }

    .title-sub {
        font-size: 1.2rem;
    }

    .hero-badges {
        flex-direction: column;
        align-items: center;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .ai-tip-card {
        padding: 2rem 1rem;
    }
}

/* ========================================
   WEEKLY MENU STYLES
   ======================================== */

.ai-meal-plan-section {
    margin-top: 3rem;
}

.ai-meal-plan-section h3 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.weekly-menu-container {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
    margin: 2rem 0;
}

.weekly-menu-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.weekly-menu-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.menu-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

.weekly-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 2rem;
}

.day-card {
    background: var(--light);
    border-radius: 12px;
    border: 2px solid var(--primary);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.day-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.day-header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem;
    text-align: center;
}

.day-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.day-meals {
    padding: 1rem;
}

.meal-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--white);
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.meal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    border-left-color: var(--primary);
}

.meal-item:last-child {
    margin-bottom: 0;
}

.meal-type {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meal-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.meal-meta {
    color: var(--primary-dark);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.meal-meta .nutrition-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--light);
    border: 1px solid rgba(44,95,45,0.12);
    color: var(--dark);
    padding: 6px 12px;
    margin-right: 8px;
    margin-bottom: 8px;
    border-radius: 16px;
    font-size: 0.85rem;
}

.meal-meta .nutrition-badge strong {
    font-weight: 600;
    margin-right: 4px;
}

.modal .meal-meta .nutrition-badge { 
    display: inline-flex;
    margin-bottom: 10px;
    padding: 8px 14px;
    font-size: 0.95rem;
}

.meal-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ingredient {
    background: var(--light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--dark);
    border: 1px solid rgba(44, 95, 45, 0.1);
}

.ingredient small {
    color: var(--primary);
    font-weight: 500;
}

.more-ingredients {
    background: var(--light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gray);
    border: 1px solid rgba(44, 95, 45, 0.1);
}

.meal-description {
    color: var(--dark);
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-line;
}

.meal-description strong {
    color: var(--primary-dark);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .hero-badges {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
        overflow-x: auto;
        justify-content: center;
        align-items: center;
        width: 100vw;
        padding-left: 24px;
        padding-right: 24px;
        margin-right: 0;
        box-sizing: border-box;
        white-space: nowrap;
        scrollbar-width: thin;
    }
    .badge-item {
        flex: 0 0 80px;
        min-width: 80px;
        max-width: 80px;
        width: 80px;
        padding: 0.3rem;
        font-size: 0.8rem;
        box-sizing: border-box;
        text-align: center;
    }
    .badge-item i, .badge-item svg {
        font-size: 1.2rem !important;
        width: 24px !important;
        height: 24px !important;
    }
    .hero-title {
        width: 100vw;
        max-width: 100vw;
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
        overflow-x: auto;
        white-space: normal;
        text-align: center;
    }
}
@media (max-width: 600px) {
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 40px;
        height: 40px;
        background: none;
        border: none;
        position: absolute;
        right: 1rem;
        top: 1rem;
        z-index: 1100;
    }
    .hamburger span {
        display: block;
        width: 28px;
        height: 4px;
        margin: 4px 0;
        background: var(--primary);
        border-radius: 2px;
        transition: all 0.3s;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        box-shadow: 0 2px 20px var(--shadow);
        padding: 1rem 0;
    }
    .nav-menu.open {
        display: flex;
    }
    .nav-link {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-bottom: 1px solid #eee;
    }
    .logo {
        font-size: 1.1rem;
    }
}
@media (max-width: 600px) {
    .hamburger {
        display: block;
        cursor: pointer;
        z-index: 1100;
    }
    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        box-shadow: 0 2px 20px var(--shadow);
        padding: 1rem 0;
    }
    .nav-menu.open {
        display: flex;
    }
    .nav-link {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-bottom: 1px solid #eee;
    }
    .logo {
        font-size: 1.1rem;
    }
}
@media (max-width: 600px) {
    .hero-badges {
        flex-wrap: nowrap;
        gap: 0.5rem;
        overflow-x: auto;
        justify-content: flex-start;
    }
    .badge-item {
        min-width: 100px;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    .hero-title {
        font-size: 2rem;
        margin-top: 3.5rem;
        text-align: center;
    }
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }
    .hero-content {
        padding-top: 3.5rem;
    }
}
@media (max-width: 768px) {
    .weekly-menu-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .weekly-menu-header {
        padding: 1.5rem 1rem;
    }

    .weekly-menu-header h2 {
        font-size: 1.5rem;
    }

    .day-card {
        margin-bottom: 1rem;
    }

    .meal-ingredients {
        flex-direction: column;
        gap: 0.25rem;
    }

    .ingredient {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* ========================================
   NO DATA MESSAGE
   ======================================== */

.no-data-message {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px var(--shadow);
    border: 2px solid var(--primary);
    margin: 2rem 0;
}

.no-data-message p {
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.no-data-message strong {
    color: var(--primary);
    font-weight: 600;
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s ease-out forwards;
}

.fade-in-delay {
    animation-delay: 0.3s;
}

.fade-in-delay-2 {
    animation-delay: 0.6s;
}

.fade-in-delay-3 {
    animation-delay: 0.9s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   MODAL STYLES
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px var(--shadow-dark);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--gray);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--primary);
}

#modal-content {
    padding: 2rem;
}

.modal-meal-details h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.meal-meta {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.meal-ingredients-list h4,
.meal-instructions h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.meal-ingredients-list ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.meal-ingredients-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-ingredients-list li:last-child {
    border-bottom: none;
}

.meal-instructions p {
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
}

/* ========================================
   WEEKLY WORKOUT SECTION
   ======================================== */

.weekly-workout-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--forest) 100%);
    padding: 4rem 0;
    color: var(--white);
}

.weekly-workout-container {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px var(--shadow);
    overflow: hidden;
    margin: 2rem 0;
}

.weekly-workout-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.weekly-workout-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.workout-date {
    font-size: 0.9rem;
    opacity: 0.9;
}

.weekly-workout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 2rem;
}

.workout-day-card {
    background: var(--light);
    border-radius: 12px;
    border: 2px solid var(--primary);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ensure text inside the workout cards is readable (override section-wide white color) */
.workout-day-card {
    color: var(--dark);
}

.workout-preview {
    color: var(--dark);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-top: 0.5rem;
    white-space: pre-line;
}

.workout-day-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.day-header {
    background: var(--primary);
    color: var(--white);
    padding: 1rem;
    text-align: center;
}

.day-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.weather-info .weather-icon {
    font-size: 1.2rem;
}

.weather-info .weather-temp {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.day-workouts {
    padding: 1rem;
}

.workout-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--white);
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.workout-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    border-left-color: var(--primary);
}

.workout-item:last-child {
    margin-bottom: 0;
}

.workout-type {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workout-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.workout-meta {
    color: var(--primary-dark);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.workout-description {
    color: var(--dark);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Responsive adjustments for workout section */
@media (max-width: 768px) {
    .weekly-workout-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .weekly-workout-header {
        padding: 1.5rem 1rem;
    }

    .weekly-workout-header h2 {
        font-size: 1.5rem;
    }

    .workout-day-card {
        margin-bottom: 1rem;
    }
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }

    #modal-content {
        padding: 1.5rem;
    }

    .modal-meal-details h2 {
        font-size: 1.5rem;
    }
}

/* ========================================
   WEATHER ICONS AND WORKOUT MODAL
   ======================================== */

.day-weather {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.weather-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.weather-temp {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
}

#workout-modal-content {
    padding: 2rem;
}

.modal-workout-details h2 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.workout-meta {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.workout-description-full {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.workout-description-full p {
    color: var(--dark);
    margin-bottom: 1rem;
}

.workout-steps h4,
.workout-tips h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.workout-steps ol,
.workout-tips ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.workout-steps li,
.workout-tips li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: var(--dark);
}

/* New workout modal styles */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.8rem;
}

.modal-weather {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-weather .weather-icon {
    font-size: 1.5rem;
}

.modal-weather .workout-type {
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
}

.workout-exercises {
    margin-top: 2rem;
}

.workout-exercises h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.exercise-item {
    background: var(--light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--secondary);
    transition: all 0.3s ease;
}

.exercise-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
    border-left-color: var(--primary);
}

.exercise-item:last-child {
    margin-bottom: 0;
}

.exercise-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.exercise-meta {
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.exercise-description {
    margin-bottom: 1rem;
}

.exercise-description p {
    color: var(--dark);
    line-height: 1.5;
    margin: 0;
}

.exercise-steps h5,
.exercise-tips h5 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.exercise-steps ol,
.exercise-tips ul {
    padding-left: 1.5rem;
    margin: 0;
}

.exercise-steps li,
.exercise-tips li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    color: var(--dark);
    font-size: 0.9rem;
}
/* Meal Edit Modal */
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary { background: #2C5F2D; color: white; padding: 12px 24px; border: none; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: 500; transition: all 0.3s ease; }
.btn-primary:hover { background: #1e4220; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3); }
#edit-meal-section { background: #f8f9fa; padding: 20px; border-radius: 8px; margin-top: 20px; }
.recipe-result-item { padding: 15px; background: white; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }
.recipe-result-item:hover { border-color: #2C5F2D; box-shadow: 0 2px 8px rgba(44, 95, 45, 0.15); transform: translateY(-2px); }
.recipe-result-item h4 { margin: 0 0 8px 0; color: #2C5F2D; font-size: 1.1rem; }
.use-recipe-btn { margin-top: 10px; background: #4CAF50; color: white; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; transition: background 0.2s ease; }
.use-recipe-btn:hover { background: #45a049; }
