/* ═══════════════════════════════════════════════════════════════════════════════
   NutriCoach v10.0.1 - PREMIUM Production Styles
   Design Level: Google Fit / Apple Health / Samsung Health
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   DESIGN SYSTEM - CSS Custom Properties
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Premium Dark Theme - Deep Space */
    --bg-base: #050508;
    --bg-primary: #0A0A0F;
    --bg-secondary: #0F0F15;
    --bg-card: #12121A;
    --bg-elevated: #16161F;
    --bg-input: #1A1A24;
    --bg-hover: #1E1E28;
    
    /* Text Hierarchy */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-tertiary: rgba(255, 255, 255, 0.48);
    --text-muted: rgba(255, 255, 255, 0.32);
    --text-disabled: rgba(255, 255, 255, 0.16);
    
    /* Premium Health Accent - Teal/Cyan */
    --accent: #00D9B5;
    --accent-light: #00F5CC;
    --accent-dark: #00B899;
    --accent-glow: rgba(0, 217, 181, 0.25);
    --accent-subtle: rgba(0, 217, 181, 0.12);
    
    /* Secondary Colors */
    --blue: #00B4D8;
    --purple: #A855F7;
    --pink: #EC4899;
    --orange: #F97316;
    --yellow: #FBBF24;
    --red: #EF4444;
    --green: #22C55E;
    
    /* Semantic Colors */
    --success: #00D9B5;
    --warning: #FBBF24;
    --error: #EF4444;
    --info: #00B4D8;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00D9B5 0%, #00B4D8 100%);
    --gradient-premium: linear-gradient(135deg, #FFD700 0%, #FF9500 100%);
    --gradient-super: linear-gradient(135deg, #A855F7 0%, #EC4899 50%, #F43F5E 100%);
    --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0) 100%);
    --gradient-shine: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --glass-blur: blur(20px);
    
    /* Spacing Scale */
    --space-2xs: 2px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
    --space-4xl: 48px;
    
    /* Border Radius */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px var(--accent-glow);
    --shadow-glow-sm: 0 0 20px var(--accent-glow);
    --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    
    /* Animation Timing */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.25s;
    --duration-slow: 0.4s;
    
    /* Safe Areas */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    
    /* Layout */
    --nav-height: 72px;
    --header-height: 56px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    background: var(--bg-base);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overscroll-behavior: none;
}

#app {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--safe-top);
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
    padding-left: max(var(--safe-left), 16px);
    padding-right: max(var(--safe-right), 16px);
}

#app.ready {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY - Premium Scale
   ═══════════════════════════════════════════════════════════════════════════════ */

h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h4 {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════════════════════
   SCREENS - Layout Container
   ═══════════════════════════════════════════════════════════════════════════════ */

.screen {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: var(--space-2xl);
}

.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
    margin-bottom: var(--space-md);
}

.screen-header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CARDS - Premium Glassmorphism
   ═══════════════════════════════════════════════════════════════════════════════ */

.card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    box-shadow: var(--shadow-inset);
    transition: transform var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out);
}

/* Top highlight line */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.1) 50%, 
        transparent 100%);
}

.card:active {
    transform: scale(0.985);
}

.card h4 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

/* Card Variants */
.card-elevated {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BUTTONS - Modern Interactive
   ═══════════════════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    -webkit-user-select: none;
    user-select: none;
}

.btn:active {
    transform: scale(0.96);
}

/* Primary Button - Gradient */
.btn-primary {
    color: #000;
    background: var(--gradient-primary);
    border: none;
    box-shadow: var(--shadow-glow-sm);
}

.btn-primary:active {
    box-shadow: var(--shadow-glow);
}

