/* Hill Calories AI - Styles */

/* CSS Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Modern Professional Color Palette */
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --accent-secondary: #10b981;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #dc2626;
    --info-color: #0ea5e9;
    --background: linear-gradient(135deg, #0f0f23 0%, #1e1b4b 30%, #312e81 70%, #4c1d95 100%);
    --background-alt: #ffffff;
    --surface: rgba(255, 255, 255, 0.95);
    --surface-elevated: rgba(255, 255, 255, 0.98);
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --text-light: rgba(255, 255, 255, 0.95);
    --border: rgba(255, 255, 255, 0.15);
    --border-light: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.15);
    --shadow-colored: rgba(99, 102, 241, 0.3);
    
    /* Modern Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #06b6d4 0%, #10b981 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);
    --gradient-hero: linear-gradient(135deg, #0f0f23 0%, #1e1b4b 25%, #312e81 50%, #4c1d95 75%, #6366f1 100%);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;

    /* Borders */
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-full: 50%;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Modern Enhancement Variables */
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    --card-shadow-hover: 0 25px 80px rgba(99, 102, 241, 0.2);
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    font-family: var(--font-family);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: #ffffff;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    position: relative;
    overflow-x: hidden;
    padding-top: 80px; /* Account for fixed header */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.08) 0%, transparent 25%),
                radial-gradient(circle at 75% 75%, rgba(16, 185, 129, 0.06) 0%, transparent 25%),
                radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

/* Fixed Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    display: block;
    visibility: visible;
    transition: all 0.3s ease;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-4) 0;
}

.logo h1 {
    font-size: var(--font-size-xl);
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-6);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    letter-spacing: 0.025em;
    transition: all 0.3s ease;
    position: relative;
    padding: var(--spacing-2) var(--spacing-4);
    border-radius: 8px;
}

.auth-buttons {
    display: flex;
    gap: var(--spacing-3);
    margin-left: var(--spacing-4);
}

.btn-login {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-signup {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-login:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

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

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

/* Main Content Area */
.main-content {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero {
    padding: var(--spacing-12) 0 calc(var(--spacing-12) * 1.5);
    background: linear-gradient(135deg, 
        #ffffff 0%, 
        #fafafa 25%,
        #f5f5f5 50%,
        #f0f0f0 75%,
        #eeeeee 100%);
    position: relative;
    overflow: hidden;
    flex: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 60%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
        url('data:image/svg+xml,<svg width="80" height="80" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="heroGrid" width="80" height="80" patternUnits="userSpaceOnUse"><path d="M 80 0 L 0 0 0 80" fill="none" stroke="rgba(0,0,0,0.02)" stroke-width="1"/><circle cx="40" cy="40" r="1" fill="rgba(0,0,0,0.03)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23heroGrid)" /></svg>');
    z-index: 1;
    animation: heroGlow 20s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.02) 25%, 
        transparent 50%, 
        rgba(16, 185, 129, 0.03) 75%, 
        transparent 100%);
    z-index: 1;
    pointer-events: none;
}

@keyframes heroGlow {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.02);
    }
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--spacing-6);
    color: #FFF8F0;
    text-shadow: 0 4px 20px rgba(255, 140, 70, 0.3);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-12);
    font-weight: 400;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Upload Section */
.upload-section {
    margin-bottom: var(--spacing-8);
}

.upload-area {
    border: 3px dashed rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: var(--spacing-12);
    margin-bottom: var(--spacing-6);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-image: linear-gradient(45deg, rgba(255, 255, 255, 0.4), rgba(99, 102, 241, 0.3)) 1;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.upload-area:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border-image: linear-gradient(45deg, rgba(255, 255, 255, 0.6), rgba(99, 102, 241, 0.5)) 1;
}

.upload-area:hover::before {
    left: 100%;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1) translateY(-5px);
    color: rgba(255, 255, 255, 0.95);
}

.upload-area.dragover {
    border-color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.03);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    border-image: linear-gradient(45deg, rgba(255, 255, 255, 0.8), rgba(99, 102, 241, 0.7)) 1;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-4);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-2);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    animation: float 3s ease-in-out infinite;
}

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

.upload-placeholder h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.upload-placeholder p {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#imageInput {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.preview-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.upload-actions {
    display: flex;
    gap: var(--spacing-4);
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: var(--spacing-4) var(--spacing-8);
    border-radius: 16px;
    font-weight: 700;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    min-width: 180px;
    min-height: 52px;
    justify-content: center;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
    color: white;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #5b5fff, #9333ea, #0891b2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.btn-primary:disabled {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0.7;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Results Section */
.results-section {
    margin-top: var(--spacing-8);
    padding: var(--spacing-12);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.results-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.results-header {
    text-align: center;
    margin-bottom: var(--spacing-6);
}

.results-header h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--primary-color);
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-4);
    margin-bottom: var(--spacing-6);
}

