/* assets/css/style.css - JimpitQR Premium Mobile-First Glassmorphism Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  /* Light Theme Colors */
  --bg-main: #f3f6fc;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.7);
  --bg-glass-border: rgba(226, 232, 240, 0.8);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(79, 70, 229, 0.25);

  --emerald: #10b981;
  --emerald-light: #d1fae5;
  --emerald-dark: #065f46;

  --amber: #f59e0b;
  --amber-light: #fef3c7;

  --rose: #ef4444;
  --rose-light: #fee2e2;

  --slate-border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --bottom-nav-height: 68px;
}

[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(26, 35, 54, 0.95);
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-glass-border: rgba(51, 65, 85, 0.6);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --emerald: #34d399;
  --emerald-light: rgba(16, 185, 129, 0.15);
  --emerald-dark: #6ee7b7;

  --amber: #fbbf24;
  --amber-light: rgba(245, 158, 11, 0.15);

  --rose: #f87171;
  --rose-light: rgba(239, 68, 68, 0.15);

  --slate-border: #1e293b;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  padding-bottom: var(--bottom-nav-height);
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Header & Top Navbar */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bg-glass-border);
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin-left: 2.5rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Bottom Navigation Bar for HP / Mobile (< 768px) */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--bg-glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding: 0 0.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.725rem;
  font-weight: 600;
  gap: 4px;
  width: 20%;
  padding: 0.35rem 0;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  position: relative;
}

.mobile-nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

.mobile-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  width: 40%;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 4px 4px;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

/* Floating Scan FAB Button in Mobile Nav */
.mobile-nav-scan-fab {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white !important;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
  box-shadow: 0 8px 20px var(--primary-glow);
  border: 3px solid var(--bg-main);
  transition: transform 0.2s ease;
}

.mobile-nav-scan-fab:active {
  transform: scale(0.92);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 44px; /* Touch friendly */
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6366f1);
  color: white;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #4f46e5);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald), #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-glass-border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--slate-border);
}

.btn-danger {
  background: var(--rose-light);
  color: var(--rose);
}

.btn-danger:hover {
  background: #fecaca;
}

/* Stat Cards */
.stat-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0.8;
}

.stat-card.emerald::before { background: var(--emerald); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.rose::before { background: var(--rose); }

.stat-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.stat-desc {
  font-size: 0.825rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-emerald { background: var(--emerald-light); color: var(--emerald); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-amber { background: var(--amber-light); color: var(--amber); }
.badge-rose { background: var(--rose-light); color: var(--rose); }
.badge-gray { background: var(--bg-glass-border); color: var(--text-muted); }

/* Sticky Column Table for HP & Desktop */
.table-responsive-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-glass-border);
}

.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.table-custom th, .table-custom td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--bg-glass-border);
  text-align: left;
  white-space: nowrap;
}

.table-custom th {
  background: var(--bg-glass);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Sticky First Column for Mobile Calendar Matrix */
.table-matrix th:first-child,
.table-matrix td:first-child {
  position: sticky;
  left: 0;
  z-index: 20;
  background: var(--bg-card);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05);
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-matrix th:first-child {
  z-index: 30;
  background: var(--bg-glass);
}

.table-custom tr:hover td {
  background: var(--primary-light);
}

/* Modal / Bottom-Sheet for Mobile QR Scanner */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 520px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: var(--radius-lg);
    transform: scale(0.95);
  }
}

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

@media (min-width: 640px) {
  .modal-overlay.active .modal-content {
    transform: scale(1);
  }
}

/* Quick-Tap Nominal Buttons Grid */
.quick-tap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0;
}

.btn-quick-nom {
  background: var(--bg-glass-border);
  border: 1px solid var(--slate-border);
  color: var(--text-main);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.btn-quick-nom:hover, .btn-quick-nom.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-quick-nom.zero-btn {
  background: var(--rose-light);
  color: var(--rose);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-quick-nom.zero-btn:hover {
  background: var(--rose);
  color: white;
}

/* Print Styles for QR Code Stickers */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
    padding: 0 !important;
  }
  
  .glass-card {
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  
  .sticker-grid-print {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5cm !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .sticker-card {
    page-break-inside: avoid !important;
    border: 2px solid #000 !important;
    border-radius: 12px !important;
    padding: 1.25rem !important;
    text-align: center !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-glass-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}