/* Secondary Button - Glass */
.btn-secondary {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

.btn-secondary:active {
    background: var(--glass-bg-hover);
}

/* Ghost Button */
.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.btn-ghost:active {
    color: var(--text-primary);
    background: var(--glass-bg);
}

/* Button Sizes */
.btn-sm {
    padding: 10px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 18px 32px;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

/* Gradient Button */
.btn-gradient {
    background: var(--gradient-super);
    color: #fff;
    border: none;
}

/* Icon Button */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.icon-btn:active {
    transform: scale(0.92);
    background: var(--glass-bg-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   INPUTS - Modern Form Elements
   ═══════════════════════════════════════════════════════════════════════════════ */

.input {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.input::placeholder {
    color: var(--text-muted);
}

.input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

textarea.input {
    resize: none;
    min-height: 80px;
    line-height: 1.5;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* Form Groups */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

/* Input with actions */
.input-with-actions {
    position: relative;
}

.input-with-actions .input {
    padding-right: 100px;
}

.input-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: var(--space-xs);
}

.input-action-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.input-action-btn:active {
    transform: scale(0.9);
}

.input-action-btn.super {
    background: var(--gradient-super);
    border: none;
}

/* Input with suffix */
.input-with-suffix {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.input-with-suffix .input {
    flex: 1;
}

.input-with-suffix span {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PROGRESS RING - Apple Health Style
   ═══════════════════════════════════════════════════════════════════════════════ */

.daily-progress-card {
    text-align: center;
    padding: var(--space-2xl);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.progress-header h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-ring-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto var(--space-2xl);
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    filter: drop-shadow(var(--shadow-glow-sm));
}

.progress-ring-bg {
    fill: none;
    stroke: var(--glass-border);
    stroke-width: 12;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#gradient-primary);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset var(--duration-slow) var(--ease-out-expo);
}

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

.progress-percent {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.progress-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* Macros Row */
.macros-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--glass-border);
}

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

.macro-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.macro-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: var(--space-2xs);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   QUICK ACTIONS - Grid Layout
   ═══════════════════════════════════════════════════════════════════════════════ */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.quick-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.quick-action-btn:active {
    transform: scale(0.96);
    background: var(--bg-elevated);
}

.quick-action-btn.primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: var(--shadow-glow-sm);
}

.quick-action-btn.primary span {
    color: #000;
}

.qa-icon {
    font-size: 1.75rem;
}

.quick-action-btn span:last-child {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.quick-action-btn.primary span:last-child {
    color: #000;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SUPER PREMIUM CARD - Animated Gradient
   ═══════════════════════════════════════════════════════════════════════════════ */

.super-premium-card {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(168, 85, 247, 0.15) 0%, 
        rgba(236, 72, 153, 0.15) 50%,
        rgba(244, 63, 94, 0.15) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    overflow: hidden;
}

.super-premium-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(168, 85, 247, 0.3) 60deg,
        transparent 120deg
    );
    animation: rotateBg 8s linear infinite;
    opacity: 0.5;
}

@keyframes rotateBg {
    100% { transform: rotate(360deg); }
}

.sp-header {
    position: relative;
    margin-bottom: var(--space-lg);
}

.sp-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--gradient-super);
    border-radius: var(--radius-full);
    color: #fff;
}

.sp-features {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.sp-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.sp-feature:active {
    transform: scale(0.95);
    background: rgba(0, 0, 0, 0.4);
}

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

.sp-feature span:last-child {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION - iOS Style
   ═══════════════════════════════════════════════════════════════════════════════ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: var(--space-sm);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--duration-fast) var(--ease-out);
    position: relative;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

.nav-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: calc(var(--safe-top) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: calc(100% - 32px);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: rgba(20, 20, 28, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    opacity: 0;
    transition: all var(--duration-normal) var(--ease-out);
    pointer-events: auto;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
}

.toast-success .toast-icon { background: rgba(0, 217, 181, 0.2); color: var(--success); }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.2); color: var(--error); }
.toast-warning .toast-icon { background: rgba(251, 191, 36, 0.2); color: var(--warning); }
.toast-info .toast-icon { background: rgba(0, 180, 216, 0.2); color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   AI LOADER OVERLAY
   ═══════════════════════════════════════════════════════════════════════════════ */

.ai-loader-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 8, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

.ai-loader-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ai-loader-content {
    text-align: center;
    padding: var(--space-3xl);
}

.ai-loader-emoji {
    font-size: 4rem;
    animation: bounce 1s var(--ease-spring) infinite;
    filter: drop-shadow(0 0 30px var(--accent-glow));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

.ai-loader-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-xl) 0;
}

.ai-loader-dots span {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.ai-loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.ai-loader-message {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.ai-loader-hint {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MODAL - iOS Sheet Style
   ═══════════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10003;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

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

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform var(--duration-slow) var(--ease-out-expo);
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

/* Drag handle */
.modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 5px;
    background: var(--text-muted);
    border-radius: var(--radius-full);
    margin: var(--space-md) auto;
}

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

.modal-header h3 {
    font-size: 1.125rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--glass-bg);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-content {
    padding: var(--space-xl);
    max-height: calc(90vh - 100px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Modal sizes */
.modal-small { max-width: 360px; }
.modal-large { max-width: 600px; }

/* Subscription Modal */
.subscription-modal {
    text-align: center;
    padding: var(--space-lg) 0;
}

.sub-modal-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
}

.subscription-modal h3 {
    margin-bottom: var(--space-sm);
}

.subscription-modal p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.sub-modal-features {
    text-align: left;
    margin-bottom: var(--space-xl);
}

.sub-feature {
    padding: var(--space-md) 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
}

.sub-feature:last-child {
    border-bottom: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MEAL ITEMS
   ═══════════════════════════════════════════════════════════════════════════════ */

.meals-section {
    margin-top: var(--space-xl);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.meal-item {
    padding: var(--space-lg);
}

.meal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.meal-time {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.meal-text {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.meal-macros {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.meal-calories {
    font-weight: 600;
    color: var(--accent);
}

.delete-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--error);
    opacity: 0.7;
}

.delete-btn:active {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STATS CARD
   ═══════════════════════════════════════════════════════════════════════════════ */

.stats-card {
    padding: var(--space-lg);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.stat-item {
    text-align: center;
    padding: var(--space-sm);
}

.stat-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════════════════════════════════════════ */

.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.upload-zone:active {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.upload-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.upload-hint {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.credits-hint {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-top: var(--space-lg);
}

.credits-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
    font-weight: 600;
    background: var(--accent-subtle);
    color: var(--accent);
    border-radius: var(--radius-full);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CHAT SCREEN
   ═══════════════════════════════════════════════════════════════════════════════ */

.chat-screen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height) - var(--safe-bottom));
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    -webkit-overflow-scrolling: touch;
}

.chat-message {
    max-width: 85%;
    margin-bottom: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.chat-message.user {
    margin-left: auto;
    background: var(--gradient-primary);
    color: #000;
    border-bottom-right-radius: var(--radius-xs);
}

.chat-message.assistant {
    background: var(--bg-elevated);
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: var(--radius-xs);
}

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--space-3xl);
}

.chat-welcome-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.chat-welcome h3 {
    margin-bottom: var(--space-sm);
}

.chat-welcome p {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    max-width: 280px;
}

.chat-suggestion {
    padding: var(--space-md);
    font-size: 0.875rem;
    text-align: left;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.chat-suggestion:active {
    background: var(--glass-bg-hover);
    color: var(--text-primary);
}

.chat-input-area {
    padding: var(--space-md);
    background: var(--bg-card);
    border-top: 1px solid var(--glass-border);
}

.chat-form {
    display: flex;
    gap: var(--space-sm);
}

.chat-input {
    flex: 1;
}

.chat-send {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.chat-send:active {
    transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SHOP SCREEN
   ═══════════════════════════════════════════════════════════════════════════════ */

.shop-card {
    overflow: visible;
}

.shop-card-header {
    margin-bottom: var(--space-lg);
}

.shop-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    background: var(--glass-bg);
}

.premium-shop .shop-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 149, 0, 0.2));
    color: #FFD700;
}

.super-premium-shop .shop-badge {
    background: var(--gradient-super);
    color: #fff;
}

.shop-features {
    margin-bottom: var(--space-xl);
}

.shop-feature {
    padding: var(--space-md) 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
}

.shop-feature:last-child {
    border-bottom: none;
}

.shop-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.credits-products {
    grid-template-columns: repeat(3, 1fr);
}

.shop-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
}

.shop-product:active {
    transform: scale(0.96);
}

.shop-product.featured {
    background: var(--accent-subtle);
    border-color: var(--accent);
}

.product-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 4px 8px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--error);
    color: #fff;
    border-radius: var(--radius-full);
}

.product-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
}

.product-bonus {
    font-size: 0.6875rem;
    color: var(--accent);
    font-weight: 500;
}

/* Promo Form */
.promo-form {
    display: flex;
    gap: var(--space-sm);
}

.promo-form .input {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PROFILE SCREEN
   ═══════════════════════════════════════════════════════════════════════════════ */

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

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.profile-avatar {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    color: #000;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-glow);
}

.profile-info h3 {
    margin-bottom: var(--space-2xs);
}

.profile-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.status-label {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.status-value {
    font-weight: 600;
}

.profile-expires {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.admin-panel {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 149, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: var(--radius-md);
}

.admin-label {
    font-weight: 600;
    color: #FFD700;
}

/* Params Grid */
.params-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.param-item {
    padding: var(--space-md);
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    text-align: center;
}

.param-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-xs);
}

.param-value {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Profile Links */
.profile-links {
    margin-top: var(--space-xl);
}

.profile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.profile-link:active {
    background: var(--bg-elevated);
}

.profile-link-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.profile-link-icon {
    font-size: 1.25rem;
}

.profile-link-text {
    font-weight: 500;
}

.profile-link-arrow {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════════════════════════════ */

.onboarding-screen {
    min-height: calc(100vh - var(--safe-top) - var(--safe-bottom));
    display: flex;
    flex-direction: column;
    padding: var(--space-2xl);
}

.onboarding-progress {
    padding: var(--space-lg) 0;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--glass-border);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out);
}

.dot.active {
    width: 24px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

.dot.done {
    background: var(--accent);
}

.onboarding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl) 0;
}

.onboarding-icon {
    font-size: 5rem;
    margin-bottom: var(--space-xl);
    animation: pulseGlow 2s ease-in-out infinite;
}

.onboarding-content h1,
.onboarding-content h2 {
    margin-bottom: var(--space-md);
}

.onboarding-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
}

.onboarding-features {
    width: 100%;
    max-width: 280px;
}

.onboarding-feature {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    text-align: left;
}

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

.onboarding-actions {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-xl);
}

.onboarding-actions .btn {
    flex: 1;
}

/* Gender Selection */
.gender-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    width: 100%;
    max-width: 320px;
}

.gender-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.gender-option:active {
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: scale(0.98);
}

.gender-icon {
    font-size: 3rem;
}

/* Goal Options */
.goal-options,
.activity-options {
    width: 100%;
    max-width: 320px;
}

.goal-option,
.activity-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    transition: all var(--duration-normal) var(--ease-out);
}

