/* ============================
   LBV Smart — Store Hub
   Premium Light Design + AlpaPOS
   ============================ */

:root {
  --bg-primary: #f5f5f8;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 1);

  --text-primary: #1a1625;
  --text-secondary: rgba(26, 22, 37, 0.55);
  --text-muted: rgba(26, 22, 37, 0.32);

  --color-navy: #1a1625;
  --color-navy-light: #2d2640;
  --color-navy-lighter: #3d3555;

  --accent-primary: #ef4444;
  --accent-secondary: #f97066;
  --accent-gradient: linear-gradient(135deg, #ef4444 0%, #f97066 100%);
  --accent-soft: rgba(239, 68, 68, 0.06);

  --color-online: #16a34a;
  --color-offline: #ef4444;
  --color-checking: #d97706;

  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-card: rgba(0, 0, 0, 0.06);

  --shadow-card: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.02), 0 0 0 1px rgba(0,0,0,0.03);
  --shadow-card-hover: 0 8px 28px rgba(239,68,68,0.07), 0 4px 14px rgba(0,0,0,0.05), 0 0 0 1px rgba(239,68,68,0.08);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-xs: 0.7rem;
  --font-sm: 0.8rem;
  --font-base: 0.875rem;
  --font-md: 1rem;
  --font-lg: 1.15rem;
  --font-xl: 1.35rem;
  --font-2xl: 1.75rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 200ms;
  --duration-normal: 350ms;
  --duration-slow: 600ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* --- Background Effects --- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(26,22,37,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26,22,37,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: 0;
  pointer-events: none;
}

.bg-glow-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(239,68,68,0.05), transparent 70%);
  top: -12%; left: -6%;
  animation: floatGlow 20s ease-in-out infinite;
  opacity: 0.6;
}

.bg-glow-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(26,22,37,0.04), transparent 70%);
  bottom: -8%; right: -6%;
  animation: floatGlow 25s ease-in-out infinite reverse;
  opacity: 0.5;
}

.bg-glow-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(239,68,68,0.025), transparent 70%);
  top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  animation: pulseGlow 8s ease-in-out infinite;
  opacity: 0.5;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(25px, -18px); }
  66% { transform: translate(-18px, 22px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.15); }
}

