/* ==========================================================================
   CRAFTERSMC BAZAAR MARKET EXPLORER — NEO-BRUTALISM THEME STYLESHEET
   High-contrast, bold borders, hard offset shadows, darkmode & lightmode
   ========================================================================== */

:root {
  --bazaar-border: 2px solid #111827;
  --bazaar-shadow: 4px 4px 0 #111827;
  --bazaar-shadow-sm: 2.5px 2.5px 0 #111827;
  --bazaar-shadow-lg: 6px 6px 0 #111827;
}

/* Hero Section */
.bazaar-hero-card {
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 5px 5px 0 #111827;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .bazaar-hero-card {
    padding: 18px 16px;
    margin-bottom: 18px;
  }
}

.bazaar-search-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 18px;
  width: 100%;
  box-sizing: border-box;
}

.bazaar-search-grid .input-field-group {
  flex: 1 1 320px;
  min-width: 0;
  margin-bottom: 0;
  width: 100%;
}

.bazaar-search-grid .btn-fetch,
.bazaar-search-grid .btn-secondary-action {
  height: 44px;
  padding: 0 20px;
  white-space: nowrap;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .bazaar-search-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .bazaar-search-grid .input-field-group {
    flex: none;
    width: 100%;
  }

  .bazaar-search-grid .btn-fetch,
  .bazaar-search-grid .btn-secondary-action {
    width: 100%;
    justify-content: center;
  }
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.bazaar-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 2px solid #111827;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  box-shadow: 2.5px 2.5px 0 #111827;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.bazaar-input:focus {
  border-color: #111827;
  box-shadow: 4px 4px 0 #38bdf8;
  transform: translate(-1px, -1px);
}

.bazaar-input::placeholder {
  color: #9ca3af;
  font-weight: 500;
}

.search-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1.25rem;
  pointer-events: none;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 8px;
  box-shadow: 4px 4px 0 #111827;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.autocomplete-dropdown.open {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px dashed #e2e8f0;
  transition: background 0.1s ease;
  font-size: 0.88rem;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: #fef9c3;
  color: #111827;
  font-weight: 800;
}

/* Item Detail Card */
.bazaar-detail-card {
  background: #ffffff;
  border: 2.5px solid #111827;
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 6px 6px 0 #111827;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .bazaar-detail-card {
    padding: 18px 16px;
  }
}

.item-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 2px dashed #111827;
}

.item-title-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-main-name {
  font-size: 1.45rem;
  font-weight: 900;
  color: #111827;
  letter-spacing: -0.02em;
  text-transform: capitalize;
}

.item-id-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  color: #111827;
  background: #fef08a;
  border: 1.5px solid #111827;
  box-shadow: 1.5px 1.5px 0 #111827;
  border-radius: 6px;
  padding: 2px 8px;
  margin-top: 4px;
}

/* 4-Column Quick Stats Grid */
.bazaar-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-box {
  background: #f8fafc;
  border: 2px solid #111827;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 3px 3px 0 #111827;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-box:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #111827;
}

.stat-box-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #4b5563;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-box-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 900;
  color: #111827;
  margin: 2px 0 4px 0;
}

.stat-box-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

/* Flip Calculation Bar */
.flip-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 18px;
  background: #fefce8;
  border: 2px solid #111827;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 4px 4px 0 #111827;
}

.flip-calc-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flip-calc-box-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #a16207;
  letter-spacing: 0.04em;
}

.flip-calc-box-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 900;
  color: #15803d;
}

/* Live Order Books Side-by-Side */
.order-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.order-book-card {
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 4px 4px 0 #111827;
  overflow: hidden;
}

.order-book-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 2px dashed #111827;
}

.order-book-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 800;
}

.order-book-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.order-book-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
  padding: 6px 8px;
  border-bottom: 1.5px solid #111827;
}

.order-book-table th:last-child,
.order-book-table td:last-child {
  text-align: right;
}

.order-book-table td {
  padding: 8px 8px;
  border-bottom: 1px dashed #e2e8f0;
  font-family: var(--font-mono);
  font-weight: 700;
  position: relative;
}

.order-book-table tr:hover td {
  background: #f8fafc;
}

/* Chart Container Box */
.chart-container-box {
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 4px 4px 0 #111827;
  margin-top: 20px;
}

.chart-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px dashed #111827;
}

.chart-btn-group {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  border: 1.5px solid #111827;
  box-shadow: 1.5px 1.5px 0 #111827;
}

.chart-filter-btn {
  padding: 5px 12px;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chart-filter-btn:hover {
  background: #ffffff;
  color: #111827;
  border-color: #111827;
}

.chart-filter-btn.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
  box-shadow: 2px 2px 0 #38bdf8;
}