.nutrition-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-8);
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.nutrition-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    z-index: -1;
}

.nutrition-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.nutrition-card.protein {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.8), rgba(245, 158, 11, 0.9));
    color: #92400e;
}

.nutrition-card.carbs {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(124, 58, 237, 0.9));
    color: #5b21b6;
}

.nutrition-card.fat {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8), rgba(220, 38, 38, 0.9));
    color: #991b1b;
}

.nutrition-icon {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-2);
}

.nutrition-info h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-1);
}

.nutrition-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.calories-summary {
    display: flex;
    justify-content: center;
}

.calories-card {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-8);
    border-radius: 20px;
    text-align: center;
    min-width: 240px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 45px rgba(99, 102, 241, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.calories-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.calories-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.4);
}

.calories-card h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-2);
    opacity: 0.9;
}

.calories-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
}

/* Blue styling for calories card */
.calories-card.calories-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
    color: white;
    box-shadow: 0 15px 45px rgba(37, 99, 235, 0.3);
}

.calories-card.calories-blue:hover {
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.4);
}

/* Food Items Display */
.food-items-container {
    margin-bottom: var(--spacing-8);
}

.food-items-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-6);
    text-align: center;
    color: var(--text-primary);
    position: relative;
}

.food-items-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.food-items-list {
    display: grid;
    gap: var(--spacing-4);
    max-height: 350px;
    overflow-y: auto;
    padding: var(--spacing-3);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.food-items-list::-webkit-scrollbar {
    width: 6px;
}

.food-items-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.food-items-list::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 3px;
}

.food-item {
    background: var(--gradient-card);
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 16px;
    padding: var(--spacing-6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.food-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.food-item:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.food-item:hover::before {
    transform: scaleY(1);
}

.food-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-3);
    gap: var(--spacing-3);
}

.food-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    line-height: 1.4;
    flex: 1;
}

.food-quantity {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-2) var(--spacing-3);
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    letter-spacing: 0.025em;
}

.food-item-nutrition {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-2);
}

.food-calories {
    font-weight: 700;
    color: var(--primary-color);
    font-size: var(--font-size-base);
}

.food-macros {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-weight: 500;
    font-size: var(--font-size-xs);
    background: rgba(99, 102, 241, 0.1);
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: 6px;
    color: var(--primary-color);
}

/* Error & Info Messages */
.error-message {
    padding: var(--spacing-4);
    border-radius: 12px;
    text-align: center;
    margin-top: var(--spacing-4);
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    
    /* Default error styling */
    background: #fee2e2;
    color: var(--error-color);
    border: 1px solid #fecaca;
}

/* Info message styling (applied via JavaScript) */
.error-message.info-style {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

/* Success message styling */
.error-message.success-style {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* Features Section */
.features {
    padding: calc(var(--spacing-16) * 1.5) 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
                      radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    z-index: 1;
}

.features .container {
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: var(--spacing-16);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-12);
}

.feature-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--spacing-12);
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

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

.feature-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-6);
    display: inline-block;
    padding: var(--spacing-4);
    background: var(--gradient-primary);
    border-radius: 50%;
    color: white;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.feature-card h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-4);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: var(--font-size-base);
    font-weight: 400;
}

/* How it Works Section */
.how-it-works {
    padding: var(--spacing-16) 0;
    background: linear-gradient(135deg, 
        #f8fafc 0%, 
        #f1f5f9 25%, 
        #e2e8f0 50%, 
        #cbd5e1 75%, 
        #94a3b8 100%);
    position: relative;
    overflow: hidden;
}

.how-it-works::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="60" height="60" patternUnits="userSpaceOnUse"><path d="M 60 0 L 0 0 0 60" fill="none" stroke="rgba(99,102,241,0.08)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)" /></svg>');
    pointer-events: none;
    z-index: 1;
}

.how-it-works .container {
    position: relative;
    z-index: 2;
}

.how-it-works .section-title {
    color: #1f2937;
    text-shadow: none;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-8);
    margin-top: var(--spacing-12);
}

.step {
    text-align: center;
    position: relative;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    transition: all 0.4s ease;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
    z-index: 0;
}

.step:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(255, 255, 255, 1);
}

