/**
 * INDIAGRAM NEXT-GEN MOBILE APP SHELL
 * Tactile 3D Sinking Haptics | Liquid Glass Bento Grid | Custom Vector Icons
 */

@import url('https://fonts.googleapis.com/css2?family=Cabinet+Grotesk:wght@500;700;800;900&family=IBM+Plex+Mono:wght@500;600;700&family=Outfit:wght@500;600;700;800&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  /* Default Theme: Aura Nebula */
  --bg-canvas: #07090e;
  --bg-gradient: radial-gradient(circle at 50% 10%, #201335 0%, #0d0918 45%, #05060a 100%);
  --accent-primary: #a855f7;
  --accent-secondary: #06b6d4;
  --accent-glow: rgba(168, 85, 247, 0.45);
  --card-glass: rgba(255, 255, 255, 0.05);
  --card-glass-hover: rgba(255, 255, 255, 0.09);
  --card-glass-active: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-hover: rgba(168, 85, 247, 0.5);
  --glass-shadow: rgba(0, 0, 0, 0.55);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-accent: #c084fc;
  --badge-bg: rgba(168, 85, 247, 0.2);
  --badge-border: rgba(168, 85, 247, 0.4);
  --badge-text: #e9d5ff;
  --orb-1: #9333ea;
  --orb-2: #0284c7;
  --orb-3: #ec4899;

  /* Typography & Radius defaults */
  --font-active: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --tile-radius: 24px;
  --tile-inner-radius: 16px;
  --bento-padding: 12px;
}

/* Theme 2: Matrix Emerald */
[data-theme="matrix"] {
  --bg-canvas: #030a06;
  --bg-gradient: radial-gradient(circle at 50% 10%, #0b2917 0%, #04140b 50%, #020704 100%);
  --accent-primary: #10b981;
  --accent-secondary: #06b6d4;
  --accent-glow: rgba(16, 185, 129, 0.45);
  --card-glass: rgba(16, 185, 129, 0.05);
  --card-glass-hover: rgba(16, 185, 129, 0.1);
  --glass-border: rgba(16, 185, 129, 0.22);
  --glass-border-hover: rgba(52, 211, 153, 0.6);
  --glass-shadow: rgba(0, 0, 0, 0.65);
  --text-primary: #f0fdf4;
  --text-secondary: #86efac;
  --text-accent: #34d399;
  --badge-bg: rgba(16, 185, 129, 0.2);
  --badge-border: rgba(16, 185, 129, 0.5);
  --badge-text: #a7f3d0;
  --orb-1: #059669;
  --orb-2: #0d9488;
  --orb-3: #10b981;
}

/* Theme 3: Solar Flare */
[data-theme="solar"] {
  --bg-canvas: #0c0705;
  --bg-gradient: radial-gradient(circle at 50% 10%, #381507 0%, #1a0b04 50%, #080302 100%);
  --accent-primary: #f97316;
  --accent-secondary: #eab308;
  --accent-glow: rgba(249, 115, 22, 0.5);
  --card-glass: rgba(249, 115, 22, 0.05);
  --card-glass-hover: rgba(249, 115, 22, 0.1);
  --glass-border: rgba(249, 115, 22, 0.22);
  --glass-border-hover: rgba(251, 146, 60, 0.6);
  --glass-shadow: rgba(0, 0, 0, 0.6);
  --text-primary: #fff7ed;
  --text-secondary: #fdba74;
  --text-accent: #fb923c;
  --badge-bg: rgba(249, 115, 22, 0.22);
  --badge-border: rgba(249, 115, 22, 0.5);
  --badge-text: #fed7aa;
  --orb-1: #ea580c;
  --orb-2: #ca8a04;
  --orb-3: #e11d48;
}

/* Theme 4: Titanium Arctic */
[data-theme="titanium"] {
  --bg-canvas: #060a12;
  --bg-gradient: radial-gradient(circle at 50% 10%, #152238 0%, #0c1422 50%, #04070d 100%);
  --accent-primary: #38bdf8;
  --accent-secondary: #e2e8f0;
  --accent-glow: rgba(56, 189, 248, 0.45);
  --card-glass: rgba(255, 255, 255, 0.07);
  --card-glass-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-border-hover: rgba(56, 189, 248, 0.6);
  --glass-shadow: rgba(0, 0, 0, 0.5);
  --text-primary: #ffffff;
  --text-secondary: #93c5fd;
  --text-accent: #7dd3fc;
  --badge-bg: rgba(56, 189, 248, 0.2);
  --badge-border: rgba(56, 189, 248, 0.5);
  --badge-text: #bae6fd;
  --orb-1: #0284c7;
  --orb-2: #64748b;
  --orb-3: #38bdf8;
}

/* Font & Radius Presets */
[data-style="cyber-mono"] {
  --font-active: 'IBM Plex Mono', monospace;
  --tile-radius: 12px;
  --tile-inner-radius: 8px;
}
[data-style="luxury-tech"] {
  --font-active: 'Outfit', sans-serif;
  --tile-radius: 34px;
  --tile-inner-radius: 22px;
}
[data-style="arcade-sci"] {
  --font-active: 'Cabinet Grotesk', 'Space Grotesk', sans-serif;
  --tile-radius: 6px;
  --tile-inner-radius: 4px;
}

/* Global resets for pure native mobile app behavior */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg-canvas);
  background-image: var(--bg-gradient);
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--text-primary);
  font-family: var(--font-active);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ambient Liquid Background Glow */
.app-liquid-ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  will-change: transform;
  animation: orbDrift 20s infinite alternate ease-in-out;
}

.ambient-orb-1 {
  width: 320px;
  height: 320px;
  background: var(--orb-1);
  top: -60px;
  left: -50px;
  animation-duration: 18s;
}

.ambient-orb-2 {
  width: 380px;
  height: 380px;
  background: var(--orb-2);
  bottom: -90px;
  right: -70px;
  animation-duration: 22s;
}

.ambient-orb-3 {
  width: 240px;
  height: 240px;
  background: var(--orb-3);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 15s;
  opacity: 0.22;
}

@keyframes orbDrift {
  0% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-30px) scale(1.12) rotate(15deg); }
  100% { transform: translateY(20px) scale(0.92) rotate(-10deg); }
}

