/* Sidebar Layout - Modern Left Navigation */

/* Remove top navigation since we're using sidebar */
.ah-nav,
nav.ah-nav {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
}

/* Main layout container */
body {
  margin: 0;
  padding: 0;
  display: flex;
  min-height: 100vh;
  overflow: hidden; /* prevent page/body scroll; main-content will scroll */
  background: transparent;
}

/* Background is underlay, content above background */
.sidebar, .main-content { position: relative; z-index: 2; }

/* Hide mobile header/backdrop on desktop (769px+) */
@media (min-width: 769px) {
  .mobile-header { display: none !important; }
  .sidebar-backdrop { display: none !important; }
}

/* Left Sidebar */
.sidebar {
  width: 240px;
  background: transparent;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0 12px 12px 0;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
}

/* Mobile sidebar styles are handled in mobile-optimized.css */

.sidebar-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
}

/* Logo */
.sidebar-logo {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo img {
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

/* Navigation */
.sidebar-nav {
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.nav-item span {
  flex: 1;
  min-width: 0;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active {
  background: linear-gradient(135deg, #007AFF 0%, #5AC8FA 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.nav-item.active:hover {
  background: linear-gradient(135deg, #5AC8FA 0%, #007AFF 100%);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* User Section */
.sidebar-user {
  padding: 20px 12px 12px 20px;
  border-top: none;
  border-bottom: none;
  margin-bottom: 12px;
}

/* Reduce spacing on iPad */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar-user {
    margin-bottom: 6px;
    padding: 16px 12px 10px 20px;
  }
  
  .sidebar-user #sidebarUser {
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
}

/* Email (user name) area gets its own divider below it */
.sidebar-user #sidebarUser {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

/* Hide auth UI and protected links by default to prevent flicker; nav-global.js will reveal when authed */
.sidebar-user #sidebarUser { display: none; }
.sidebar-user #sidebarLogout { display: none; }
.sidebar a[href="mydecks.html"],
.sidebar a[href="campaigns.html"],
.sidebar a[href="deck-dashboard.html"] { display: none; }

/* Footer Links */
.sidebar-footer {
  padding: 12px 12px 12px 20px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Reduce spacing on iPad */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar-footer {
    padding: 8px 12px 8px 20px;
    margin-top: 4px;
  }
}

.sidebar-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 11px;
  line-height: 1.4;
}

/* Better scaling for iPad */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar-footer-links {
    gap: 6px 10px;
    font-size: 10px;
    line-height: 1.3;
  }
}

.sidebar-footer-links a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-footer-links a:hover {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

.user-action {
  display: block;
  width: calc(100% - 20px); /* keep a small gap on the right */
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff !important; /* Always white text */
  text-decoration: none;
  text-align: center;
  font-weight: 700; /* bold for consistency */
  font-size: 13px;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 8px;
}

.user-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff !important; /* Always white text on hover */
}

/* Main Content */
.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 20px;
  padding-top: 20px !important; /* Ensure consistent top spacing from viewport */
  position: relative;
  overflow-x: hidden;
  height: 100vh;               /* make it a viewport-height scroll container */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Consistent top spacing from viewport top - matching expansions page */
/* The expansions page has: main-content padding-top (20px) + container padding-top (20px) + h1 margin-top (24px) = 64px total from viewport top */
/* For visual consistency, ALL pages should have 64px total spacing from the top of the viewport */
/* This ensures all content starts at the same vertical position across all pages */

/* Pages WITH containers: ensure container has padding-top: 20px and consistent width/alignment */
.main-content > .expansions-container,
.main-content > .campaigns-container,
.main-content > .investigators-container,
.main-content > .campaign-log-container,
.main-content > .setup-container,
.main-content > .admin-container,
.main-content > .rules-container {
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 20px !important;
  padding-top: 20px !important;
  margin-top: 0 !important;
  box-sizing: border-box !important;
}

/* Ensure first h1 in containers has margin-top: 24px (matching expansions page) - override inline styles */
.main-content > .expansions-container > h1.page-title:first-child,
.main-content > .campaigns-container > h1.page-title:first-child,
.main-content > .investigators-container > h1:first-child,
.main-content > .campaign-log-container > *:first-child > h1.page-title:first-child,
.main-content > .setup-container > h1:first-child,
.main-content > .admin-container > h1:first-child,
.main-content > .rules-container > h1:first-child {
  margin-top: 24px !important;
}

/* Pages WITHOUT containers: add 44px margin-top and ensure consistent left alignment */
/* Exclude cards page (.classBar and .filtersBar should not have max-width on cards page) */
/* Exclude login/register and settings pages (they should have narrower width) */
.main-content > .wrap:first-child:not(.expansions-container):not(.campaigns-container):not(.investigators-container):not(.campaign-log-container):not(.setup-container):not(.admin-container):not(.rules-container):not(:has(.panel)),
.main-content > .container:first-child:not(.expansions-container):not(.campaigns-container):not(.investigators-container):not(.campaign-log-container):not(.setup-container):not(.admin-container):not(.rules-container):not(:has(.panel)) {
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 44px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* Narrower width for login/register and settings pages */
.main-content > .wrap:first-child:has(.panel),
.main-content > #bg + .wrap:has(.panel),
.main-content > .wrap:has(.panel) {
  max-width: 520px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0 10px !important;
  box-sizing: border-box !important;
}

/* For pages where background element (#bg) is first, target the next content element */
/* Exclude login/register and settings pages (they should have narrower width) */
.main-content > #bg + .wrap:not(.expansions-container):not(.campaigns-container):not(.investigators-container):not(.campaign-log-container):not(.setup-container):not(.admin-container):not(.rules-container):not(:has(.panel)),
.main-content > #bg + .container:not(.expansions-container):not(.campaigns-container):not(.investigators-container):not(.campaign-log-container):not(.setup-container):not(.admin-container):not(.rules-container):not(:has(.panel)) {
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 44px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* Handle any other first-child elements that aren't containers or background elements */
.main-content > *:first-child:not(.wallpaper-background):not(#bg):not(.expansions-container):not(.campaigns-container):not(.investigators-container):not(.campaign-log-container):not(.setup-container):not(.admin-container):not(.rules-container):not(.classBar):not(.filtersBar):not(.wrap):not(.container) {
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 44px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  box-sizing: border-box !important;
}

/* Note: classBar and filtersBar alignment is handled above in "Pages WITHOUT containers" section */

/* Faction Bar */
.classBar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  box-sizing: border-box;
}

.classBar .reset-btn{
  margin-left: auto;
  padding: 6px 10px;
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.2) 0%, rgba(255, 59, 48, 0.15) 100%);
  color: #ff6b6b;
  border: 1px solid rgba(255, 59, 48, 0.4);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.classBar .chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  color: rgba(255, 255, 255, 0.5);
  opacity: 0.6;
}

.classBar .chip:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.8;
  transform: translateY(-1px);
}

/* Active state - more prominent since all are on by default */
.classBar .chip.active {
  background: transparent;
  color: #ffffff;
  border-color: cadetblue;
  opacity: 1;
}

/* Faction icon colors - match faction colors using font icons */
.classBar .chip[data-cls="guardian"] .arkham-icon {
  color: #4169E1;
  font-size: 16px;
  margin-right: 6px;
  display: inline-block;
  line-height: 1;
}

.classBar .chip[data-cls="seeker"] .arkham-icon {
  color: #D2691E;
  font-size: 16px;
  margin-right: 6px;
  display: inline-block;
  line-height: 1;
}

.classBar .chip[data-cls="rogue"] .arkham-icon {
  color: #32CD32;
  font-size: 16px;
  margin-right: 6px;
  display: inline-block;
  line-height: 1;
}

.classBar .chip[data-cls="mystic"] .arkham-icon {
  color: #9370DB;
  font-size: 16px;
  margin-right: 6px;
  display: inline-block;
  line-height: 1;
}

.classBar .chip[data-cls="survivor"] .arkham-icon {
  color: #E63946;
  font-size: 16px;
  margin-right: 6px;
  display: inline-block;
  line-height: 1;
}

.classBar .chip[data-cls="neutral"] .arkham-icon {
  color: #808080;
  font-size: 16px;
  margin-right: 6px;
  display: inline-block;
  line-height: 1;
}

.classBar .chip[data-cls="neutral"] img {
  height: 16px;
  width: 16px;
  margin-right: 6px;
  filter: brightness(1.2) saturate(1.3);
}

/* Active faction chips get brighter colors */
.classBar .chip.active[data-cls="guardian"] .arkham-icon {
  color: #5a7ff0;
}

.classBar .chip.active[data-cls="seeker"] .arkham-icon {
  color: #e68a4d;
}

.classBar .chip.active[data-cls="rogue"] .arkham-icon {
  color: #4de64d;
}

.classBar .chip.active[data-cls="mystic"] .arkham-icon {
  color: #a885e8;
}

.classBar .chip.active[data-cls="survivor"] .arkham-icon {
  color: #ff4d5c;
}

.classBar .chip.active[data-cls="neutral"] .arkham-icon {
  color: #a0a0a0;
}

.classBar .chip.active[data-cls="neutral"] img {
  filter: brightness(1.4) saturate(1.5);
}

/* Horizontal Compact Filters Layout */
.filtersBar {
  --filters-divider-gap: clamp(10px, 2vw, 18px);
  display: flex;
  flex-wrap: wrap;
  background: rgba(28, 28, 30, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0 16px;
  gap: 6px var(--filters-divider-gap);
  max-width: 100%;
  align-items: center;
  justify-content: flex-start; /* left align all content */
  position: sticky;
  top: 80px;
  z-index: 100;
  will-change: transform;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}

/* Ensure all filter buttons are vertically aligned */
.filtersBar .filterGroup,
.filtersBar .filterInputs,
.filtersBar .inputGroup {
  display: flex;
  align-items: center;
}

/* Enhanced glassmorphism background formatting for filtersBar and classBar */
body > div.main-content > div.filtersBar,
#classBar {
  background: rgba(28, 28, 30, 0.7) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  padding: 24px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Centered divider between groups for clearer grouping */
.filtersBar > * {
  position: relative;
}

.filtersBar > * + * {
  margin: 0;
  padding: 0;
}

.filtersBar > * + *::before {
  content: '';
  position: absolute;
  left: calc(var(--filters-divider-gap, 12px) * -0.5);
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
  pointer-events: none;
  border-radius: 999px;
}

/* filterInputs - no left gap, but add divider on the right (middle of bar) */
.filtersBar > .filterInputs {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

.filtersBar > .filterInputs:not(:last-child)::after {
  content: '';
  position: absolute;
  right: calc(var(--filters-divider-gap, 12px) * -0.5);
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
  pointer-events: none;
  border-radius: 999px;
}

.filterRow {
  display: contents;
}

.filterInputs {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-left: 0 !important;
  padding-left: 0 !important;
  margin-right: 0 !important;
  padding-right: 0 !important;
  flex-wrap: nowrap;
  justify-content: flex-start;
  min-width: 0;
  flex: 0 0 auto;
  max-width: none;
}

.filter-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-section label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  min-width: 50px;
}

/* Horizontal inline filter groups */
.filterGroup {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 4px;
}

.filterLabel {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  margin-right: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Horizontal inline Input Groups */
.inputGroup {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 0;
}

/* Broad/Exact buttons - add divider before, align vertically */
#kwModeChips {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  padding-left: 5px;
  margin-left: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.filterInputs .inputGroup:first-child {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
}

.inputGroup label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  white-space: nowrap;
}

.inputGroup input[type="text"] {
  padding: 2px 4px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #eaf2f8;
  border-radius: 2px;
  font-size: 10px;
  outline: none;
  width: 278px;
  height: 18px;
  flex-shrink: 0;
}

.inputGroup input[type="text"]:focus {
  border-color: #6ab7ff;
  box-shadow: 0 0 0 1px rgba(106, 183, 255, 0.3);
}

/* Slider Containers */
.slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Range Sliders */
.range-slider {
  width: 160px;
  height: 4px; /* thinner track */
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;  /* smaller thumb */
  height: 12px;
  background: linear-gradient(135deg, #6ab7ff 0%, #007AFF 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(106, 183, 255, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.range-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #6ab7ff 0%, #007AFF 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.range-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 8px rgba(106, 183, 255, 0.5);
}

.range-slider::-webkit-slider-track {
  background: linear-gradient(to right, #6ab7ff 0%, #6ab7ff 50%, rgba(255, 255, 255, 0.1) 50%);
  height: 3px;
  border-radius: 2px;
}

.range-slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.1);
  height: 4px;
  border-radius: 2px;
  border: none;
}

/* Slider Value Display */
.slider-value {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Icon Chips */
.icon-chips {
  display: flex;
  gap: 4px;
}

.icon-chip {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.icon-chip.active {
  background: rgba(106, 183, 255, 0.2);
  border-color: #6ab7ff;
  box-shadow: 0 0 0 1px rgba(106, 183, 255, 0.3);
}

.icon-chip i {
  font-size: 16px;
}

/* Search Input */
.compact-input {
  width: 200px;
  padding: 6px 12px;
  background: rgba(8, 12, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.compact-input:focus {
  border-color: #6ab7ff;
  box-shadow: 0 0 0 2px rgba(106, 183, 255, 0.2);
}

.compact-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Quick Chips */
.quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-chips > div {
  display: flex;
  gap: 4px;
}

.quick-chip {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.quick-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

.quick-chip.active {
  background: rgba(106, 183, 255, 0.2);
  color: #6ab7ff;
  border-color: #6ab7ff;
}

/* Consistent compact chips */
.filtersBar .chip {
  padding: 2px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  height: 18px;
  min-height: 18px;
  max-height: 18px;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.6;
}

/* Override opacity for slot and icon chips - they manage their own opacity */
.filtersBar #slotChips .chip,
.filtersBar #iconChips .chip {
  opacity: 1 !important;
}

.filtersBar .chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Remove hover effects from slot and icon chips (images only) */
.filtersBar #slotChips .chip:hover,
.filtersBar #iconChips .chip:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

.filtersBar .chip.active {
  background: transparent;
  color: #ffffff;
  border-color: cadetblue;
  opacity: 1;
}

/* Override for slot chips - must come after general .chip.active rule */
.filtersBar #slotChips .chip.active,
#slotChips .chip.active {
  opacity: 1 !important;
  background: transparent;
  border: none;
}

/* Search input in horizontal layout - much shorter */
.filtersBar input {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #eaf2f8;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  flex: 0 0 auto;
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filtersBar input:focus {
  border-color: #6ab7ff;
  box-shadow: 0 0 0 3px rgba(106, 183, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

.filtersBar input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-style: italic;
}

/* Ultra-compact icon sizing */
.filtersBar .chip .arkham-icon {
  font-size: 10px;
  width: 12px;
  height: 12px;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  position: relative;
  top: 0;
}

/* Consistent icon chips - vertically aligned */
.filtersBar #iconChips .chip {
  width: auto;
  height: auto;
  min-width: 0;
  max-width: none;
  padding: 0;
  background: transparent;
  border: none;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  gap: 0;
  flex-shrink: 0;
  display: inline-flex;
  vertical-align: middle;
}

/* Hide text in icon chips, show only icon */
.filtersBar #iconChips .chip {
  font-size: 0;
  text-indent: -9999px;
  overflow: visible;
}

.filtersBar #iconChips .chip .arkham-icon {
  font-size: 24px;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-indent: 0;
  display: block;
  transition: none;
  animation: none;
  vertical-align: middle;
  align-self: center;
}

/* Inactive icon chips - brighter than before but still dimmed */
.filtersBar #iconChips .chip:not(.active) .arkham-icon {
  opacity: 0.6;
  filter: brightness(0.8);
}

/* Active icon chips - full brightness (white) */
.filtersBar #iconChips .chip.active .arkham-icon {
  opacity: 1;
  filter: brightness(1);
  color: #ffffff;
}

/* Stat icon images (PNG) - 24px size, vertically aligned */
.filtersBar #iconChips .chip img,
#iconChips .chip img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  object-position: center;
  display: block;
  max-width: 24px;
  max-height: 24px;
  transition: none;
  animation: none;
  vertical-align: middle;
  align-self: center;
}

/* Inactive stat icon images - darker */
.filtersBar #iconChips .chip:not(.active) img,
#iconChips .chip:not(.active) img {
  opacity: 0.4 !important;
  filter: brightness(0.6) !important;
}

