/* ===== Mandar Catalog — Custom Styles ===== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #020617;
  color: #e2e8f0;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* ---------- Animated gradient background ---------- */
.hero-gradient {
  position: relative;
  overflow: hidden;
}
.hero-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(236,101,48,.20), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(255,174,110,.10), transparent),
    radial-gradient(ellipse 60% 40% at 20% 50%, rgba(143,221,223,.08), transparent);
  pointer-events: none;
  z-index: 0;
}
.hero-gradient > * {
  position: relative;
  z-index: 1;
}

/* ---------- Grid dots pattern ---------- */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(236,101,48,.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ---------- Glass nav ---------- */
.glass-nav {
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.3s ease;
}
.glass-nav.scrolled {
  background: rgba(2, 6, 23, 0.92);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

/* ---------- Category Card ---------- */
.category-card {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(236,101,48,0.08);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(236,101,48,0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.category-card:hover::before {
  opacity: 1;
}
.category-card:hover {
  border-color: rgba(236,101,48,0.35);
  transform: translateY(-4px);
  box-shadow:
    0 20px 40px rgba(0,0,0,0.3),
    0 0 40px rgba(236,101,48,0.1);
}
.category-card .card-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
}
.category-card:hover .card-icon {
  background: #EC6530 !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(236,101,48,0.4);
}
.category-card:hover .card-title {
  color: #FFAE6E;
}
.category-card:hover .card-arrow {
  color: #FFAE6E;
  transform: translate(2px, -2px);
}

/* ---------- Stat Card ---------- */
.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  text-align: center;
  transition: border-color 0.3s ease;
}
.stat-card:hover {
  border-color: rgba(236,101,48,0.2);
}

/* ---------- Search Input ---------- */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
}
.search-wrapper input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.25rem;
  background: rgba(15,23,42,0.8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.875rem;
  color: #e2e8f0;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease;
}
.search-wrapper input::placeholder {
  color: #64748b;
}
.search-wrapper input:focus {
  border-color: #EC6530;
  box-shadow: 0 0 0 3px rgba(236,101,48,0.15), 0 0 30px rgba(236,101,48,0.08);
  background: rgba(15,23,42,1);
}
.search-wrapper .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
  transition: color 0.3s ease;
}
.search-wrapper input:focus ~ .search-icon {
  color: #EC6530;
}
.search-wrapper .search-kbd {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.25rem;
}
.search-wrapper .search-kbd kbd {
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
  font-family: inherit;
}