.goal-option:active,
.activity-option:active {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.goal-icon,
.activity-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.goal-title,
.activity-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2xs);
}

.goal-desc,
.activity-desc {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* Body Inputs */
.body-inputs {
    width: 100%;
    max-width: 320px;
    text-align: left;
}

.body-input-group {
    margin-bottom: var(--space-lg);
}

.body-input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

/* Large Input */
.input-large-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
}

.input-large {
    width: 120px;
    padding: var(--space-lg);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    background: var(--bg-input);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    outline: none;
}

.input-large:focus {
    border-color: var(--accent);
}

.input-suffix {
    font-size: 1.125rem;
    color: var(--text-tertiary);
}

/* Complete Screen */
.onboarding-complete .complete-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.complete-summary {
    width: 100%;
    max-width: 300px;
    margin: var(--space-xl) 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-md);
    border-bottom: 1px solid var(--glass-border);
}

.summary-item.highlight {
    background: var(--accent-subtle);
    border-radius: var(--radius-md);
    border: none;
    margin: var(--space-sm) 0;
}

.summary-label {
    color: var(--text-tertiary);
}

.summary-value {
    font-weight: 600;
}

.highlight .summary-value {
    color: var(--accent);
}

.complete-note {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CHALLENGES
   ═══════════════════════════════════════════════════════════════════════════════ */

.challenge-card {
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.challenge-name {
    font-weight: 600;
    color: var(--text-primary);
}

.challenge-duration {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.challenge-progress {
    height: 8px;
    background: var(--glass-border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.challenge-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width var(--duration-slow) var(--ease-out);
    box-shadow: var(--shadow-glow-sm);
}

.challenge-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ACHIEVEMENTS
   ═══════════════════════════════════════════════════════════════════════════════ */

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.achievement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    text-align: center;
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.achievement-name {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: var(--space-xs);
}

.achievement-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.achievement-card.locked {
    opacity: 0.5;
}

.achievement-card.locked .achievement-icon {
    filter: grayscale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SAVED ITEMS
   ═══════════════════════════════════════════════════════════════════════════════ */

.saved-section {
    margin-top: var(--space-xl);
}

.saved-section h4 {
    margin-bottom: var(--space-md);
}

.saved-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    cursor: pointer;
}

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

.saved-info {
    flex: 1;
}

.saved-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2xs);
}

.saved-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   FRIENDS & REFERRAL
   ═══════════════════════════════════════════════════════════════════════════════ */

.friend-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
}

.friend-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--gradient-primary);
    color: #000;
    border-radius: var(--radius-full);
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: 500;
}