/* Active stat icon images - bright white */
.filtersBar #iconChips .chip.active img,
#iconChips .chip.active img {
  opacity: 1 !important;
  filter: grayscale(1) brightness(3.6) contrast(1.35) !important;
  -webkit-filter: grayscale(1) brightness(3.6) contrast(1.35) !important;
}

/* Slot chips - base styles, NO opacity on container - only on images */
.filtersBar #slotChips .chip,
#slotChips .chip {
  width: auto;
  height: auto;
  min-width: 0;
  max-width: none;
  padding: 0;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
  transition: none;
  cursor: pointer;
  opacity: 1 !important;
  font-size: 0;
  text-indent: -9999px;
  overflow: visible;
}

/* Active slot chips - ensure container has NO opacity changes */
.filtersBar #slotChips .chip.active,
#slotChips .chip.active,
.filtersBar #slotChips > span.chip.active,
#slotChips > span.chip.active {
  opacity: 1 !important;
  background: transparent !important;
  border: none !important;
}

/* Ultra-compact chip images - ensure not cropped */
.filtersBar .chip img {
  width: auto;
  height: auto;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  object-position: center;
  margin-right: 0;
  vertical-align: middle;
}

/* Slot chip specific images - larger, no box, not cropped */
.filtersBar #slotChips .chip img,
#slotChips .chip img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  object-position: center;
  margin-right: 0;
  text-indent: 0;
  display: block;
  max-width: 28px;
  max-height: 28px;
  transition: none;
  animation: none;
}

