/**
 * AxesKit Icons Studio & Explorer Stylesheet
 * Faithful Lucide-inspired Architecture:
 * - High-density grid lines (Zero Cards!)
 * - Pure off-white/white background (#ffffff / #fafafa)
 * - Zero glassmorphism, zero noisy blur
 * - Live customizer sidebar (Color, Stroke Width, Size, Non-scaling)
 * - Fast inspection modal with copy SVG/JSX/JSON and download SVG/PNG
 */

:root {
  --icon-color: #111827;
  --icon-size: 24px;
  --icon-stroke: 2px;
  --icon-vector-effect: none;
}

body.icons-page-body {
  background: #ffffff;
  color: #111827;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Header Adjustments on Icons Page */
.icons-page-body .app-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Main Studio Layout (2-column: Sidebar 260px, Main Grid Flex-1) */
.lucide-layout {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 65px);
  padding: 24px 28px;
  gap: 28px;
}

/* ==========================================================================
   1. Left Sidebar: Customizer & Category Hierarchy
   ========================================================================== */
.lucide-sidebar {
  width: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Customizer Card (Clean Flat Border, Red/Coral Active Accent) */
.lucide-customizer-card {
  background: #ffffff;
  border: 1px solid #fecaca; /* Lucide signature light coral/red border */
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.customizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.customizer-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.customizer-reset-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6b7280;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, transform 0.2s ease;
}

.customizer-reset-btn:hover {
  color: #111827;
  transform: rotate(-45deg);
}

.customizer-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customizer-label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-val-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #6b7280;
  font-family: var(--font-mono, monospace);
}

/* Color input preview box */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.color-swatch-box input[type="color"] {
  position: absolute;
  inset: -10px;
  width: 50px;
  height: 50px;
  opacity: 0;
  cursor: pointer;
}

.color-hex-tag {
  font-size: 12px;
  color: #6b7280;
  font-family: var(--font-mono, monospace);
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Range Slider */
.lucide-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  outline: none;
}

.lucide-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444; /* Lucide accent */
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.lucide-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Switch toggle */
.customizer-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lucide-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
}

.lucide-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.lucide-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e5e7eb;
  transition: 0.2s ease;
  border-radius: 18px;
}

.lucide-switch .slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.lucide-switch input:checked + .slider {
  background-color: #ef4444;
}

.lucide-switch input:checked + .slider:before {
  transform: translateX(14px);
}

/* Category Hierarchy list */
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 8px;
  padding-left: 6px;
}

.category-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 360px);
  overflow-y: auto;
}

.category-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: #4b5563;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.category-nav-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.category-nav-item.active {
  background: #fef2f2;
  color: #ef4444;
  font-weight: 600;
}

.cat-count {
  font-size: 11px;
  color: #9ca3af;
  font-family: var(--font-mono, monospace);
}

.category-nav-item.active .cat-count {
  color: #ef4444;
}

/* ==========================================================================
   2. Main Area: Toolbar + Dense Grid Lines (Zero Cards!)
   ========================================================================== */
.lucide-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.lucide-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lucide-search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lucide-search-box:focus-within {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.lucide-search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: #111827;
  background: transparent;
}