.friend-status {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.referral-code-box {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
}

.referral-code {
    flex: 1;
    font-family: 'SF Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.referral-stat {
    text-align: center;
    padding: var(--space-lg);
    background: var(--glass-bg);
    border-radius: var(--radius-md);
}

.referral-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.referral-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════════════════════════ */

.settings-list {
    margin-top: var(--space-md);
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-sm);
    cursor: pointer;
}

.settings-item:active {
    background: var(--bg-elevated);
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

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

.settings-label {
    font-weight: 500;
}

.settings-arrow {
    color: var(--text-muted);
}

.version-info {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   AI RESPONSE FORMATTING
   ═══════════════════════════════════════════════════════════════════════════════ */

.ai-response {
    line-height: 1.7;
}

.ai-response p {
    margin-bottom: var(--space-md);
}

.ai-response p:last-child {
    margin-bottom: 0;
}

.ai-heading {
    color: var(--accent);
    margin: var(--space-lg) 0 var(--space-md);
}

.ai-list {
    margin: var(--space-md) 0;
    padding-left: var(--space-xl);
}

.ai-list li {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   CONFETTI
   ═══════════════════════════════════════════════════════════════════════════════ */

.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10004;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════════════════════════════════════ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--glass-border) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        var(--glass-border) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

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

.skeleton-text {
    height: 1em;
    margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-circle {
    border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   STREAK BADGE
   ═══════════════════════════════════════════════════════════════════════════════ */

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.2));
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: var(--radius-full);
    color: var(--orange);
}

.streak-badge .streak-icon {
    font-size: 0.875rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   LOADING/ERROR SCREENS
   ═══════════════════════════════════════════════════════════════════════════════ */

.loading-screen,
.error-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    z-index: 10000;
    gap: var(--space-lg);
    padding: var(--space-2xl);
    text-align: center;
}

.loading-logo,
.error-icon {
    font-size: 72px;
}

.loading-logo {
    animation: pulseGlow 2s ease-in-out infinite;
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   AVATAR
   ═══════════════════════════════════════════════════════════════════════════════ */

.avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--gradient-primary);
    color: #000;
    border-radius: var(--radius-full);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   GREETING
   ═══════════════════════════════════════════════════════════════════════════════ */

.greeting {
    margin-bottom: var(--space-xl);
}

.greeting h2 {
    margin-bottom: var(--space-xs);
}

.greeting-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 359px) {
    :root {
        --space-xl: 16px;
        --space-2xl: 20px;
    }
    
    .progress-ring-container {
        width: 150px;
        height: 150px;
    }
    
    .progress-percent {
        font-size: 2rem;
    }
    
    .quick-actions {
        gap: var(--space-sm);
    }
    
    .sp-features {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
    }
    
    .sp-feature {
        padding: var(--space-md);
    }
    
    .shop-products {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 480px) {
    .progress-ring-container {
        width: 200px;
        height: 200px;
    }
    
    .progress-percent {
        font-size: 3rem;
    }
}

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

/* Print styles */
@media print {
    .bottom-nav,
    .toast-container,
    .ai-loader-overlay,
    .modal-overlay,
    .confetti-container {
        display: none !important;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    .card {
        border: 1px solid #ddd;
        background: #fff;
    }
}