.step-number {
    width: 80px;
    height: 80px;
    background: var(--gradient-secondary);
    color: white;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    font-weight: 800;
    margin: 0 auto var(--spacing-6);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    position: relative;
    z-index: 1;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.step h3 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-4);
    color: #1f2937;
    position: relative;
    z-index: 1;
}

.step p {
    color: #4b5563;
    line-height: 1.7;
    font-size: var(--font-size-base);
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #cbd5e1 100%);
    color: #374151;
    padding: var(--spacing-12) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-top: 2px solid rgba(99, 102, 241, 0.1);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><g fill="%236366f1" fill-opacity="0.03"><rect width="40" height="40"/><rect x="20" width="20" height="20"/><rect y="20" width="20" height="20"/></g></svg>');
    z-index: 1;
}

.footer .container {
    position: relative;
    z-index: 2;
}

.footer p {
    font-weight: 500;
    opacity: 0.8;
    letter-spacing: 0.025em;
    color: #4b5563;
}

/* Loading States */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
}

.btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-4);
        max-width: 100%;
    }
    
    .hero {
        padding: var(--spacing-12) 0 calc(var(--spacing-12) * 1.2);
        background: linear-gradient(135deg, #667eea 0%, #764ba2 70%, #f093fb 100%);
    }
    
    .hero-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
        margin-bottom: var(--spacing-4);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.25rem);
        margin-bottom: var(--spacing-8);
    }
    
    .upload-area {
        padding: var(--spacing-8);
        margin-bottom: var(--spacing-6);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(20px);
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    }
    
    .upload-icon {
        font-size: 2rem;
        background: linear-gradient(135deg, #fff, #f8fafc);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .upload-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-4);
    }
    
    .btn {
        width: 100%;
        max-width: 320px;
        padding: var(--spacing-4) var(--spacing-6);
        min-height: 56px;
        border-radius: 16px;
        font-size: clamp(0.9rem, 2.5vw, 1rem);
        box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
    }
    
    .btn:hover {
        transform: translateY(-3px) scale(1.02);
        box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
    }
    
    .nav-links {
        display: none;
    }
    
    .features, .how-it-works {
        padding: var(--spacing-12) 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-6);
    }
    
    .nutrition-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-4);
    }
    
    .results-section {
        padding: var(--spacing-8);
        margin-top: var(--spacing-6);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(25px);
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.12);
    }
    
    .food-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2);
    }
    
    .food-item-nutrition {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-2);
    }
    
    .calories-card {
        min-width: 200px;
        background: linear-gradient(135deg, #006400, #013220) !important;
        border-radius: 16px;
        border: 2px solid #32cd32;
        color: #32cd32 !important;
        box-shadow: 0 8px 32px rgba(0, 100, 0, 0.3);
    }
    
    .calories-card h4 {
        color: #32cd32 !important;
        text-shadow: 0 0 10px rgba(50, 205, 50, 0.3);
    }
    
    .calories-value {
        color: #32cd32 !important;
        text-shadow: 0 0 15px rgba(50, 205, 50, 0.4);
        font-weight: 700;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-3);
    }
    
    .hero {
        padding: var(--spacing-8) 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 60%, #f093fb 100%);
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        line-height: 1.15;
        margin-bottom: var(--spacing-3);
    }
    
    .hero-subtitle {
        font-size: clamp(0.9rem, 4vw, 1.1rem);
        margin-bottom: var(--spacing-6);
        line-height: 1.5;
    }
    
    .upload-placeholder h3 {
        font-size: clamp(1.1rem, 4vw, 1.3rem);
        margin-bottom: var(--spacing-2);
    }
    
    .upload-placeholder p {
        font-size: clamp(0.85rem, 3vw, 1rem);
        line-height: 1.4;
    }
    
    .upload-area {
        padding: var(--spacing-6);
        border-radius: 18px;
        min-height: 200px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .upload-icon {
        font-size: 2.5rem;
        margin-bottom: var(--spacing-3);
    }
    
    .feature-card {
        padding: var(--spacing-6);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .results-section {
        padding: var(--spacing-6);
        border-radius: 18px;
        margin-top: var(--spacing-4);
    }
    
    .nutrition-card {
        padding: var(--spacing-6);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    
    .nutrition-card:hover {
        transform: translateY(-4px) scale(1.01);
        background: rgba(255, 255, 255, 0.2);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    }
    
    .food-items-list {
        max-height: 250px;
        border-radius: 12px;
    }
    
    .btn {
        min-width: 160px;
        font-size: clamp(0.85rem, 2.5vw, 0.95rem);
        padding: var(--spacing-3) var(--spacing-4);
        min-height: 50px;
        border-radius: 14px;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, #6366f1, #8b5cf6, #06b6d4);
        box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
    }
    
    .btn-primary:hover {
        box-shadow: 0 10px 35px rgba(99, 102, 241, 0.5);
        transform: translateY(-2px) scale(1.01);
    }
}

/* Camera Modal Styles */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.camera-modal.active {
    opacity: 1;
    visibility: visible;
}

.camera-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90vw;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.camera-modal.active .camera-container {
    transform: scale(1);
}

.camera-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-4) var(--spacing-6);
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.camera-header h3 {
    color: white;
    font-size: var(--font-size-lg);
    font-weight: 700;
    margin: 0;
}

.camera-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: transform 0.2s ease;
}

