/* ============================================
   FOODSCAN PRO - ULTRA REALISTIC CSS
   Advanced Features + Dark Mode + Animations
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #3b82f6;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-purple: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    /* Light Theme */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Neutrals */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px var(--shadow-color);
    --shadow-md: 0 10px 15px -3px var(--shadow-color);
    --shadow-lg: 0 20px 25px -5px var(--shadow-color);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark Theme */
body.dark-mode {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #0f172a;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

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

.connecting-btn
{
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    padding: 14px 20px;
    margin-top: 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--gradient-primary);
    color: white;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition-base);
}

body.dark-mode {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 100;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(255, 255, 255, 0.3);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ============================================
   BACKGROUND ANIMATION
   ============================================ */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
    will-change: transform;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: 5%;
    left: 5%;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: 5%;
    animation-delay: 7s;
}

.circle-3 {
    width: 200px;
    height: 200px;
    bottom: 10%;
    left: 40%;
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% { 
        transform: translate(0, 0) scale(1) rotate(0deg); 
        opacity: 0.3;
    }
    25% { 
        transform: translate(50px, -50px) scale(1.1) rotate(90deg); 
        opacity: 0.5;
    }
    50% { 
        transform: translate(-30px, 30px) scale(0.9) rotate(180deg); 
        opacity: 0.4;
    }
    75% { 
        transform: translate(30px, 50px) scale(1.05) rotate(270deg); 
        opacity: 0.6;
    }
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
    margin-bottom: 24px;
    animation: slideDown 0.6s ease;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo i {
    font-size: 32px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    animation: leafPulse 3s infinite;
}

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

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.icon-btn:active {
    transform: translateY(0);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
}

/* Stats Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-base);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card i {
    font-size: 24px;
    color: white;
    opacity: 0.9;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 20px;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ============================================
   SCANNER CARD
   ============================================ */
.scanner-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 24px;
    animation: scaleIn 0.6s var(--transition-bounce);
    border: 1px solid var(--border-color);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.scanner-header {
    text-align: center;
    margin-bottom: 28px;
}

.scanner-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scanner-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Scanner Mode Tabs */
.scanner-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-md);
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.mode-btn i {
    font-size: 20px;
}

.mode-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.mode-btn:hover:not(.active) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Scanner Modes */
.scanner-mode {
    display: none;
}

.scanner-mode.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   CAMERA SCANNER
   ============================================ */
.camera-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 16px;
}

#cameraVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
}

.scan-frame {
    position: relative;
    width: 70%;
    aspect-ratio: 3/2;
}

.corner {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 4px solid var(--primary);
}

.corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    border-radius: 12px 0 0 0;
}

.corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    border-radius: 0 12px 0 0;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 12px;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    border-radius: 0 0 12px 0;
}

.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanLineMove 2s infinite ease-in-out;
    filter: drop-shadow(0 0 10px var(--primary));
}

@keyframes scanLineMove {
    0%, 100% { top: 0; }
    50% { top: calc(100% - 3px); }
}

.camera-instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
}

.camera-instructions i {
    font-size: 40px;
    margin-bottom: 8px;
    opacity: 0.9;
    animation: pulse 2s infinite;
}

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

.camera-instructions p {
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.camera-controls {
    display: flex;
    gap: 12px;
}

.camera-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    background: var(--gradient-primary);
    color: white;
}

.camera-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.camera-btn.danger {
    background: var(--gradient-danger);
}

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

.camera-btn:active {
    transform: translateY(0);
}

/* ============================================
   MANUAL INPUT
   ============================================ */
.manual-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-tertiary);
    font-size: 18px;
    z-index: 1;
}

#barcodeInput {
    width: 100%;
    padding: 16px 50px 16px 50px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    transition: all var(--transition-base);
    outline: none;
    background: var(--bg-primary);
    color: var(--text-primary);
}

#barcodeInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.clear-btn {
    position: absolute;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    background: var(--danger);
    color: white;
}

.scan-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow);
}

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

.scan-btn:active {
    transform: translateY(0);
}

/* ============================================
   VOICE INPUT
   ============================================ */
.voice-input {
    text-align: center;
    padding: 40px 20px;
}

.voice-btn {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 48px;
    cursor: pointer;
    transition: all var(--transition-base);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.voice-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.listening {
    animation: voicePulse 1.5s infinite;
}

@keyframes voicePulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 30px rgba(99, 102, 241, 0);
    }
}

.voice-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    gap: 4px;
}

.voice-btn.listening .voice-waves {
    display: flex;
}

.voice-waves span {
    width: 4px;
    height: 20px;
    background: white;
    border-radius: 2px;
    animation: waveAnimation 1s infinite ease-in-out;
}

