/* Kasir Pro — POS & Inventory System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --border: #1e1e2e;
  --primary: #f59e0b;
  --primary-glow: #fbbf24;
  --accent: #ef4444;
  --accent-2: #f59e0b;
  --success: #10b981;
  --text: #f1f5f9;
  --text-muted: #64748b;
}

* { box-sizing: border-box; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ─── Animated gradient background ─── */
.gradient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.gradient-bg::before,
.gradient-bg::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: float 20s ease-in-out infinite;
}
.gradient-bg::before {
  background: radial-gradient(circle, #f59e0b, transparent);
  top: -200px;
  left: -100px;
}
.gradient-bg::after {
  background: radial-gradient(circle, #ef4444, transparent);
  bottom: -200px;
  right: -100px;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, -60px) scale(1.1); }
  66% { transform: translate(-50px, 40px) scale(0.95); }
}

/* ─── Glass card ─── */
.glass {
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 20px;
}
.glass:hover {
  border-color: rgba(245, 158, 11, 0.3);
}

/* ─── Gradient text ─── */
.gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Buttons ─── */
.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(245, 158, 11, 0.5);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s;
}
.btn-ghost:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

/* ─── Inputs ─── */
.input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(30, 30, 46, 0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: all 0.2s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  background: rgba(30, 30, 46, 0.8);
}

/* ─── Feature card hover ─── */
.feature-card {
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 20px;
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), transparent 50%);
  opacity: 0;
  transition: opacity 0.4s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 20px 40px -20px rgba(245, 158, 11, 0.2);
}
.feature-card:hover::before {
  opacity: 1;
}
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fade-up-1 { animation-delay: 0.1s; }
.fade-up-2 { animation-delay: 0.2s; }
.fade-up-3 { animation-delay: 0.3s; }
.fade-up-4 { animation-delay: 0.4s; }

/* ─── Progress ring ─── */
.progress-ring {
  transform: rotate(-90deg);
}
.progress-ring__circle {
  stroke-dasharray: 251.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

/* ─── Habit check animation ─── */
@keyframes pop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.pop { animation: pop 0.3s ease; }

/* ─── Badge pulse ─── */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}
.pulse-glow { animation: pulse-glow 2s infinite; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}

/* ═══ MOBILE LAYOUT ═══════════════════════════════════════════════ */

/* ─── Mobile Top Header ─── */
.mobile-header {
  display: none;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidebar-overlay.overlay-show {
  display: block;
  opacity: 1;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 260px;
  min-width: 260px;
  border-right: 1px solid #1e1e2e;
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  z-index: 50;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 24px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
  text-decoration: none;
}
.sidebar-nav-item:hover {
  color: #f1f5f9;
  background: rgba(30, 30, 46, 0.5);
}
.sidebar-nav-item.active {
  color: #fff;
  background: rgba(245, 158, 11, 0.15);
}

.sidebar-user {
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 16px;
  padding: 12px;
  margin-top: 16px;
}

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  padding: 32px;
  overflow: auto;
}

/* ─── Mobile Bottom Nav ─── */
.mobile-bottom-nav {
  display: none;
}

