/* Catalog Dashboard Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Hind+Siliguri:wght@500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --accent: #e11d48;
  --accent-hover: #be123c;
  --bg: #090d16;
  --surface: #111827;
  --surface-card: #1e293b;
  --surface-border: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', 'Hind Siliguri', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Header & Hero */
.catalog-header {
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, var(--bg) 70%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 40px 20px 30px;
  text-align: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(79, 70, 229, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.catalog-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.catalog-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 24px;
}

/* Stats Row */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.stat-pill {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--surface-border);
  padding: 8px 18px;
  border-radius: 9999px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill strong {
  color: #38bdf8;
  font-weight: 700;
}

/* Controls: Search & Filters */
.controls-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

.search-bar-wrap {
  position: relative;
  max-width: 650px;
  margin: 0 auto 24px;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  color: #fff;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* Categories Pills */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.cat-btn {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-btn:hover {
  color: #fff;
  border-color: #64748b;
  background: #1e293b;
}

.cat-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.cat-count {
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 9999px;
}

/* Grid of Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding-bottom: 60px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #4f46e5;
  box-shadow: 0 12px 30px -10px rgba(79, 70, 229, 0.25);
}

/* Card Preview Box */
.card-preview {
  position: relative;
  height: 210px;
  background: #1e293b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s;
}

.product-card:hover .card-preview img {
  transform: scale(1.04);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #a5b4fc;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
}

.format-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(225, 29, 72, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.btn-view {
  flex: 1;
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.btn-view:hover {
  background: var(--primary-hover);
}

.btn-quick {
  background: #334155;
  color: #fff;
  border: none;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-quick:hover {
  background: #475569;
}

.btn-download-action {
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.btn-download-action.btn-html {
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}

.btn-download-action.btn-html:hover {
  background: #2563eb;
  color: #fff;
}

.btn-download-action.btn-json {
  background: rgba(225, 29, 72, 0.18);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af;
}

.btn-download-action.btn-json:hover {
  background: #e11d48;
  color: #fff;
}

/* Quick View Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

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

.modal-container {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  width: 95vw;
  max-width: 1200px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 14px 20px;
  background: #0f172a;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.viewport-controls {
  display: flex;
  background: #1e293b;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.vp-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}

.vp-btn.active {
  background: var(--primary);
  color: #fff;
}

.modal-body {
  flex: 1;
  background: #0b0f19;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

.modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  transition: width 0.3s;
}

.modal-iframe.mobile {
  width: 390px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-iframe.tablet {
  width: 768px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.btn-close-modal:hover {
  color: #fff;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