.chart-wrapper {
  position: relative;
  height: 340px;
  width: 100%;
}

/* Catalog Card */
.catalog-card {
  background: #ffffff;
  border: 2px solid #111827;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 5px 5px 0 #111827;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .catalog-card {
    padding: 16px;
  }
}

.table-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 2px dashed #111827;
}

.catalog-table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 2px solid #111827;
  border-radius: 8px;
  box-shadow: 2.5px 2.5px 0 #111827;
}

.bazaar-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
  min-width: 680px;
}

.bazaar-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-weight: 900;
  color: #111827;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #111827;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.1s ease;
}

.bazaar-table th:hover {
  background: #fef9c3;
  color: #0284c7;
}

.bazaar-table td {
  padding: 10px 14px;
  border-bottom: 1px dashed #e2e8f0;
  white-space: nowrap;
}

.bazaar-table tr:hover td {
  background: #fefce8;
}

.table-item-name {
  font-weight: 700;
  color: #111827;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-btn-chart {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #38bdf8;
  border: 1.5px solid #111827;
  border-radius: 6px;
  color: #111827;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 1.5px 1.5px 0 #111827;
}

.table-btn-chart:hover {
  background: #7dd3fc;
  transform: translate(-1px, -1px);
  box-shadow: 2.5px 2.5px 0 #111827;
}

/* ==========================================================================
   BAZAAR DARK MODE STYLES (Pitch Black Neo-Brutalism)
   ========================================================================== */

.darkmode .bazaar-hero-card {
  background: #000000 !important;
  border-color: #27272a !important;
  box-shadow: 4px 4px 0 #000000 !important;
  color: #ffffff !important;
}

.darkmode .bazaar-input {
  background: #0d0d0d !important;
  color: #ffffff !important;
  border-color: #27272a !important;
  box-shadow: 2px 2px 0 #000000 !important;
}

.darkmode .bazaar-input:focus {
  border-color: #fde047 !important;
  box-shadow: 3px 3px 0 #000000 !important;
}

.darkmode .autocomplete-dropdown {
  background: #0d0d0d !important;
  border-color: #27272a !important;
  box-shadow: 4px 4px 0 #000000 !important;
}

.darkmode .autocomplete-item {
  color: #ffffff !important;
  border-bottom: 1px dashed #27272a !important;
}

.darkmode .autocomplete-item:hover,
.darkmode .autocomplete-item.active {
  background: #18181b !important;
  color: #38bdf8 !important;
}

.darkmode .bazaar-detail-card {
  background: #000000 !important;
  border-color: #27272a !important;
  box-shadow: 5px 5px 0 #000000 !important;
  color: #ffffff !important;
}

.darkmode .item-header-row {
  border-bottom: 2px dashed #27272a !important;
}

.darkmode .item-main-name {
  color: #ffffff !important;
}

.darkmode .item-id-pill {
  background: #422006 !important;
  color: #fde047 !important;
  border-color: #eab308 !important;
  box-shadow: 1.5px 1.5px 0 #000000 !important;
}

.darkmode .stat-box {
  background: #0d0d0d !important;
  border-color: #27272a !important;
  box-shadow: 3px 3px 0 #000000 !important;
}

.darkmode .stat-box:hover {
  border-color: #fde047 !important;
  box-shadow: 4px 4px 0 #000000 !important;
}

.darkmode .stat-box-title {
  color: #a1a1aa !important;
}

.darkmode .stat-box-value {
  color: #ffffff;
}

.darkmode .stat-box-subtitle {
  color: #71717a !important;
}

.darkmode .flip-calc-grid {
  background: #1c1917 !important;
  border-color: #eab308 !important;
  box-shadow: 4px 4px 0 #000000 !important;
}

.darkmode .flip-calc-box-title {
  color: #fde047 !important;
}

.darkmode .flip-calc-box-value {
  color: #4ade80 !important;
}

.darkmode .order-book-card {
  background: #0d0d0d !important;
  border-color: #27272a !important;
  box-shadow: 3.5px 3.5px 0 #000000 !important;
  color: #ffffff !important;
}

.darkmode .order-book-header {
  border-bottom: 2px dashed #27272a !important;
}

.darkmode .order-book-table th {
  color: #a1a1aa !important;
  border-bottom: 1.5px solid #27272a !important;
}

.darkmode .order-book-table td {
  border-bottom: 1px dashed #27272a !important;
  color: #ffffff !important;
}

.darkmode .order-book-table tr:hover td {
  background: #18181b !important;
}

.darkmode .chart-container-box {
  background: #0d0d0d !important;
  border-color: #27272a !important;
  box-shadow: 4px 4px 0 #000000 !important;
}