/* Inactive slot images - opacity 0.4 */
.filtersBar #slotChips .chip:not(.active) img,
#slotChips .chip:not(.active) img,
.filtersBar #slotChips > span.chip:not(.active) > img,
#slotChips > span.chip:not(.active) > img,
#slotChips span.chip:not(.active) img,
.filtersBar #slotChips span.chip:not(.active) img,
span.chip:not(.active)[data-slot] img {
  opacity: 0.4 !important;
}

/* Active slot images - opacity 1, circular border */
.filtersBar #slotChips .chip.active img,
#slotChips .chip.active img,
#slotChips > span.chip.active > img,
.filtersBar #slotChips > span.chip.active > img,
#slotChips span.chip.active img,
.filtersBar #slotChips span.chip.active img,
span.chip.active[data-slot] img {
  opacity: 1 !important;
  border: 1px solid cadetblue !important;
  border-radius: 100% !important;
}


/* Icon-only chips (no text) */
.filtersBar .chip i.arkham-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 16px;
  font-size: 12px;
}

/* Type Chips */
.type-chips {
  display: flex;
  gap: 6px;
}

.type-chip {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.type-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

.type-chip.active {
  background: rgba(106, 183, 255, 0.2);
  color: #6ab7ff;
  border-color: #6ab7ff;
}

/* Modern Reset Button */
.filtersBar .reset-btn { display:none; }

.filtersBar .reset-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.filtersBar .reset-btn:hover {
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.3) 0%, rgba(255, 59, 48, 0.2) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
  border-color: rgba(255, 59, 48, 0.6);
}

