/* ============================================================
   Zawvee — Public Exploration Dashboard Styles
   Apple-grade, kid-and-school friendly, luminous and modern.
   Zero ALL-CAPS, zero clutter, accessible and fast.
   ============================================================ */

:root {
  --primary: #0071e3;
  --primary-hover: #0077ed;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #93c5fd;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 3px 12px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 14px 34px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.03);
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* App Container */
.zawvee-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.zawvee-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.header-inner {
  max-width: 1280px;
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0071e3 0%, #38bdf8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
  flex-shrink: 0;
}

.brand-logo-icon svg {
  color: #ffffff;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.1;
}

.brand-title span {
  color: #0071e3;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.models-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.models-count-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

/* Main Content */
.zawvee-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Hero Section */
.hero-section {
  text-align: center;
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.hero-heading {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.2;
}

.hero-subheading {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.55;
}

/* Search Box Container */
.search-console {
  width: 100%;
  max-width: 720px;
  margin: 8px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  padding: 5px 6px 5px 18px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-bar-wrap:focus-within {
  border-color: #0071e3;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.search-bar-wrap .search-icon {
  color: #94a3b8;
  margin-right: 10px;
  flex-shrink: 0;
}

.search-input-field {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  color: #0f172a;
  font-family: inherit;
  background: transparent;
  min-width: 0;
}

.search-input-field::placeholder {
  color: #94a3b8;
}

.btn-clear-search {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  margin-right: 8px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-clear-search:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-search-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0071e3;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

.btn-search-submit:hover {
  background: #0077ed;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
}

.btn-search-submit:active {
  transform: translateY(0);
}

/* Suggestion Pills */
.search-chips-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.chips-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.search-chip {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.search-chip:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  transform: translateY(-1px);
}

/* Class Navigation Row (Class 1, Class 2, etc.) */
.navigation-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.filter-row-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  min-width: 75px;
  flex-shrink: 0;
}

.classes-pills-bar,
.subjects-pills-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.class-pill,
.subject-pill {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.class-pill:hover,
.subject-pill:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.class-pill.active,
.subject-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.class-pill-count {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 3px;
}

/* Results Summary Bar */
.results-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  gap: 12px;
  flex-wrap: wrap;
}

.results-count-text {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.results-count-text strong {
  color: #0f172a;
}

.btn-reset-filters {
  background: none;
  border: none;
  font-size: 13px;
  color: #0071e3;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: none;
}

.btn-reset-filters:hover {
  text-decoration: underline;
}

/* Visual Card Grid */
.visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

/* Visual Card */
.visual-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease;
  position: relative;
}

.visual-card:hover {
  transform: translateY(-3px);
  border-color: #93c5fd;
  box-shadow: var(--shadow-hover);
}

.card-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.badge-class {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.badge-subject-science {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
}

.badge-subject-math {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-subject-physics {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #ffedd5;
}

.badge-subject-biology {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #ccfbf1;
}

.badge-subject-earth {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.card-title {
  font-size: 17.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.card-desc {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-card-preview {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-card-preview:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-card-open {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #0071e3;
  border: 1px solid #0071e3;
  color: #ffffff;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.2);
}

.btn-card-open:hover {
  background: #0077ed;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
  transform: translateY(-1px);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  margin-bottom: 4px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 420px;
}

/* Preview Modal with Blurred Backdrop */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.preview-window {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 1000px;
  height: 86vh;
  box-shadow: 0 25px 65px -12px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.preview-topbar {
  padding: 16px 22px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.preview-heading {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.015em;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-preview-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-preview-fullscreen:hover {
  background: #dbeafe;
}

.btn-cancel-preview {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-cancel-preview:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: scale(1.05);
}

.preview-iframe-container {
  flex: 1;
  background: #f1f5f9;
  overflow: hidden;
  position: relative;
}

.preview-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .zawvee-main {
    padding: 20px 14px 48px;
    gap: 22px;
  }
  .hero-heading {
    font-size: 26px;
  }
  .hero-subheading {
    font-size: 14px;
  }
  .navigation-section {
    padding: 14px;
  }
  .filter-row-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .visual-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .preview-modal {
    padding: 0;
  }
  .preview-window {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .btn-preview-fullscreen span {
    display: none;
  }
}