.camera-close:hover {
    transform: scale(1.1);
}

.camera-preview {
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.camera-video {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: cover;
    border-radius: 0;
}

.camera-controls {
    display: flex;
    gap: var(--spacing-4);
    padding: var(--spacing-6);
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
}

.camera-capture-btn,
.camera-switch-btn {
    padding: var(--spacing-3) var(--spacing-6);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.camera-capture-btn {
    background: var(--gradient-primary);
    color: white;
    font-size: var(--font-size-base);
    min-width: 120px;
}

.camera-capture-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.camera-switch-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: var(--font-size-sm);
}

.camera-switch-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Mobile Camera Styles */
@media (max-width: 768px) {
    .camera-container {
        width: 95vw;
        max-height: 95vh;
    }
    
    .camera-header {
        padding: var(--spacing-3) var(--spacing-4);
    }
    
    .camera-header h3 {
        font-size: var(--font-size-base);
    }
    
    .camera-video {
        max-height: 50vh;
    }
    
    .camera-controls {
        padding: var(--spacing-4);
        flex-direction: column;
        align-items: center;
    }
    
    .camera-capture-btn,
    .camera-switch-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .camera-container {
        width: 98vw;
        border-radius: 12px;
    }
    
    .camera-header {
        padding: var(--spacing-2) var(--spacing-3);
    }
    
    .camera-close {
        font-size: 1.5rem;
    }
    
    .camera-video {
        max-height: 40vh;
    }
    
    .camera-controls {
        padding: var(--spacing-3);
        gap: var(--spacing-3);
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .camera-container {
        max-height: 95vh;
    }
    
    .camera-video {
        max-height: 30vh;
    }
    
    .camera-controls {
        flex-direction: row;
        padding: var(--spacing-2);
    }
}

/* Print Styles */
@media print {
    .header, .footer, .upload-section, .camera-modal {
        display: none;
    }
    
    .results-section {
        box-shadow: none;
        border: 1px solid var(--border);
    }
}

/* Additional Tablet Styles */
@media (min-width: 481px) and (max-width: 768px) {
    .hero {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 80%, #06b6d4 100%);
    }
    
    .hero-title {
        font-size: clamp(2.2rem, 5vw, 3rem);
    }
    
    .upload-area {
        background: rgba(255, 255, 255, 0.14);
        backdrop-filter: blur(25px);
        border-radius: 18px;
    }
    
    .btn {
        border-radius: 15px;
        min-width: 200px;
    }
    
    .nutrition-card {
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 16px;
    }
}

/* Professional Enhancement Styles */
.upload-area::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover::after {
    opacity: 1;
}

/* Enhanced Focus States for Accessibility */
.btn:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}

.upload-area:focus-within {
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Loading Animation Enhancement */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.8);
    }
}

.btn:disabled .loading-spinner {
    animation: pulse-glow 2s ease-in-out infinite;
}/* Welcome Notification & Auth Modal Styles */
.welcome-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    z-index: 10000;
    display: none;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideIn 0.5s ease-out;
}

.welcome-content {
    position: relative;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: wave 1s ease-in-out infinite;
}

.welcome-notification h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-notification p {
    color: #4a5568;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.welcome-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #2d3748;
    transform: scale(1.1);
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Auth Modal Styles */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

.auth-modal.show {
    display: flex;
    opacity: 1;
}

.auth-modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

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

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    padding-bottom: 1rem;
}

.auth-header h2 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #718096;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    transform: scale(1.1);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #2d3748;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    padding: 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
    color: #5a67d8;
}

.full-width {
    width: 100%;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
}

.auth-divider span {
    padding: 0 1rem;
    color: #718096;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-social {
    padding: 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: #2d3748;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-google:hover {
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: white;
    border-color: #4285f4;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(66, 133, 244, 0.3);
}