.darkmode .chart-controls-row {
  border-bottom: 2px dashed #27272a !important;
}

.darkmode .chart-btn-group {
  background: #18181b !important;
  border-color: #27272a !important;
  box-shadow: 1.5px 1.5px 0 #000000 !important;
}

.darkmode .chart-filter-btn {
  color: #a1a1aa !important;
}

.darkmode .chart-filter-btn:hover {
  background: #27272a !important;
  color: #ffffff !important;
  border-color: #3f3f46 !important;
}

.darkmode .chart-filter-btn.active {
  background: #38bdf8 !important;
  color: #000000 !important;
  border-color: #000000 !important;
  box-shadow: 2px 2px 0 #000000 !important;
}

.darkmode .catalog-card {
  background: #000000 !important;
  border-color: #27272a !important;
  box-shadow: 4px 4px 0 #000000 !important;
  color: #ffffff !important;
}

.darkmode .table-filter-bar {
  border-bottom: 2px dashed #27272a !important;
}

.darkmode .catalog-table-responsive {
  border-color: #27272a !important;
  box-shadow: 2.5px 2.5px 0 #000000 !important;
}

.darkmode .bazaar-table th {
  background: #18181b !important;
  color: #ffffff !important;
  border-bottom: 2px solid #27272a !important;
}

.darkmode .bazaar-table th:hover {
  background: #27272a !important;
  color: #38bdf8 !important;
}

.darkmode .bazaar-table td {
  border-bottom: 1px dashed #27272a !important;
  color: #ffffff !important;
}

.darkmode .bazaar-table tr:hover td {
  background: #18181b !important;
}

.darkmode .table-item-name {
  color: #ffffff !important;
}

.darkmode .table-btn-chart {
  background: #38bdf8 !important;
  color: #000000 !important;
  border-color: #000000 !important;
  box-shadow: 1.5px 1.5px 0 #000000 !important;
}

.darkmode .table-btn-chart:hover {
  background: #7dd3fc !important;
  box-shadow: 2.5px 2.5px 0 #000000 !important;
}

/* Collapsible Raw JSON Details */
.neo-json-details {
  background: #f8fafc;
  border: 2px solid #111827;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 3px 3px 0 #111827;
  transition: all 0.15s ease;
}

.neo-json-details summary {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.neo-json-details summary:hover {
  color: #0284c7;
}

.json-pre-box {
  background: #0f172a;
  color: #38bdf8;
  border: 1.5px solid #111827;
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
}

.darkmode .neo-json-details {
  background: #0d0d0d !important;
  border-color: #27272a !important;
  box-shadow: 3px 3px 0 #000000 !important;
  color: #ffffff !important;
}

.darkmode .neo-json-details summary {
  color: #ffffff !important;
}

.darkmode .neo-json-details summary:hover {
  color: #38bdf8 !important;
}

.darkmode .json-pre-box {
  background: #000000 !important;
  border-color: #27272a !important;
  color: #38bdf8 !important;
}

/* ==========================================================================
   GOOGLE MATERIAL ICONS SYSTEM (LIGHT & DARK MODE)
   ========================================================================== */

/* Light Mode Defaults & Specific Accents */
.neo-hero-bar-title .material-icons {
  color: #111827;
}

.neo-filter-label .material-icons {
  color: #0284c7;
}

.bazaar-filter-chip .material-icons {
  color: #64748b;
  vertical-align: middle;
}

.bazaar-filter-chip:hover .material-icons,
.bazaar-filter-chip.active .material-icons {
  color: #111827;
}

.bazaar-status-bar .material-icons {
  color: #2563eb;
}

.table-btn-chart .material-icons {
  color: #000000 !important;
}

.neo-json-details summary .material-icons {
  color: #0284c7;
}

/* Dark Mode Overrides */
.darkmode .search-input-icon {
  color: #38bdf8 !important;
}

.darkmode .neo-hero-bar-title .material-icons {
  color: #ffffff !important;
}

.darkmode .neo-filter-label .material-icons {
  color: #38bdf8 !important;
}

.darkmode .bazaar-filter-chip .material-icons {
  color: #a1a1aa !important;
}

.darkmode .bazaar-filter-chip:hover .material-icons {
  color: #ffffff !important;
}

.darkmode .bazaar-filter-chip.active .material-icons {
  color: #000000 !important;
}

.darkmode .bazaar-status-bar .material-icons {
  color: #60a5fa !important;
}

.darkmode .table-btn-chart .material-icons {
  color: #000000 !important;
}

.darkmode .neo-json-details summary .material-icons {
  color: #38bdf8 !important;
}


