/*
 * MERA KHATA V2.0 - PREMIUM DESIGN SYSTEM
 * Architecture: Mobile-First, Native App Feel, High-Fidelity UI
 * Fonts: 'Outfit' for headings, 'Inter' for UI data
 */

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

:root {
  /* ==========================================================================
     1. COLOR SYSTEM (Premium SaaS Palette)
     ========================================================================== */
  /* Brand Primary (Indigo/Violet Gradient Base) */
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-500: #3B82F6;
  --brand-600: #1E3A8A;
  --brand-gradient: linear-gradient(135deg, #1E3A8A 0%, #172554 100%);
  --brand-glow: rgba(30, 58, 138, 0.4);

  /* Surface & Background */
  --bg-app: #f8fafc;        /* Very light cool gray for main app body */
  --bg-surface: #ffffff;    /* Pure white for cards */
  --bg-surface-glass: rgba(255, 255, 255, 0.85); /* For glassmorphism */
  
  /* Text & Neutrals (Slate) */
  --text-primary: #0f172a;  /* Near black for headings */
  --text-secondary: #475569;/* Subtle text */
  --text-muted: #94a3b8;    /* Disabled or placeholder text */
  --border-light: #e2e8f0;
  --border-focus: #cbd5e1;

  /* Semantic Colors */
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --success-solid: #10b981;
  
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --danger-solid: #ef4444;

  --warning-bg: #fef3c7;
  --warning-text: #b45309;
  --warning-solid: #f59e0b;

  /* ==========================================================================
     2. TYPOGRAPHY
     ========================================================================== */
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-sans: 'Nunito', system-ui, sans-serif;

  /* ==========================================================================
     3. SPACING & SIZING (4px Base)
     ========================================================================== */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */

  /* Touch Targets (Mobile First strict requirement) */
  --touch-target: 48px;

  /* ==========================================================================
     4. RADII & SHADOWS (Premium Depth)
     ========================================================================== */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 8px 20px var(--brand-glow);

  /* ==========================================================================
     5. ANIMATIONS (Spring Physics)
     ========================================================================== */
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 150ms var(--ease-smooth);
  --transition-spring: 300ms var(--ease-spring);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Safe Area for Mobile Notches */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   NATIVE APP UTILITIES
   ========================================================================== */
.no-select {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Enforces Apple/Google minimum touch target guidelines */
.touch-target {
  min-height: var(--touch-target);
  min-width: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.glass-panel {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   COMPONENT: BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0 var(--space-6);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
}

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

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

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

.btn--outline {
  background: transparent;
  color: var(--brand-600);
  border: 2px solid var(--brand-100);
}

.btn--outline:hover {
  background: var(--brand-50);
  border-color: var(--brand-500);
}

/* ==========================================================================
   COMPONENT: INPUTS
   ========================================================================== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.input-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.input-field {
  width: 100%;
  min-height: var(--touch-target);
  padding: 0 var(--space-4);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.input-field:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px var(--brand-50);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ==========================================================================
   GLOBAL BOTTOM NAVIGATION (MOBILE-FIRST)
   ========================================================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-spring);
    position: relative;
    padding: 0 8px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-link i {
    font-size: 1.25rem;
    transition: transform var(--transition-spring);
}

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

.nav-link.active {
    color: var(--brand-600);
    background: var(--brand-50);
}

.nav-link.active i {
    transform: translateY(-2px);
    color: var(--brand-600);
}

.nav-link:active {
    transform: scale(0.92);
}

/* Badge for Cart */
.nav-link .badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--danger-solid);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--bg-surface);
    transform: translate(50%, -50%);
}

/* Hide Bottom Nav on Desktop */
@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}
/* =======================================================================
   PLAN GATE � Subscription Feature Gating UI
   Locks premium sections behind an upgrade overlay
   ======================================================================= */

/* Nav lock badge (shown on sidebar items) */
.plan-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Dim locked nav link */
.plan-locked-link {
    opacity: 0.65;
    pointer-events: auto !important; /* still clickable to show overlay */
}

/* Full-section gate overlay */
.plan-gate-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 30, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

/* Gate card */
.plan-gate-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    animation: pgPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pgPop {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.plan-gate-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.plan-gate-title {
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 10px;
}

.plan-gate-sub {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 0 20px;
}

.plan-gate-sub strong {
    color: #fbbf24;
}

.plan-gate-btn {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    margin-bottom: 10px;
}

.plan-gate-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(239, 68, 68, 0.5);
}

.plan-gate-price {
    color: #475569;
    font-size: 0.78rem;
    margin-top: 4px;
}