.btn-facebook:hover {
    background: linear-gradient(135deg, #1877f2, #42a5f5);
    color: white;
    border-color: #1877f2;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(24, 119, 242, 0.3);
}

.auth-switch {
    text-align: center;
    color: #4a5568;
    margin: 1.5rem 0 0;
    font-size: 0.9rem;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
    color: #5a67d8;
}

/* Modern Upload Section Styling */

/* Brand Header Styling */
.brand-header {
    margin-bottom: 2rem;
    text-align: center;
}

.brand-title {
    font-size: 4rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    line-height: 1;
}

.brand-gradient {
    background: linear-gradient(135deg, 
        #2563eb 0%, 
        #3b82f6 25%, 
        #1d4ed8 50%, 
        #1e40af 75%, 
        #1e3a8a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite;
}

/* Mobile-specific styling for better text visibility */
@media (max-width: 768px) {
    .brand-gradient {
        /* Blue color for mobile */
        color: #2563eb !important;
        background: none !important;
        -webkit-text-fill-color: #2563eb !important;
        text-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
        font-weight: 900; /* Bolder text for better visibility */
    }
    
    .brand-title {
        font-size: 2.8rem; /* Optimized mobile size */
        text-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); /* Green shadow for better readability */
        margin-bottom: 1rem;
    }
    
    .brand-subtitle {
        font-size: 1.1rem;
        color: #059669; /* Green subtitle on mobile */
        font-weight: 600;
    }
}

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

.brand-subtitle {
    font-size: 2rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.25rem;
    color: #4b5563;
    margin: 1rem 0 0.5rem 0;
    font-weight: 500;
    opacity: 0.9;
}

.hero-tagline {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0 0 3rem 0;
    opacity: 0.8;
}

/* Upload Container */
.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--card-shadow);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.upload-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
    z-index: 0;
}

.upload-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
}

.upload-zone {
    position: relative;
    z-index: 1;
}

.camera-icon {
    background: rgba(16, 185, 129, 0.15);
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border: 2px solid rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.camera-icon svg {
    color: var(--accent-secondary);
    filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.3));
}