.voice-waves span:nth-child(1) { animation-delay: 0s; }
.voice-waves span:nth-child(2) { animation-delay: 0.2s; }
.voice-waves span:nth-child(3) { animation-delay: 0.4s; }
.voice-waves span:nth-child(4) { animation-delay: 0.6s; }

@keyframes waveAnimation {
    0%, 100% { height: 20px; }
    50% { height: 40px; }
}

.voice-status {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 12px;
}

.voice-text {
    color: var(--primary);
    font-size: 24px;
    font-weight: 700;
    min-height: 32px;
}

/* ============================================
   DEMO SECTION
   ============================================ */
.demo-section {
    padding-top: 24px;
    border-top: 2px dashed var(--border-color);
    margin-top: 24px;
}

.demo-title {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.demo-title i {
    color: var(--primary);
}

.demo-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.demo-card {
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.demo-card:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.demo-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.demo-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.demo-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.demo-score {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
}

.demo-score.healthy {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.demo-score.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.demo-score.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 20px;
}

.scanner-animation {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 32px;
}

.scanner-beam {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    animation: scanBeam 1.5s infinite ease-in-out;
    filter: drop-shadow(0 0 15px #fff);
}

@keyframes scanBeam {
    0%, 100% { top: 0; }
    50% { top: 136px; }
}

.barcode-icon {
    font-size: 90px;
    color: rgba(255, 255, 255, 0.2);
}

.loading-content h3 {
    font-size: 26px;
    margin-bottom: 24px;
    font-weight: 700;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    transition: all var(--transition-base);
    opacity: 0.4;
}

.loading-step.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.loading-step i {
    font-size: 18px;
}

.loading-step span {
    font-size: 14px;
}

/* ============================================
   RESULTS CONTAINER
   ============================================ */
.results-container {
    display: none;
}

.results-container.active {
    display: block;
}

.slide-up {
    animation: slideUp 0.6s var(--transition-bounce);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PRODUCT CARD
   ============================================ */
.product-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1));
}

.image-badges {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(245, 158, 11, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.product-details {
    padding: 24px;
}

.product-details h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 16px;
}

.brand i {
    color: var(--primary);
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.product-meta i {
    color: var(--primary);
}

.meta-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.meta-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   SCORE CARD (ENHANCED)
   ============================================ */
.score-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.score-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-actions {
    display: flex;
    gap: 8px;
}

.icon-btn-small {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn-small:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.score-display {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}

.score-circle-container {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.score-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-bg {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 14;
}

.score-progress {
    fill: none;
    stroke: url(#scoreGradient);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 534.07;
    stroke-dashoffset: 534.07;
    transition: stroke-dashoffset 2s cubic-bezier(0.34, 1.56, 0.64, 1), 
                stroke 1s ease;
}

.gradient-start {
    stop-color: var(--success);
}

.gradient-end {
    stop-color: var(--success-light);
}

.score-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-emoji {
    font-size: 32px;
    margin-bottom: 4px;
    animation: emojiPop 0.6s var(--transition-bounce);
}

@keyframes emojiPop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.score-number {
    font-size: 52px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.score-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-breakdown {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.score-grade {
    text-align: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.grade-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.grade-value {
    display: block;
    font-size: 48px;
    font-weight: 900;
    line-height: 1;
}

.score-percentile {
    text-align: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.percentile-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.percentile-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.score-recommendation {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.score-recommendation i {
    color: var(--primary);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.score-recommendation p {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
}

/* AI Insights */
.ai-insights {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.insight-header i {
    color: var(--primary);
}

.insights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-item {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.insight-item i {
    color: var(--info);
    margin-top: 2px;
}

/* Continue in next message... (CSS is very large) */

/* ============================================
   WARNINGS CARD
   ============================================ */
.warnings-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.warnings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.warnings-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-count {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 800;
    padding: 0 10px;
    animation: warningPulse 2s infinite;
}

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

.warnings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.warning-item {
    padding: 16px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    display: flex;
    gap: 12px;
    transition: all var(--transition-base);
    animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.warning-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.warning-item.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.warning-item.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

.warning-item.moderate {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
}

.warning-icon {
    font-size: 28px;
    flex-shrink: 0;
    animation: iconBounce 0.6s var(--transition-bounce);
}

@keyframes iconBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.warning-content {
    flex: 1;
}

.warning-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.warning-value {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.warning-tip {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================
   ALLERGY CARD
   ============================================ */
.allergy-card {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
    border: 2px solid var(--danger);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 16px;
    animation: alertShake 0.5s;
}

@keyframes alertShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.allergy-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.allergy-header i {
    font-size: 32px;
    color: var(--danger);
}

.allergy-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--danger);
}

.allergy-content {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.6;
}

/* ============================================
   NUTRITION CARD (ENHANCED)
   ============================================ */
.nutrition-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.nutrition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.nutrition-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.serving-controls {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius);
}

.serving-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.serving-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.nutrition-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nutrition-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.nutrition-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.nutrition-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.nutrition-icon.calories {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.nutrition-icon.sugar {
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    color: #dc2626;
}

.nutrition-icon.fat {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #ea580c;
}

.nutrition-icon.salt {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4f46e5;
}

.nutrition-icon.protein {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
}

.nutrition-icon.fiber {
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: #7c3aed;
}

.nutrition-info {
    flex: 1;
}

.nutrition-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.nutrition-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.calories-bar { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sugar-bar { background: linear-gradient(90deg, #ef4444, #dc2626); }
.fat-bar { background: linear-gradient(90deg, #f97316, #ea580c); }
.salt-bar { background: linear-gradient(90deg, #6366f1, #4f46e5); }
.protein-bar { background: linear-gradient(90deg, #10b981, #059669); }
.fiber-bar { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }

.nutrition-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Daily Tracker */
.daily-tracker {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px dashed var(--border-color);
}

.daily-tracker h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-progress {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
}

.daily-item {
    margin-bottom: 12px;
}

.daily-item span {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.daily-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.daily-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

#dailyCaloriesText {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.add-to-tracker-btn {
    width: 100%;
    padding: 12px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-tracker-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   ALTERNATIVES CARD
   ============================================ */
.alternatives-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.alternatives-header {
    margin-bottom: 20px;
}

.alternatives-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.alternatives-list {
    display: grid;
    gap: 12px;
}

.alternative-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.alternative-item:hover {
    background: var(--bg-primary);
    border-color: var(--success);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.alternative-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    object-fit: contain;
    background: white;
}

.alternative-info {
    flex: 1;
}

.alternative-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alternative-reason {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.alternative-score {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 32px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base);
}

.action-btn i {
    font-size: 20px;
}

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

.action-btn.secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

.action-btn:active {
    transform: translateY(0);
}

/* ============================================
   MODALS
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.4s var(--transition-bounce);
    box-shadow: var(--shadow-xl);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* History Modal */
.history-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.history-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}

.history-image {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    object-fit: contain;
    background: white;
}

.history-info {
    flex: 1;
}

.history-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.history-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    font-size: 18px;
    font-weight: 800;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 15px;
}

/* Settings Modal */
.settings-section {
    margin-bottom: 28px;
}

.settings-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

/* Toggle Switch */
.switch {
    position: relative;
    width: 54px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: var(--transition-base);
    border-radius: var(--radius-full);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition-base);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Preferences Grid */
.preferences-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preference-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-base);
}

.preference-checkbox input {
    display: none;
}

.preference-checkbox span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.preference-checkbox input:checked + span {
    color: var(--primary);
}

.preference-checkbox:has(input:checked) {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

/* Allergen List */
.allergen-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.allergen-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
}

.allergen-tag input {
    display: none;
}

.allergen-tag span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.allergen-tag:has(input:checked) {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.allergen-tag:has(input:checked) span {
    color: var(--danger);
}

/* Goal Input */
.goal-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goal-input label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.goal-input input {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 700;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-base);
}

.goal-input input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* ============================================
   ACHIEVEMENT POPUP
   ============================================ */
.achievement-popup {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    padding: 20px 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    transition: top 0.6s var(--transition-bounce);
}

.achievement-popup.show {
    top: 80px;
}

.achievement-content {
    text-align: center;
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: achievementBounce 1s infinite;
}

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

.achievement-popup h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
}

.achievement-popup p {
    font-size: 14px;
    opacity: 0.9;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 16px 28px;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 4000;
    transition: bottom var(--transition-base);
    min-width: 300px;
}

.toast.show {
    bottom: 32px;
}

.toast i {
    color: var(--success);
    font-size: 22px;
}

.toast.error i {
    color: var(--danger);
}

.toast.warning i {
    color: var(--warning);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 500px) {
    .app-container {
        padding: 16px;
    }

    .scanner-card {
        padding: 24px 20px;
    }

    .scanner-header h1 {
        font-size: 24px;
    }

    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .stat-card {
        flex-direction: column;
        padding: 12px 8px;
        gap: 8px;
    }

    .stat-card i {
        font-size: 20px;
    }

    .stat-number {
        font-size: 18px;
    }

    .demo-products {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .demo-icon {
        font-size: 32px;
    }

    .score-display {
        flex-direction: column;
        gap: 20px;
    }

    .score-circle-container {
        width: 160px;
        height: 160px;
    }

    .score-number {
        font-size: 48px;
    }

    .score-breakdown {
        width: 100%;
        flex-direction: row;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .nutrition-item {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    .nutrition-value {
        grid-column: 2;
        text-align: right;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .theme-toggle,
    .header-actions,
    .scanner-card,
    .action-buttons,
    .bg-animation {
        display: none !important;
    }

    body {
        background: white;
    }

    .results-container {
        display: block !important;
    }
}