/* ===================================
   MealPro Landing Page Styles
   Modern, dark theme inspired by xbow.com
   =================================== */

/* Root Variables */
:root {
    --bg-primary: #0f1117;
    --bg-panel: #151823;
    --border-color: #202537;
    --text-primary: #eaeef6;
    --text-muted: #a5b0c2;
    --brand-green: #6dd3a6;
    --brand-blue: #7cc2ff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===================================
   Animated Grid Background
   =================================== */
.grid-background {
    background-image:
        linear-gradient(to right, rgba(32, 37, 55, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(32, 37, 55, 0.3) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 60px 60px;
    }
}

/* ===================================
   Text Gradient Effect
   =================================== */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: textShine 3s ease-in-out infinite;
}

@keyframes textShine {
    0%, 100% {
        background-position: 0% center;
    }
    50% {
        background-position: 100% center;
    }
}

/* ===================================
   Navbar Styles
   =================================== */
.navbar-scrolled {
    background: rgba(15, 17, 23, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Feature Cards
   =================================== */
.feature-card {
    position: relative;
    padding: 2rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

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

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    padding: 1px;
    background: linear-gradient(135deg, var(--brand-green), var(--brand-blue));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    transform: translateY(-8px);
    background: rgba(21, 24, 35, 0.8);
    box-shadow: 0 20px 40px rgba(109, 211, 166, 0.1);
}

/* Stagger animation for feature cards */
.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

/* ===================================
   Fade In Up Animation
   =================================== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Button Hover Effects
   =================================== */
a[class*="bg-brand-green"] {
    position: relative;
    overflow: hidden;
}

a[class*="bg-brand-green"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

a[class*="bg-brand-green"]:hover::before {
    width: 300px;
    height: 300px;
}

/* ===================================
   Custom Scrollbar
   =================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-green);
}

/* ===================================
   Pulse Animation
   =================================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===================================
   Bounce Animation
   =================================== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    50% {
        transform: translateY(-10px) translateX(-50%);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* ===================================
   Glow Effects
   =================================== */
.glow-green {
    box-shadow: 0 0 20px rgba(109, 211, 166, 0.5);
}

.glow-blue {
    box-shadow: 0 0 20px rgba(124, 194, 255, 0.5);
}

/* ===================================
   Gradient Border Animation
   =================================== */
@keyframes borderGlow {
    0%, 100% {
        border-color: var(--border-color);
    }
    50% {
        border-color: var(--brand-green);
    }
}

/* ===================================
   Responsive Grid Patterns
   =================================== */
@media (max-width: 768px) {
    .grid-background {
        background-size: 40px 40px;
    }
}

/* ===================================
   Section Dividers
   =================================== */
section {
    position: relative;
}

section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--brand-green), transparent);
    opacity: 0.3;
}

section:last-of-type::after {
    display: none;
}

/* ===================================
   Card Shimmer Effect
   =================================== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        to right,
        var(--bg-panel) 0%,
        rgba(109, 211, 166, 0.05) 50%,
        var(--bg-panel) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 3s infinite;
}

/* ===================================
   Focus States for Accessibility
   =================================== */
a:focus,
button:focus {
    outline: 2px solid var(--brand-green);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* ===================================
   Typography Enhancements
   =================================== */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p {
    line-height: 1.7;
}

/* ===================================
   Mobile Menu Animation
   =================================== */
#mobile-menu {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Loading States
   =================================== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(109, 211, 166, 0.1),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* ===================================
   Stats Counter Animation
   =================================== */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Glass Morphism Effect
   =================================== */
.glass {
    background: rgba(21, 24, 35, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ===================================
   Hover Lift Effect
   =================================== */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

/* ===================================
   Gradient Overlays
   =================================== */
.gradient-overlay {
    position: relative;
}

.gradient-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(109, 211, 166, 0.1),
        rgba(124, 194, 255, 0.1)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-overlay:hover::before {
    opacity: 1;
}

/* ===================================
   Icon Animations
   =================================== */
svg {
    transition: transform 0.3s ease;
}

a:hover svg,
button:hover svg {
    transform: translateX(3px);
}

.feature-card:hover svg {
    transform: scale(1.1) rotate(5deg);
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .grid-background,
    nav,
    footer,
    .animate-pulse,
    .animate-bounce {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}

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

    .grid-background {
        animation: none;
    }
}

/* ===================================
   High Contrast Mode
   =================================== */
@media (prefers-contrast: high) {
    .text-muted {
        color: #d0d0d0;
    }

    .border-color {
        border-color: #404040;
    }
}

/* ===================================
   Dark Mode Enhancements
   =================================== */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but ensure consistency */
    body {
        color-scheme: dark;
    }
}

/* ===================================
   Selection Styling
   =================================== */
::selection {
    background: rgba(109, 211, 166, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(109, 211, 166, 0.3);
    color: var(--text-primary);
}

/* ===================================
   Link Underline Animation
   =================================== */
nav a {
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, var(--brand-green), var(--brand-blue));
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* ===================================
   Badge Styles
   =================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
}

/* ===================================
   Card Stack Effect
   =================================== */
.card-stack {
    position: relative;
}

.card-stack::before,
.card-stack::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: inherit;
    z-index: -1;
}

.card-stack::before {
    transform: translateY(4px) scale(0.98);
    opacity: 0.5;
}

.card-stack::after {
    transform: translateY(8px) scale(0.96);
    opacity: 0.25;
}

/* ===================================
   Skeleton Loading
   =================================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-panel) 25%,
        rgba(109, 211, 166, 0.05) 50%,
        var(--bg-panel) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   Tooltip Styles
   =================================== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 0.75rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ===================================
   Performance Optimizations
   =================================== */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* Use GPU acceleration for animations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}