.upload-placeholder {
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-placeholder:hover .camera-icon {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

/* Enhanced Upload Zone Styling */
.upload-zone {
    border: 2px dashed rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    background: rgba(16, 185, 129, 0.02);
    cursor: pointer;
    position: relative;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover {
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-2px);
}

.upload-zone:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.upload-zone.drag-over {
    border-color: var(--accent-secondary);
    background: rgba(16, 185, 129, 0.1);
    transform: scale(1.02);
}

.upload-actions {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-hint {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.upload-hint-mobile {
    display: none;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(59, 130, 246, 0.2);
}



.upload-placeholder h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.upload-placeholder p {
    color: #4b5563;
    font-size: 1rem;
    margin: 0 0 2rem 0;
    opacity: 0.8;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    position: relative;
    z-index: 1;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(99, 102, 241, 0.6);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: #4b5563;
    border: 2px solid rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    transform: translateY(-2px);
}

/* Mobile Responsive Auth Styles */
@media (max-width: 480px) {
    .welcome-notification {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .auth-modal-content {
        padding: 1.5rem;
        border-radius: 16px;
        margin: 1rem;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .form-group input {
        padding: 0.875rem;
    }
    
    .social-login {
        gap: 0.5rem;
    }
    
    .btn-social {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
}

/* Mobile Responsive Brand & Upload */
@media (max-width: 768px) {
    .brand-title {
        font-size: 2.5rem;
    }
    
    .brand-subtitle {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .hero-tagline {
        font-size: 1rem;
    }
    
    .upload-card {
        padding: 2rem;
        margin: 0 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .camera-icon {
        width: 80px;
        height: 80px;
    }
    
    .camera-icon svg {
        width: 60px;
        height: 60px;
    }
}

/* 🎨 PROFESSIONAL MOBILE REDESIGN - ATTRACTIVE & USER-FRIENDLY */
@media (max-width: 768px) {
    /* Ensure header is visible on mobile with proper spacing */
    .header {
        display: block !important;
        visibility: visible !important;
        position: fixed !important;
        top: 0 !important;
        z-index: 1001 !important;
        padding: 0.5rem 0; /* Add vertical padding to header */
        min-height: 60px; /* Ensure consistent height */
    }
    
    /* Beautiful sky-blue gradient background */
    body {
        background: linear-gradient(135deg, 
            #f0f9ff 0%, 
            #e0f2fe 25%, 
            #b3e5fc 50%, 
            #81d4fa 75%, 
            #4fc3f7 100%);
        min-height: 100vh;
        margin: 0;
        padding: 80px 0 0 0;
    }
    
    /* Green hero section with white text */
    .hero {
        background: linear-gradient(135deg, 
            #059669 0%, 
            #10b981 25%, 
            #34d399 50%, 
            #10b981 75%, 
            #047857 100%);
        border-radius: 0 0 2.5rem 2.5rem;
        box-shadow: 0 8px 32px rgba(5, 150, 105, 0.3);
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        padding: 2rem 1.5rem 3rem;
        margin-bottom: 1rem;
        color: white;
    }
    
    /* Blue Hill Calories text on green background */
    .brand-gradient {
        color: #2563eb !important;
        background: none !important;
        -webkit-text-fill-color: #2563eb !important;
        text-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
        font-weight: 800;
    }
    
    .brand-title {
        font-size: 2.3rem;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        margin-bottom: 0.5rem;
        letter-spacing: -0.02em;
        color: #2563eb !important; /* Blue color for mobile visibility */
        -webkit-text-fill-color: #2563eb !important;
        font-weight: 800;
    }
    
    .brand-subtitle {
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.9);
        font-weight: 500;
        margin-bottom: 1.5rem;
    }
    
    .hero-description {
        color: rgba(255, 255, 255, 0.85);
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 0.5rem;
    }
    
    .hero-tagline {
        color: rgba(255, 255, 255, 0.95);
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 2rem;
    }
    
    /* Modern upload card with glassmorphism */
    .upload-card {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.9) 0%, 
            rgba(248, 250, 252, 0.8) 100%);
        border: 2px solid rgba(16, 185, 129, 0.15);
        border-radius: 2rem;
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.12);
        backdrop-filter: blur(15px);
        overflow: hidden;
    }
    
    .upload-zone {
        padding: 2.5rem 1.5rem;
        background: linear-gradient(135deg, 
            rgba(16, 185, 129, 0.08) 0%, 
            rgba(6, 95, 70, 0.03) 100%);
        border: 2px dashed rgba(16, 185, 129, 0.25);
        border-radius: 2rem;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
    }
    
    .upload-zone::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(45deg, 
            rgba(16, 185, 129, 0.02) 25%, 
            transparent 25%, 
            transparent 75%, 
            rgba(16, 185, 129, 0.02) 75%);
        background-size: 20px 20px;
        opacity: 0.5;
    }
    
    .upload-zone:active {
        border-color: rgba(16, 185, 129, 0.4);
        background: linear-gradient(135deg, 
            rgba(16, 185, 129, 0.12) 0%, 
            rgba(6, 95, 70, 0.06) 100%);
        transform: scale(0.98);
    }
    
    .camera-icon {
        background: linear-gradient(135deg, 
            rgba(16, 185, 129, 0.2) 0%, 
            rgba(6, 95, 70, 0.1) 100%);
        border: 3px solid rgba(16, 185, 129, 0.3);
        box-shadow: 0 8px 25px rgba(16, 185, 129, 0.2);
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
        position: relative;
        z-index: 2;
    }
    
    .camera-icon svg {
        color: #059669;
        filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.3));
    }
    
    .upload-zone h3 {
        color: #1e293b;
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 0.8rem;
        position: relative;
        z-index: 2;
    }
    
    .upload-zone p {
        color: #64748b;
        font-size: 0.85rem;
        line-height: 1.5;
        position: relative;
        z-index: 2;
    }
    
    /* Attractive modern buttons */
    .action-buttons {
        gap: 1rem;
        margin-top: 2rem;
        flex-direction: column;
    }
    
    .btn-primary {
        background: linear-gradient(135deg, 
            #059669 0%, 
            #10b981 50%, 
            #34d399 100%);
        border: none;
        border-radius: 1rem;
        padding: 1rem 2rem;
        font-size: 1rem;
        font-weight: 700;
        color: white;
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-transform: none;
    }
    
    .btn-primary:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    }
    
    .btn-primary:active {
        transform: translateY(-1px);
    }
    
    .btn-secondary {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.95) 0%, 
            rgba(248, 250, 252, 0.9) 100%);
        border: 2px solid rgba(16, 185, 129, 0.2);
        border-radius: 1rem;
        color: #059669;
        padding: 1rem 2rem;
        font-size: 1rem;
        font-weight: 600;
        box-shadow: 0 4px 15px rgba(16, 185, 129, 0.1);
        backdrop-filter: blur(10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .btn-secondary:hover {
        background: linear-gradient(135deg, 
            rgba(16, 185, 129, 0.1) 0%, 
            rgba(6, 95, 70, 0.05) 100%);
        border-color: rgba(16, 185, 129, 0.4);
        transform: translateY(-2px);
        color: #047857;
    }
    
    /* Container and spacing optimization */
    .container {
        padding: 0 1rem; /* Restore horizontal padding for proper margins */
        max-width: 100%;
    }
    
    /* Header container specific padding */
    .header .container {
        padding: 0 1.5rem; /* Better padding for header/navbar */
    }
    
    .hero-content {
        text-align: center;
    }
    
    .upload-container {
        margin: 0;
    }
    
    /* Beautiful results section */
    .results-section {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.98) 0%, 
            rgba(248, 250, 252, 0.95) 100%);
        border-radius: 2rem 2rem 0 0;
        margin: 1rem 0 0;
        padding: 2rem 1.5rem;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(20px);
    }
    
    .nutrition-card {
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.9) 0%, 
            rgba(248, 250, 252, 0.8) 100%);
        border: 1px solid rgba(16, 185, 129, 0.1);
        border-radius: 1.5rem;
        padding: 1.2rem;
        box-shadow: 0 6px 20px rgba(16, 185, 129, 0.08);
        backdrop-filter: blur(10px);
    }
    
    .nutrition-card.protein {
        border-left: 4px solid #ef4444;
    }
    
    .nutrition-card.carbs {
        border-left: 4px solid #f59e0b;
    }
    
    .nutrition-card.fat {
        border-left: 4px solid #8b5cf6;
    }
    
    /* Mobile calories card styling */
    .calories-card.calories-blue {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #1e40af 100%);
        color: white;
        box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
    }
    
    .calories-card.calories-blue:hover {
        box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
    }
    
    /* Section title consistency */
    .section-title {
        font-size: 1.8rem !important;
        line-height: 1.3 !important;
        text-align: center;
        margin-bottom: 2rem;
    }
}