/* App Viewport Root */
.app-viewport {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: env(safe-area-inset-top, 12px) 16px env(safe-area-inset-bottom, 14px);
  overflow: hidden;
}

/* Header Component */
.app-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px;
  z-index: 20;
}

.app-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 12px var(--glass-shadow);
  transition: transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.15s ease, background 0.15s ease;
}

/* Thumb sinking on header buttons */
.app-icon-btn:active,
.app-icon-btn.is-pressing {
  transform: scale(0.88) translateZ(-8px);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.app-icon-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  filter: drop-shadow(0 0 12px var(--accent-glow));
  transition: transform 0.2s ease;
}

.app-brand-text {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.4), 0 2px 4px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s ease;
}

.app-header-logo {
  height: 38px;
  width: auto;
  max-width: 175px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s ease;
}

.app-header-brand:active .app-brand-mark,
.app-header-brand:active .app-brand-text,
.app-header-brand:active .app-header-logo {
  transform: scale(0.92);
}

/* Bento Block Container */
.app-bento-shell {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  perspective: 1200px;
}

.app-bento-grid {
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  padding: var(--bento-padding);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--tile-radius) + 8px);
  box-shadow: 0 24px 48px var(--glass-shadow),
              inset 0 1px 2px rgba(255, 255, 255, 0.25),
              inset 0 -1px 2px rgba(0, 0, 0, 0.4);
  animation: bentoFloat 8s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes bentoFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-5px) rotate(0.15deg); }
}

/* Individual Bento Tile */
.bento-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  padding: 10px 6px;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--tile-radius);
  color: var(--text-primary);
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35),
              inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2),
              box-shadow 0.16s ease,
              background 0.2s ease,
              border-color 0.2s ease,
              filter 0.16s ease;
  transform: translateZ(0);
}