.search-kbd-hint {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.lucide-view-options {
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-category-label {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.results-count-badge {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 3px 8px;
  border-radius: 12px;
}

/* High-Density Spreadsheet-Style Grid (Zero Cards!) */
.lucide-grid-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lucide-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  border-top: 1px solid #e5e7eb;
  border-left: 1px solid #e5e7eb;
  background: #ffffff;
}

.lucide-icon-cell {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.1s ease;
  position: relative;
}

.lucide-icon-cell:hover {
  background: #f9fafb;
}

.lucide-icon-cell svg {
  width: var(--icon-size, 24px);
  height: var(--icon-size, 24px);
  stroke: var(--icon-color, #111827);
  stroke-width: var(--icon-stroke, 2px);
  vector-effect: var(--icon-vector-effect, none);
  transition: stroke 0.12s ease, width 0.12s ease, height 0.12s ease;
}

.lucide-icon-cell img {
  width: clamp(28px, var(--icon-size, 32px), 38px);
  height: clamp(28px, var(--icon-size, 32px), 38px);
  border-radius: 7px;
  object-fit: contain;
  transition: transform 0.12s ease;
}

.lucide-icon-cell:hover img {
  transform: scale(1.06);
}

/* Tooltip on hover */
.lucide-icon-cell[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #ffffff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Pagination bar */
.lucide-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px 0;
}

.page-indicator {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

/* ==========================================================================
   3. Lucide Inspection Modal / Detail Window
   ========================================================================== */
.lucide-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(2px);
}

.lucide-modal-window {
  width: 600px;
  max-width: 90vw;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f3f4f6;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #111827;
}

.modal-cat-tag {
  font-size: 11.5px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

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

.modal-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  padding: 24px;
  gap: 24px;
  align-items: start;
}

.modal-preview-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px 16px;
  gap: 16px;
  min-height: 220px;
}

.modal-preview-canvas {
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-preview-canvas svg {
  width: 64px;
  height: 64px;
  stroke: var(--icon-color, #111827);
  stroke-width: var(--icon-stroke, 2px);
  vector-effect: var(--icon-vector-effect, none);
}

.modal-preview-specs {
  font-size: 11px;
  color: #6b7280;
  font-family: var(--font-mono, monospace);
  text-align: center;
  line-height: 1.5;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

/* Modal Actions & Exporters */
.modal-actions-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.export-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  transition: all 0.12s ease;
}

.export-action-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.export-action-btn.primary {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.export-action-btn.primary:hover {
  background: #000000;
}

.download-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.download-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.04em;
}

.download-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.png-download-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.png-download-group select {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #111827;
}

.modal-tags-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tags-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #9ca3af;
  letter-spacing: 0.04em;
}

.tags-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-chip {
  font-size: 11px;
  color: #4b5563;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Subcategory Accordion in Sidebar */
.category-master-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.category-master-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.category-master-item.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.category-master-item.active .cat-count {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.subcategories-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 12px;
  margin-top: 4px;
  margin-bottom: 6px;
  border-left: 2px solid #e5e7eb;
}

.subcategory-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  color: #4b5563;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}

.subcategory-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.subcategory-item.active {
  background: #fef2f2;
  color: #ef4444;
  font-weight: 600;
}

.subcategory-item.active .cat-count {
  color: #ef4444;
  background: #fee2e2;
}

/* Audio Table Rows (Dense Spreadsheet Style) */
.lucide-audio-table {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.lucide-audio-header {
  display: grid;
  grid-template-columns: 48px 1fr 180px 100px 110px;
  padding: 10px 16px;
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

/* Audio Table & Rows */
.lucide-audio-table {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  margin-bottom: 24px;
}

.audio-table-head {
  display: grid;
  grid-template-columns: 48px 1fr 180px 100px 140px;
  padding: 10px 16px;
  align-items: center;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
}

.lucide-audio-row {
  display: grid;
  grid-template-columns: 48px 1fr 180px 100px 140px;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s ease;
  cursor: pointer;
}

.lucide-audio-row:hover {
  background: #f9fafb;
}

.audio-play-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.audio-play-circle:hover {
  transform: scale(1.08);
  background: #000000;
}

/* Font Specimen Rows */
.lucide-font-table {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.lucide-font-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.12s ease;
  cursor: pointer;
}

.lucide-font-row:hover {
  background: #f9fafb;
}

.font-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.font-row-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.font-row-sample {
  font-size: 20px;
  line-height: 1.3;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navbar Search Instant Results Dropdown */
.nav-search-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  z-index: 260;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.nav-search-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fafafa;
  border-bottom: 1px solid #e5e7eb;
  font-size: 11.5px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.12s ease;
  text-decoration: none;
  color: #111827;
}

.nav-search-item:hover {
  background: #f9fafb;
}

.nav-search-item-preview {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-search-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.nav-search-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-search-item-sub {
  font-size: 11px;
  color: #6b7280;
}

.nav-search-view-all {
  padding: 12px 14px;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: #0ea5e9;
  cursor: pointer;
  text-decoration: none;
}

.nav-search-view-all:hover {
  background: #f3f4f6;
}

/* Toast */
.lucide-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111827;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  z-index: 400;
}

/* Modal Audio Stage */
.modal-audio-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
}
.modal-audio-large-play {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.modal-audio-large-play:hover {
  transform: scale(1.06);
  background: #000000;
}
.modal-audio-wave-bars {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 28px;
}
.modal-audio-wave-bars .bar {
  width: 4px;
  background: #9ca3af;
  border-radius: 2px;
  animation: pulseWave 1.2s infinite ease-in-out;
}
.modal-audio-wave-bars .bar.b1 { height: 12px; animation-delay: 0.1s; }
.modal-audio-wave-bars .bar.b2 { height: 22px; animation-delay: 0.2s; }
.modal-audio-wave-bars .bar.b3 { height: 16px; animation-delay: 0.3s; }
.modal-audio-wave-bars .bar.b4 { height: 26px; animation-delay: 0.4s; }
.modal-audio-wave-bars .bar.b5 { height: 20px; animation-delay: 0.5s; }
.modal-audio-wave-bars .bar.b6 { height: 14px; animation-delay: 0.6s; }
.modal-audio-wave-bars .bar.b7 { height: 24px; animation-delay: 0.7s; }
.modal-audio-wave-bars .bar.b8 { height: 10px; animation-delay: 0.8s; }

@keyframes pulseWave {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1.3); }
}

/* Modal Font Stage */
.modal-font-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Responsive */
@media (max-width: 900px) {
  .lucide-layout {
    flex-direction: column;
    padding: 16px;
  }
  .lucide-sidebar {
    width: 100%;
  }
  .modal-body {
    grid-template-columns: 1fr;
  }
}