/* ---------- Spider web canvas ---------- */
#spider-web {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Search autocomplete dropdown ---------- */
.search-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(236,101,48,0.06);
  z-index: 50;
  max-height: 360px;
  overflow-y: auto;
  display: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.search-autocomplete.open {
  display: block;
  animation: acDrop 0.2s ease;
}
@keyframes acDrop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-autocomplete .ac-header {
  padding: 0.625rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.search-autocomplete .ac-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  text-decoration: none;
  color: #cbd5e1;
  font-size: 0.875rem;
  transition: background 0.15s ease;
  cursor: pointer;
}
.search-autocomplete .ac-item:hover,
.search-autocomplete .ac-item.ac-active {
  background: rgba(236,101,48,0.08);
}
.search-autocomplete .ac-item .ac-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(236,101,48,0.1);
  color: #EC6530;
  flex-shrink: 0;
}
.search-autocomplete .ac-item .ac-text {
  flex: 1;
  min-width: 0;
}
.search-autocomplete .ac-item .ac-name {
  font-weight: 500;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-autocomplete .ac-item .ac-name mark {
  background: transparent;
  color: #EC6530;
  font-weight: 700;
}
.search-autocomplete .ac-item .ac-desc {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-autocomplete .ac-item .ac-arrow {
  color: #475569;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.search-autocomplete .ac-item:hover .ac-arrow {
  color: #EC6530;
  transform: translateX(2px);
}
.search-autocomplete .ac-footer {
  padding: 0.5rem 1rem;
  font-size: 0.6875rem;
  color: #475569;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.search-autocomplete .ac-footer kbd {
  background: rgba(30,41,59,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 0.25rem;
  padding: 0.0625rem 0.375rem;
  font-size: 0.625rem;
  font-family: inherit;
  color: #64748b;
}

/* ---------- Pulse ring on logo ---------- */
.logo-pulse {
  position: relative;
}
.logo-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 0.625rem;
  border: 2px solid rgba(236,101,48,0.3);
  animation: pulse-ring 2.5s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ---------- Table styles (catalog page) ---------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
.data-table thead th {
  background: #0f172a;
  padding: 0.875rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.data-table thead th:hover {
  color: #e2e8f0;
}
.data-table thead th.sorted-asc,
.data-table thead th.sorted-desc {
  color: #FFAE6E;
}
.data-table tbody tr {
  transition: background 0.2s ease;
}
.data-table tbody tr:hover {
  background: rgba(236,101,48,0.04);
}
.data-table tbody td {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-green {
  background: rgba(34,197,94,0.1);
  color: #4ade80;
}
.badge-yellow {
  background: rgba(234,179,8,0.1);
  color: #facc15;
}
.badge-red {
  background: rgba(239,68,68,0.1);
  color: #f87171;
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.badge-green .badge-dot { background: #4ade80; }
.badge-yellow .badge-dot { background: #facc15; }
.badge-red .badge-dot { background: #f87171; }

/* ---------- Filter chips ---------- */
.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.25s ease;
}
.filter-chip:hover {
  border-color: rgba(236,101,48,0.3);
  color: #e2e8f0;
}
.filter-chip.active {
  background: #EC6530;
  border-color: #EC6530;
  color: #fff;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb a:hover {
  color: #FFAE6E;
}

/* ---------- Fade-in animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Button ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  background: #EC6530;
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.btn-primary:hover {
  background: #D4541F;
  box-shadow: 0 0 24px rgba(236,101,48,0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: transparent;
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}
.btn-ghost:hover {
  border-color: rgba(236,101,48,0.3);
  color: #e2e8f0;
  background: rgba(236,101,48,0.05);
}

/* ---------- Mobile nav ---------- */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2,6,23,0.95);
  backdrop-filter: blur(20px);
  padding: 5rem 2rem 2rem;
  flex-direction: column;
  gap: 0.5rem;
  animation: slideDown 0.3s ease;
}
.mobile-menu.open {
  display: flex;
}
.mobile-menu a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 1.125rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  transition: background 0.2s ease;
}
.mobile-menu a:hover {
  background: rgba(236,101,48,0.1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Mobile hamburger ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 200;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Count-up animation ---------- */
.count-up {
  display: inline-block;
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.06);
}
.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #64748b;
}
.empty-state svg {
  margin: 0 auto 1rem;
  opacity: 0.4;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.page-btn {
  min-width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  color: #94a3b8;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.page-btn:hover {
  border-color: rgba(236,101,48,0.3);
  color: #e2e8f0;
}
.page-btn.active {
  background: #EC6530;
  border-color: #EC6530;
  color: #fff;
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .data-table .desc-col {
    display: none;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .nav-links {
    display: none !important;
  }
  .hero-title {
    font-size: 2rem !important;
  }
  .hero-sub {
    font-size: 1rem !important;
  }
  .search-wrapper .search-kbd {
    display: none;
  }
  .stat-card {
    padding: 1rem 1.25rem;
  }
  .data-table tbody td,
  .data-table thead th {
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
  }
  .filter-chip {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
  }
  .breadcrumb {
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.625rem !important;
  }
  .hero-sub {
    font-size: 0.9375rem !important;
  }
  .category-card {
    padding: 1.25rem;
  }
  .data-table tbody td,
  .data-table thead th {
    padding: 0.625rem 0.75rem;
    font-size: 0.75rem;
  }
  .page-btn {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(236,101,48,0.3);
  color: #fff;
}

/* ---------- Focus visible ---------- */
:focus-visible {
  outline: 2px solid #EC6530;
  outline-offset: 2px;
}

/* ---------- Smooth image/icon loading ---------- */
img, svg {
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
}