.filtersBar .reset-btn:hover::before {
  left: 100%;
}

.filtersBar .reset-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
}

/* Compact Card Count */
.filtersBar #total { display:none; }

/* Legacy styles for compatibility */
.reset-btn {
  padding: 6px 12px;
  background: rgba(255, 59, 48, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.reset-btn:hover {
  background: rgba(255, 59, 48, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
}

.card-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

/* Card Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 300px);
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  min-height: 200px; /* Ensure grid has space */
}

/* Card styling to match existing design */
.card {
  width: 300px;
  background: rgba(10, 15, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  overflow: visible; /* Changed to visible so card is 100% visible */
  position: relative;
  transform-origin: center center;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), 
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1), 
              filter 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.card:hover {
  transform: scale(1.05);
  z-index: 30;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  filter: brightness(1.08);
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  background: #0b1116;
  object-fit: cover;
  object-position: center;
  border-radius: 19px;
}

.card .meta {
  padding: 10px 12px;
}

.card .name {
  font-weight: 800;
  font-size: 16px;
  color: #eaf2f8;
}

.card .sub {
  color: #b9c7d4;
  font-size: 12.5px;
}

.card .stats {
  margin-top: 6px;
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: #b9c7d4;
}

.card .stats span {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.card .stats .exceptional-badge {
  margin-left: auto;
}

/* Loading spinner */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* iPad and smaller desktop screens - Use desktop layout with adjusted sizing */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
  
  .main-content {
    margin-left: 220px;
    padding: 30px;
  }
  
  .compact-input {
    width: 150px;
  }
}

/* Mobile styles are now handled in mobile-optimized.css */