/* Hover glow on supported devices */
@media (hover: hover) {
  .bento-tile:hover {
    background: var(--card-glass-hover);
    border-color: var(--glass-border-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 22px var(--accent-glow), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  }
}

/* SINKING THUMB PRESS EFFECT (Extreme Physical Tactile Feedback) */
.bento-tile:active,
.bento-tile.is-pressing {
  transform: scale(0.90) translateZ(-16px) translateY(3px) !important;
  background: var(--card-glass-active) !important;
  border-color: var(--glass-border) !important;
  box-shadow: inset 0 8px 18px rgba(0, 0, 0, 0.75),
              inset 0 1px 3px rgba(255, 255, 255, 0.4),
              0 2px 5px rgba(0, 0, 0, 0.4) !important;
  filter: brightness(0.9) saturate(125%);
}

.bento-tile-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px var(--accent-glow));
  transition: transform 0.2s ease;
  color: var(--text-accent);
}

.bento-tile-icon svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bento-tile:active .bento-tile-icon,
.bento-tile.is-pressing .bento-tile-icon {
  transform: scale(0.85);
}

.bento-tile-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.bento-tile-tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  line-height: 1;
}

/* Feature styling for Special Offers */
.bento-tile.tile-special {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(168, 85, 247, 0.18) 100%);
  border-color: rgba(236, 72, 153, 0.4);
}
.bento-tile.tile-special .bento-tile-icon {
  color: #f43f5e;
  filter: drop-shadow(0 2px 10px rgba(244, 63, 94, 0.6));
}
.bento-tile.tile-special .bento-tile-tag {
  background: rgba(236, 72, 153, 0.3);
  border-color: rgba(236, 72, 153, 0.6);
  color: #fbcfe8;
}

/* Interactive Tiles 8 & 9 */
.bento-tile.tile-interactive {
  border-style: dashed;
  border-color: var(--accent-primary);
}

/* Priya Redesigned Assistant Dock */
.app-priya-dock {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: calc(var(--tile-radius) + 2px);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 10px 24px var(--glass-shadow);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  z-index: 20;
}

.app-priya-dock:active,
.app-priya-dock.is-pressing {
  transform: scale(0.96) translateZ(-8px);
  box-shadow: inset 0 6px 14px rgba(0,0,0,0.6);
}

.priya-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 0 16px var(--accent-glow);
  flex-shrink: 0;
}

.priya-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.priya-pulse-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--accent-primary);
  opacity: 0.6;
  animation: priyaPulse 2.4s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
  pointer-events: none;
}

@keyframes priyaPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}

.priya-dock-meta {
  flex: 1;
  margin-left: 16px;
  display: flex;
  align-items: center;
}

.priya-dock-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.priya-dock-action {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Modal Shells (Checkout & Priya Assistant) - Centered Floating Glass Dialog */
.app-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.app-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.app-modal-sheet {
  width: 100%;
  max-width: 440px;
  max-height: 90dvh;
  background: #0d1117;
  background-image: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.18) 0%, #090d14 65%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 1px rgba(255, 255, 255, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.2s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-modal-backdrop.is-open .app-modal-sheet {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.app-sheet-grabber {
  display: none;
}

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

.app-sheet-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.app-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

/* Form Fields inside Modal */
.app-field {
  margin-bottom: 14px;
}

.app-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.app-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-input:focus {
  border-color: var(--accent-primary);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 12px var(--accent-glow);
}

.app-btn-submit {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-btn-submit:active {
  transform: scale(0.94) translateZ(-8px);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Special Offers Grid (3x3 - 9 Offers) */
.special-offers-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
  aspect-ratio: 1 / 1;
  padding: var(--bento-padding);
}

.special-offer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 4px;
  background: var(--card-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--tile-radius);
  cursor: pointer;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: transform 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.15s ease;
}

.special-offer-card:active,
.special-offer-card.is-pressing {
  transform: scale(0.90) translateZ(-14px) !important;
  box-shadow: inset 0 6px 14px rgba(0,0,0,0.7), inset 0 1px 2px rgba(255,255,255,0.4) !important;
}

.special-badge-disc {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  font-weight: 800;
  background: #ef4444;
  color: #fff;
  padding: 1px 4px;
  border-radius: 6px;
}

.special-offer-qty {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.special-offer-type {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 2px;
}

.special-offer-price {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  margin-top: 4px;
}

.special-offer-original {
  font-size: 9px;
  color: #64748b;
  text-decoration: line-through;
  margin-left: 2px;
}