/* ─── Mobile breakpoint ─── */
@media (max-width: 768px) {
  /* Show mobile header */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #1e1e2e;
  }

  .mobile-menu-btn {
    font-size: 24px;
    background: none;
    border: none;
    color: #f1f5f9;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
  }

  /* Sidebar becomes overlay on mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* Main content full width */
  .main-content {
    padding: 16px;
    padding-bottom: 80px; /* space for bottom nav */
  }

  /* Show bottom nav */
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid #1e1e2e;
    z-index: 30;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    text-decoration: none;
    color: #64748b;
    transition: color 0.2s;
  }
  .bottom-nav-item.active {
    color: #fbbf24;
  }
  .bottom-nav-item .text-xs {
    font-size: 10px;
  }

  /* Force single column on mobile */
  .main-content .grid {
    grid-template-columns: 1fr !important;
  }
  .main-content .grid.md\:grid-cols-2,
  .main-content .grid.md\:grid-cols-3,
  .main-content .grid.md\:grid-cols-4,
  .main-content .grid.lg\:grid-cols-3,
  .main-content .grid.lg\:grid-cols-4,
  .main-content .grid.lg\:grid-cols-6 {
    grid-template-columns: 1fr !important;
  }
  /* Keep 2-col for small cards */
  .main-content .grid.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .main-content .grid.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Make text sizes mobile-friendly */
  .main-content h1 {
    font-size: 24px !important;
  }
  .main-content h2 {
    font-size: 18px !important;
  }

  /* Modal full width on mobile */
  .glass.p-6.w-full.max-w-lg,
  .glass.p-6.w-full.max-w-sm,
  .glass.p-6.w-full.max-w-md {
    max-width: 100% !important;
    padding: 20px !important;
    margin: 0 8px !important;
  }

  /* Fix flex layouts */
  .main-content .flex {
    flex-wrap: wrap;
  }
  .main-content .flex.items-center.justify-between {
    flex-wrap: nowrap;
  }
  .main-content .flex.gap-3,
  .main-content .flex.gap-4 {
    gap: 8px;
  }

  /* Table scroll */
  .main-content table {
    font-size: 12px;
  }
  .main-content .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }

  /* Hide oversized elements */
  .main-content .text-5xl { font-size: 32px !important; }
  .main-content .text-4xl { font-size: 28px !important; }
  .main-content .text-3xl { font-size: 22px !important; }
  .main-content .text-2xl { font-size: 18px !important; }
}

/* ─── Small mobile (≤480px) ─── */
@media (max-width: 480px) {
  .main-content {
    padding: 12px;
    padding-bottom: 80px;
  }

  .main-content .p-8 { padding: 12px !important; }
  .main-content .p-6 { padding: 16px !important; }
  .main-content .p-5 { padding: 12px !important; }
  .main-content .p-4 { padding: 12px !important; }

  .main-content .gap-5 { gap: 12px !important; }
  .main-content .gap-4 { gap: 10px !important; }
  .main-content .mb-8 { margin-bottom: 16px !important; }
  .main-content .mb-6 { margin-bottom: 12px !important; }

  .main-content .px-4 { padding-left: 12px !important; padding-right: 12px !important; }
  .main-content .py-2\.5 { padding-top: 8px !important; padding-bottom: 8px !important; }

  .bottom-nav-item .text-xs {
    font-size: 9px;
  }
}

/* ─── Landing page mobile ─── */
@media (max-width: 768px) {
  .text-5xl, .text-6xl, .text-7xl {
    font-size: 32px !important;
  }
  .text-4xl {
    font-size: 24px !important;
  }
  .text-lg, .text-xl {
    font-size: 15px !important;
  }
  .px-6 {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .py-20 {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }
  .pt-16 {
    padding-top: 24px !important;
  }
  .pb-24 {
    padding-bottom: 32px !important;
  }
  .mb-10, .mb-12 {
    margin-bottom: 20px !important;
  }
  .max-w-5xl, .max-w-6xl, .max-w-7xl {
    max-width: 100% !important;
  }
  .max-w-2xl {
    max-width: 100% !important;
  }
  .max-w-4xl, .max-w-lg, .max-w-md, .max-w-sm {
    max-width: 100% !important;
  }
  .grid.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .grid.md\:grid-cols-2,
  .grid.md\:grid-cols-3,
  .grid.lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  .text-center.px-6.pt-16 {
    padding-top: 12px !important;
  }
  .flex.flex-col.sm\:flex-row {
    flex-direction: column !important;
  }
  .sm\:flex-row .gap-4 {
    gap: 10px !important;
  }
  .p-5, .p-8 {
    padding: 16px !important;
  }
  .text-3xl {
    font-size: 20px !important;
  }
  .text-2xl {
    font-size: 18px !important;
  }
}

/* ═══ KASIR PRO SPECIFIC ════════════════════════════════════════ */

/* ─── Product card (POS grid) ─── */
.product-card {
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 30px -10px rgba(245, 158, 11, 0.2);
}
.product-card:active {
  transform: translateY(0) scale(0.96);
}

/* ─── Category filter buttons ─── */
.cat-filter {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(18, 18, 26, 0.6);
  border: 1px solid var(--border);
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-filter:hover {
  color: #f1f5f9;
  border-color: rgba(245, 158, 11, 0.3);
}
.cat-filter.active {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border-color: transparent;
}

/* ─── Disabled button ─── */
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ─── Table responsive ─── */
.table-wrap {
  overflow-x: auto;
}