/* --- App --- */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================================
   HEADER — Dark Navy
   ================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-light) 100%);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.header-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px var(--space-xl, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px; height: 38px;
  flex-shrink: 0;
  background: var(--accent-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(239,68,68,0.3);
  animation: brandGlow 3s ease-in-out infinite;
}

.brand-icon svg { width: 20px; height: 20px; }

@keyframes brandGlow {
  0%, 100% { box-shadow: 0 2px 10px rgba(239,68,68,0.25); }
  50% { box-shadow: 0 4px 20px rgba(239,68,68,0.4); }
}

.brand-name {
  font-size: var(--font-lg);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-tagline {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.live-clock {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.status-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.6);
  padding: 5px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 100px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}

/* Dots */
.dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-loading { background: var(--color-checking); animation: dotPulse 1.5s ease-in-out infinite; }
.dot-online { background: var(--color-online); box-shadow: 0 0 6px rgba(22,163,74,0.5); }
.dot-offline { background: var(--color-offline); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.dot-partial { background: var(--color-checking); box-shadow: 0 0 6px rgba(217,119,6,0.5); }

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

/* ================================
   MAIN CONTENT
   ================================ */
.main {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero */
.hero-section {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.hero-title {
  font-size: var(--font-2xl);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 340px;
  margin: 0 auto;
  line-height: 1.5;
}

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

/* ================================
   CARDS GRID
   ================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 640px;
}

/* Store Card */
.store-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out),
    background var(--duration-normal) var(--ease-out);
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.store-card:nth-child(1) { animation-delay: 0.15s; }
.store-card:nth-child(2) { animation-delay: 0.3s; }

/* Gradient border on hover */
.store-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  padding: 1.5px;
  background: var(--accent-gradient);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

.store-card:hover {
  transform: translateY(-5px);
  border-color: rgba(239,68,68,0.1);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-card-hover);
}

.store-card:hover::before { opacity: 0.45; }

.store-card:active { transform: translateY(-1px); transition-duration: 100ms; }

/* Offline state */
.store-card.is-offline {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.6);
}
.store-card.is-offline .card-footer { opacity: 0.3; }

/* Status Badge */
.card-status {
  position: absolute;
  top: 10px; right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  transition: all var(--duration-normal) var(--ease-out);
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.status-checking { background: var(--color-checking); animation: dotPulse 1.5s ease-in-out infinite; }
.status-online { background: var(--color-online); box-shadow: 0 0 6px rgba(22,163,74,0.4); animation: none; }
.status-offline { background: var(--color-offline); box-shadow: 0 0 6px rgba(239,68,68,0.4); animation: none; }
.status-text { color: var(--text-secondary); }

.card-status.is-online { border-color: rgba(22,163,74,0.12); background: rgba(240,253,244,0.95); }
.card-status.is-online .status-text { color: var(--color-online); }
.card-status.is-offline { border-color: rgba(239,68,68,0.12); background: rgba(254,242,242,0.95); }
.card-status.is-offline .status-text { color: var(--color-offline); }

/* Illustration */
.card-illustration {
  width: 100%;
  height: 115px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-illustration-1 {
  background: linear-gradient(180deg, rgba(239,68,68,0.025) 0%, transparent 100%);
}
.card-illustration-2 {
  background: linear-gradient(180deg, rgba(26,22,37,0.025) 0%, transparent 100%);
}

.store-svg {
  width: 72%;
  max-width: 200px;
  height: auto;
  transition: transform var(--duration-slow) var(--ease-out);
}

.store-card:hover .store-svg { transform: scale(1.07); }

/* Top accent line on hover */
.card-illustration::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}
.store-card:hover .card-illustration::after { opacity: 0.8; }

/* Card Body */
.card-body {
  padding: 12px 16px 4px;
}

.card-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.63rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 3px;
}
.card-location svg { opacity: 0.45; width: 11px; height: 11px; }

.card-title {
  font-size: var(--font-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  color: var(--color-navy);
}

.card-desc {
  font-size: var(--font-xs);
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.4;
}

/* Card Footer */
.card-footer {
  padding: 8px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid rgba(0,0,0,0.03);
}

.card-link-text {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--duration-fast) var(--ease-out);
}

.card-footer svg {
  color: var(--text-muted);
  transition: color var(--duration-fast), transform var(--duration-normal) var(--ease-spring);
}

.store-card:hover .card-link-text { color: var(--accent-primary); }
.store-card:hover .card-footer svg { color: var(--accent-primary); transform: translateX(3px); }

/* ================================
   FOOTER — Same as Header (Dark Navy)
   ================================ */
.footer {
  background: linear-gradient(180deg, var(--color-navy-light) 0%, var(--color-navy) 100%);
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 1.25rem 2rem;
  box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
}

.footer-content {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.35);
  font-weight: 400;
}

.footer-version {
  font-size: var(--font-xs);
  color: rgba(255,255,255,0.25);
  font-variant-numeric: tabular-nums;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  :root {
    --font-2xl: 1.5rem;
    --font-xl: 1.1rem;
    --font-lg: 0.95rem;
  }

  .header-content { padding: 10px 1rem; }
  .brand-icon { width: 32px; height: 32px; border-radius: 8px; }
  .brand-icon svg { width: 17px; height: 17px; }
  .brand-name { font-size: var(--font-md); }
  .header-meta { gap: 0.5rem; }
  .live-clock { display: none; }

  .main { padding: 1.5rem 1rem; }
  .hero-section { margin-bottom: 1.5rem; }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 380px;
  }

  .card-illustration { height: 100px; }
  .card-body { padding: 10px 14px 3px; }
  .card-footer { padding: 6px 14px 12px; }

  .footer { padding: 1rem; }
  .footer-content { flex-direction: column; gap: 2px; text-align: center; }
}

@media (max-width: 400px) {
  :root {
    --font-2xl: 1.3rem;
    --font-lg: 0.9rem;
  }

  .brand-icon { width: 28px; height: 28px; }
  .brand-name { font-size: var(--font-base); }
  .status-summary { padding: 4px 8px; font-size: 0.6rem; }
  .store-card { border-radius: var(--radius-lg); }
  .card-illustration { height: 88px; }
  .card-status { top: 8px; right: 8px; padding: 3px 8px; font-size: 0.58rem; }
}

/* Print */
@media print {
  .bg-grid, .bg-glow { display: none; }
  .store-card { break-inside: avoid; }
}
