/* Modern CSS Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Import Enhanced Theme System */
@import url('css/theme.css');

/* Base Styles */
body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    scroll-behavior: smooth;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1rem 0;
}

@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(17, 24, 39, 0.95);
    }
}

.navbar .nav-brand:hover .brand-text {
    color: var(--brand-primary);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.brand-logo-footer {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.brand-icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 8rem 0 6rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

@media (prefers-color-scheme: dark) {
    .hero {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 2rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--brand-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Phone Mockup */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    position: relative;
    width: 280px;
    height: 500px;
    background: #1f2937;
    border-radius: 40px;
    padding: 12px;
    box-shadow: var(--shadow-xl);
    transform: perspective(1000px) rotateY(-15deg) rotateX(5deg);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.app-preview {
    padding: 2rem 1.5rem;
    color: white;
    height: 100%;
}

.preview-header {
    text-align: center;
    margin-bottom: 2rem;
}

.preview-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.preview-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
}

.preview-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meal-card {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.meal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meal-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.meal-calories {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: var(--background);
}

.features-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.section-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: var(--transition-slow);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3rem;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.1), rgba(34, 197, 94, 0.1));
    border-radius: var(--radius-2xl);
    position: relative;
    animation: float 3s ease-in-out infinite;
}

/* Ensure emoji display properly */
.feature-icon::before {
    content: none; /* Remove the background overlay */
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.feature-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Download Section */
.download {
    padding: 6rem 0;
    background: var(--surface);
}

.download-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.download-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.store-button {
    display: inline-block;
    text-decoration: none;
    transition: var(--transition);
    border-radius: 8px;
    overflow: hidden;
}

.store-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.store-button img {
    height: 54px;
    width: auto;
    transition: var(--transition);
}

.store-button:hover img {
    filter: brightness(1.1);
}

.download-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: #111827;
    color: #ffffff;
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .phone-mockup {
        transform: scale(0.8);
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .download-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 6rem 0 4rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .features,
    .download {
        padding: 4rem 0;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
.btn:focus-visible,
.nav-link:focus-visible,
.store-button:focus-visible,
.footer-link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Enhanced contrast and accessibility improvements */

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border: #000000;
        --text-secondary: var(--text-primary);
        --brand-primary: #CC7A00; /* Darker orange for better contrast */
        --text-light: var(--text-secondary);
    }
    
    .btn-primary {
        background: #CC7A00;
        color: #ffffff;
    }
    
    .nav-link:hover {
        background: rgba(204, 122, 0, 0.1);
    }
}

/* Improved contrast for key elements */
.btn-primary {
    background: #E6860C; /* Slightly darker orange for better contrast */
    color: #ffffff;
}

.btn-primary:hover {
    background: #CC7A00; /* Even darker on hover */
    color: #ffffff;
}

/* Ensure sufficient contrast for secondary text */
.hero-description {
    color: #4B5563; /* Darker gray for better contrast */
}

/* Better contrast for navigation links */
.nav-link {
    color: #4B5563; /* Darker gray for better readability */
}

.nav-link:hover {
    color: var(--brand-primary);
}

/* Improved text contrast on cards */
.feature-description {
    color: #4B5563; /* Better contrast than the lighter gray */
}

/* Better contrast for download section text */
.section-description {
    color: #4B5563;
}

/* Enhanced focus indicators */
.btn:focus-visible,
.nav-link:focus-visible,
.store-button:focus-visible,
.footer-link:focus-visible {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.2);
}

/* Dark mode improvements */
@media (prefers-color-scheme: dark) {
    .hero-description {
        color: #D1D5DB; /* Better contrast in dark mode */
    }
    
    .nav-link {
        color: #D1D5DB;
    }
    
    .feature-description {
        color: #D1D5DB;
    }
    
    .section-description {
        color: #D1D5DB;
    }
}

/* Video Modal Styles */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.video-modal.show {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    background: var(--background);
    border-radius: var(--border-radius-lg);
    max-width: 800px;
    width: 90%;
    max-height: 90%;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.video-modal.show .video-modal-content {
    transform: scale(1);
}

.video-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
}

.video-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.video-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.video-modal-close:hover {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.video-container {
    padding: 2rem;
}

.demo-placeholder {
    text-align: center;
    padding: 3rem 2rem;
}

.demo-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.demo-placeholder h4 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.demo-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.demo-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 300px;
    margin: 0 auto;
}

.demo-feature {
    color: var(--accent-color);
    font-weight: 500;
}

/* App Notification Styles */
.app-notification {
    position: fixed;
    top: 100px;
    right: 2rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    max-width: 350px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-content {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-text strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.notification-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.notification-close:hover {
    background: var(--secondary-color);
    color: var(--text-secondary);
}

/* Form Success Message */
.form-success {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.success-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.success-icon {
    font-size: 1.25rem;
}

/* Feature Card Animations */
.feature-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.feature-card.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Navbar Scrolled State */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
    .navbar.scrolled {
        background: rgba(17, 24, 39, 0.98);
    }
}

/* Mobile responsiveness for modals */
@media (max-width: 768px) {
    .video-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .video-modal-header {
        padding: 1rem 1.5rem;
    }
    
    .video-container {
        padding: 1.5rem;
    }
    
    .demo-placeholder {
        padding: 2rem 1rem;
    }
    
    .app-notification {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .demo-features {
        text-align: left;
    }
}

/* Custom navbar improvements */
/* Override DaisyUI btn-ghost hover effects with rounded corners */
.navbar .btn.btn-ghost:hover {
    background: rgba(255, 149, 0, 0.1) !important;
    border-radius: 0.5rem !important;
    transform: none !important;
}

/* Center the logo and brand text vertically */
.navbar .btn.btn-ghost {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    height: auto !important;
    min-height: 2.5rem !important;
}

/* Ensure proper alignment for mobile menu items too */
.navbar .menu li a.btn.btn-ghost:hover {
    background: rgba(255, 149, 0, 0.1) !important;
    border-radius: 0.5rem !important;
}