/* Mobile Navigation Menu Styles */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
}

.hamburger-line {
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: right 0.3s ease;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
}

.mobile-sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.close-sidebar {
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-sidebar:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.1);
}

.sidebar-content {
    padding: 2rem 1.5rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sidebar-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar-auth {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 1.5rem;
}

.sidebar-auth .btn-login,
.sidebar-auth .btn-signup {
    width: 100%;
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    text-align: center;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-auth .btn-login {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.sidebar-auth .btn-signup {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Desktop close button visibility */
@media (min-width: 769px) {
    .welcome-actions .btn-close {
        background: rgba(220, 38, 38, 0.8) !important;
        color: white !important;
        padding: 10px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        font-size: 18px !important;
        border-radius: 50% !important;
        border: 2px solid rgba(255, 255, 255, 0.6) !important;
        font-weight: bold !important;
        cursor: pointer !important;
        z-index: 10000 !important;
        box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease !important;
    }

    .welcome-actions .btn-close:hover {
        background: rgba(220, 38, 38, 1) !important;
        transform: scale(1.05) !important;
        border-color: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 4px 14px rgba(220, 38, 38, 0.5) !important;
    }
}

/* Mobile Navigation Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .nav {
        justify-content: space-between;
        align-items: center;
        padding: 1rem 0; /* Better vertical padding */
        margin: 0; /* Ensure no unwanted margins */
    }
    
    .logo h1 {
        margin: 0; /* Remove default margins from logo */
        font-size: 1.5rem; /* Appropriate size for mobile */
    }
    
    .mobile-sidebar {
        width: 100%;
        max-width: 320px;
    }
}

@media (min-width: 769px) {
    .mobile-menu-btn,
    .mobile-sidebar,
    .sidebar-overlay {
        display: none !important;
    }
}

/* CRITICAL MOBILE BUTTON FIXES - MUST BE LAST */
@media (max-width: 768px) {
    /* Mobile Hero Background Colors - Mint Green Theme */
    .hero {
        background: linear-gradient(135deg, 
            #98f5e1 0%, 
            #a7f3d0 25%,
            #6ee7b7 50%,
            #34d399 75%,
            #10b981 100%) !important;
        margin-top: 0; /* Remove any unwanted top margin */
        padding-top: 80px; /* Account for fixed header height */
    }

    /* Dark green text on mint green background */
    .hero .brand-title,
    .hero .brand-subtitle,
    .hero .hero-description,
    .hero .hero-tagline {
        color: #064e3b !important; /* Dark green */
        text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3) !important;
    }

    /* Brand gradient with dark green color */
    .brand-gradient {
        color: #065f46 !important; /* Darker green for brand */
        -webkit-text-fill-color: #065f46 !important;
        text-shadow: 0 2px 4px rgba(6, 95, 70, 0.3) !important;
        font-weight: 800 !important;
    }

    /* Force proper touch handling for ALL buttons */
    .btn, button, .btn-primary, .btn-close, .btn-login, .btn-signup, 
    .welcome-actions .btn, .auth-buttons button {
        -webkit-touch-callout: none !important;
        -webkit-user-select: none !important;
        -khtml-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
        cursor: pointer !important;
        touch-action: manipulation !important;
        min-height: 48px !important;
        position: relative !important;
        z-index: 1000 !important;
    }

    /* Welcome notification buttons - CRITICAL MOBILE FIXES */
    .welcome-actions {
        display: flex !important;
        gap: 15px !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        margin-top: 25px !important;
        width: 100% !important;
    }

    .welcome-actions .btn {
        padding: 15px 25px !important;
        margin: 5px !important;
        font-size: 16px !important;
        border-radius: 8px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 50px !important;
        min-width: 120px !important;
        line-height: 1.2 !important;
        text-align: center !important;
        text-decoration: none !important;
        border: none !important;
        background: var(--primary-color) !important;
        color: white !important;
        font-weight: 600 !important;
        transition: all 0.2s ease !important;
    }

    .welcome-actions .btn-close {
        background: rgba(220, 38, 38, 0.95) !important;
        color: white !important;
        padding: 15px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        font-size: 24px !important;
        line-height: 1 !important;
        border-radius: 50% !important;
        border: 3px solid rgba(255, 255, 255, 0.9) !important;
        font-weight: 900 !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 10001 !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3) !important;
        margin-left: 15px !important;
    }

    .welcome-actions .btn-close:hover,
    .welcome-actions .btn-close:active,
    .welcome-actions .btn-close:focus,
    .welcome-actions .btn-close:touched {
        background: rgba(220, 38, 38, 1) !important;
        transform: scale(1.15) !important;
        border-color: rgba(255, 255, 255, 1) !important;
        box-shadow: 0 8px 24px rgba(220, 38, 38, 0.7) !important;
    }

    /* Mobile-specific close button enhancements */
    @media (max-width: 480px) {
        .welcome-actions .btn-close {
            min-width: 56px !important;
            min-height: 56px !important;
            font-size: 28px !important;
            padding: 18px !important;
            margin-left: 20px !important;
            border-width: 4px !important;
        }
    }

    /* Auth buttons in header */
    .auth-buttons {
        display: flex !important;
        gap: 8px !important;
        align-items: center !important;
    }

    .auth-buttons .btn-login,
    .auth-buttons .btn-signup {
        padding: 10px 16px !important;
        margin: 0 !important;
        min-height: 40px !important;
        font-size: 14px !important;
        border-radius: 6px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        border: 1px solid var(--primary-color) !important;
        background: transparent !important;
        color: var(--primary-color) !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
    }

    .auth-buttons .btn-signup {
        background: var(--primary-color) !important;
        color: white !important;
    }

    /* Modal buttons */
    .modal-close {
        min-height: 44px !important;
        min-width: 44px !important;
        font-size: 20px !important;
        padding: 10px !important;
    }

    /* Active/hover states for mobile */
    .btn:active, .btn:focus {
        transform: scale(0.98) !important;
        opacity: 0.8 !important;
        outline: none !important;
    }
    
    /* Upload container mobile optimizations */
    .upload-hint {
        display: none;
    }
    
    .upload-hint-mobile {
        display: block;
    }
    
    .upload-zone {
        min-height: 240px;
        padding: 1.5rem;
        border-width: 2px;
    }
    
    .camera-icon {
        width: 70px;
        height: 70px;
    }
    
    .upload-actions {
        margin-top: 1.5rem;
    }
    
    /* Enhanced calories card for mobile */
    .calories-summary .calories-card {
        background: linear-gradient(135deg, #006400 0%, #013220 100%) !important;
        color: #32cd32 !important;
        border: 2px solid #32cd32 !important;
        box-shadow: 0 10px 30px rgba(0, 100, 0, 0.4), inset 0 1px 0 rgba(50, 205, 50, 0.2);
    }
    
    .calories-summary .calories-card h4 {
        color: #32cd32 !important;
        font-weight: 600;
        text-shadow: 0 0 8px rgba(50, 205, 50, 0.3);
    }
    
    .calories-summary .calories-value {
        color: #32cd32 !important;
        font-weight: 700;
        font-size: 2rem;
        text-shadow: 0 0 12px rgba(50, 205, 50, 0.4);
    }
}
