/**
 * Item Exchange Platform - Theme Styles
 * Grid layout and responsive design
 */

/* ============================================
   CSS Custom Properties (Variables)
   ============================================ */
:root {
  /* Grid Layout */
  --grid-gap: 24px;
  --grid-columns-mobile: 1;
  --grid-columns-tablet: 3;
  --grid-columns-desktop: 4;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 12px 24px rgba(0, 0, 0, 0.25);

  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Z-index */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 1000;
  --z-toast: 1100;
}

/* ============================================
   Page Header
   ============================================ */
/* Hide default WordPress/theme page titles on exchange pages */
.archive-exchange-items .wp-block-query-title,
.archive-exchange-items .page-title,
.archive-exchange-items .entry-title,
.archive-exchange-items h1.wp-block-post-title,
.single-exchange-item .wp-block-query-title,
.single-exchange-item .page-title,
body.archive.post-type-archive-exchange_item .wp-block-query-title,
body.archive.post-type-archive-exchange_item .archive-title {
  display: none !important;
}

.exchange-page-header {
  background: #000000;
  border-bottom: none;
  padding: 0;
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.exchange-page-title-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 85px;
}

.exchange-page-title {
  margin: 0;
  padding: 0;
  height: 85px;
  line-height: 0;
}

.header-logo-link {
  display: block;
  text-decoration: none;
  transition: opacity 0.3s ease;
  line-height: 0;
  padding: 0;
  margin: 0;
  height: 85px;
}

.header-logo-link:hover {
  opacity: 0.9;
}

.header-logo {
  display: block;
  width: auto;
  height: 85px;
  max-width: 100%;
  margin: 0;
  padding: 0;
  vertical-align: top;
}

@media (max-width: 768px) {
  .exchange-page-title-container {
    height: 60px;
  }

  .exchange-page-title {
    height: 60px;
  }

  .header-logo-link {
    height: 60px;
  }

  .header-logo {
    height: 60px;
    width: auto;
  }
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 20px;
}

.header-actions .button {
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  display: inline-block;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
}

.header-actions .button-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #ffffff !important;
}

.header-actions .button-primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.header-actions .button-secondary {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd !important;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.header-actions .button-secondary:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.6);
  transform: translateY(-2px);
  color: #ffffff !important;
}

.header-actions .button-small {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.exchange-page-title a {
  background: linear-gradient(135deg, #c4b5fd 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.exchange-page-title a:hover {
  opacity: 0.8;
}

/* Header Actions - Mobile Responsive */
@media (max-width: 480px) {
  .header-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .header-actions .button {
    width: 100%;
    max-width: 100%;
  }
}

/* ============================================
   Footer Container
   ============================================ */
footer,
.wp-site-blocks > footer,
.wp-block-template-part footer {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  margin-top: 40px;
  padding: 0;
}

footer > *,
footer .wp-block-group,
footer .wp-block-group__inner-container {
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ============================================
   Archive Layout (Sidebar + Content)
   ============================================ */
.exchange-archive-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  padding: 20px;
  max-width: 1800px;
  margin: 0 auto;
}

.exchange-sidebar {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  padding: 0;
  border-radius: 12px;
  height: fit-content;
  position: sticky;
  top: 20px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.exchange-main-content {
  min-width: 0;
}

/* Mobile: Stack sidebar on top */
@media (max-width: 1024px) {
  .exchange-archive-layout {
    grid-template-columns: 1fr;
  }

  .exchange-sidebar {
    position: static;
  }
}

/* ============================================
   Mobile Filter Drawer
   ============================================ */

/* Mobile Filter Toggle Button - Only visible on mobile */
.mobile-filter-toggle {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 24px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
  transition: all 0.3s ease;
  align-items: center;
  gap: 8px;
}

.mobile-filter-toggle:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.mobile-filter-toggle .filter-icon {
  font-size: 1rem;
}

.mobile-filter-toggle .filter-text {
  font-size: 0.875rem;
}

/* Filter Drawer Overlay */
.filter-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 950;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-drawer-overlay.active {
  opacity: 1;
}

/* Filter Drawer Header - Only visible on mobile */
.filter-drawer-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c4b5fd 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: 0.02em;
}

.drawer-close-btn {
  padding: 8px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 8px;
  color: #c4b5fd;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.drawer-close-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.6);
  color: #ffffff;
}

.drawer-close-btn .close-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* Mobile Drawer Behavior */
@media (max-width: 1024px) {
  /* Show mobile filter toggle button */
  .mobile-filter-toggle {
    display: flex;
  }

  /* Show drawer header on mobile */
  .filter-drawer-header {
    display: flex;
  }

  /* Transform sidebar into slide-in drawer */
  .arcforge-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 400px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    border-right: 1px solid rgba(139, 92, 246, 0.3);
    border-top: none;
    border-left: none;
    border-bottom: none;
  }

  /* Active drawer state */
  .arcforge-sidebar.drawer-open {
    transform: translateX(0);
  }

  /* Make drawer scrollable */
  .arcforge-sidebar .sidebar-form {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }

  /* Adjust Apply Filters button in drawer */
  .arcforge-sidebar .sidebar-actions {
    position: sticky;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 2px solid rgba(139, 92, 246, 0.3);
    z-index: 10;
  }

  .arcforge-sidebar .apply-filters-btn {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
  }
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
  overflow: hidden;
}

/* Desktop: Hide mobile elements and make sidebar sticky */
@media (min-width: 1025px) {
  .mobile-filter-toggle,
  .filter-drawer-overlay,
  .filter-drawer-header {
    display: none !important;
  }

  /* Make sidebar sticky with independent scrolling */
  .arcforge-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Smooth scrolling for sidebar */
  .arcforge-sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) rgba(139, 92, 246, 0.1);
  }

  .arcforge-sidebar::-webkit-scrollbar {
    width: 8px;
  }

  .arcforge-sidebar::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
  }

  .arcforge-sidebar::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
  }

  .arcforge-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
  }
}

/* ============================================
   ArcForge Sidebar Styles
   ============================================ */
.arcforge-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-section {
  padding: 16px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.sidebar-section:last-of-type {
  border-bottom: none;
}

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  background: linear-gradient(135deg, #c4b5fd 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 12px 0;
  letter-spacing: 0.05em;
  text-align: left;
}

.heading-icon {
  color: #a78bfa;
  filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.4));
}

/* Search Input */
.search-input-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px; /* Adjusted for smaller padding */
  top: 50%;
  transform: translateY(-50%);
  color: rgba(167, 139, 250, 0.7);
  font-size: 0.8rem; /* Reduced from 0.875rem */
  pointer-events: none;
  z-index: 1;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px; /* Reduced from 12px 16px 12px 44px */
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  color: #e5e7eb;
  font-size: 0.8rem; /* Reduced from 0.875rem */
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.search-input::placeholder {
  color: #9ca3af;
  opacity: 1;
}

.search-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3), 0 4px 12px rgba(139, 92, 246, 0.2);
  background: rgba(0, 0, 0, 0.6);
}

/* Sort Buttons */
.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-btn {
  padding: 5px 10px; /* Reduced from 6px 12px */
  border-radius: 8px;
  font-size: 0.7rem; /* Reduced from 0.75rem */
  font-weight: 600;
  background: rgba(0, 0, 0, 0.4);
  color: #9ca3af;
  border: 1px solid rgba(139, 92, 246, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}

.sort-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

.sort-btn.active {
  background: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.6);
}

/* Separate Sort Order Toggle Button - compact inline style */
.sort-order-btn {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: auto;
  vertical-align: middle;
}

.sort-order-btn:hover {
  background: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.5);
}

.sort-order-btn .sort-arrow {
  color: #c4b5fd;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: bold;
}

/* Mobile: 2x2 grid layout for sort buttons */
@media (max-width: 640px) {
  .sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sort-btn {
    padding: 8px 12px;
  }

  .sort-order-btn {
    padding: 4px 8px;
  }
}

/* Filter Header */
.filter-header {
  margin-bottom: 12px;
}

.filter-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.toggle-btn {
  font-size: 0.75rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0;
}

.toggle-all {
  color: #10b981;
}

.toggle-all:hover {
  color: #6ee7b7;
}

.toggle-none {
  color: #9ca3af;
}

.toggle-none:hover {
  color: #d1d5db;
}

.toggle-separator {
  color: rgba(139, 92, 246, 0.5);
  font-size: 0.75rem;
}

/* Filter Groups */
.filter-groups {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-category {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-heading {
  font-size: 0.7rem; /* Reduced from 0.75rem */
  font-weight: 700;
  color: rgb(156, 163, 175);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0px;
  padding: 0px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s ease;
  user-select: none;
  position: relative;
}

.category-heading:hover {
  color: rgb(180, 188, 200);
}

.category-heading:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.6);
  outline-offset: 2px;
}

.category-name {
  flex: 1;
  font-size: 0.7rem; /* Reduced from 0.75rem */
  font-weight: 700;
  color: rgb(156, 163, 175);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-chevron {
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  color: rgba(167, 139, 250, 0.7);
  margin-left: 8px;
}

.category-chevron::after {
  content: '▼';
  font-size: 0.65rem;
  display: block;
}

/* Collapsed state */
.filter-category.collapsed .category-chevron {
  transform: rotate(-90deg);
}

.filter-category.collapsed .category-items {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
}

.category-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px; /* Reduced from 8px */
  padding: 0;
  max-height: 2000px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 10px; /* Reduced from 12px */
}

/* Filter Pill Buttons */
.filter-pill {
  padding: 5px 10px; /* Reduced from 6px 12px */
  border-radius: 8px;
  font-size: 0.7rem; /* Reduced from 0.75rem */
  font-weight: 600;
  background: rgba(0, 0, 0, 0.4);
  color: #9ca3af;
  border: 1px solid rgba(139, 92, 246, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.4);
}

.filter-pill.active {
  background: rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.6);
}

/* Mobile: Increased touch targets for filter pills (44x44px minimum) */
@media (max-width: 768px) {
  .filter-pill {
    padding: 10px 14px; /* Keep larger for touch */
    min-height: 44px;
    margin: 6px 4px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .category-items {
    gap: 4px;
  }
}

/* Sidebar Actions */
.sidebar-actions {
  padding: 16px; /* Reduced from 20px */
  display: flex;
  flex-direction: row;
  gap: 12px;
  border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.apply-filters-btn {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.apply-filters-btn:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.clear-filters-btn {
  flex: 1;
  padding: 12px;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-filters-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.5);
}

/* Filter count badge */
.filter-count-badge {
  display: inline;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

/* Sticky filters on mobile */
@media (max-width: 1024px) {
  .sidebar-actions {
    position: sticky;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow: 0 -4px 12px rgba(139, 92, 246, 0.3);
    z-index: var(--z-sticky);
    border-top: 2px solid rgba(139, 92, 246, 0.4);
    margin: 0;
  }
}

/* ============================================
   Grid Layout (ArcForge Style)
   ============================================ */
.exchange-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 20px;
  padding: 0;
}

/* Responsive grid breakpoints */
@media (max-width: 480px) {
  .exchange-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) and (min-width: 481px) {
  .exchange-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1400px) {
  .exchange-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

@media (min-width: 1600px) {
  .exchange-grid {
    grid-template-columns: repeat(10, 1fr);
  }
}

/* ============================================
   Item Card Component (ArcForge Style)
   ============================================ */
.exchange-item-card {
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 2px solid;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Border colors based on rarity/status */
.exchange-item-card.border-legendary {
  border-color: #ffd700; /* Yellow for legendary */
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.exchange-item-card.border-epic {
  border-color: #a335ee; /* Purple for epic */
  box-shadow: 0 0 12px rgba(163, 53, 238, 0.3);
}

.exchange-item-card.border-rare {
  border-color: #0070dd; /* Blue for rare */
  box-shadow: 0 0 12px rgba(0, 112, 221, 0.3);
}

.exchange-item-card.border-uncommon {
  border-color: #9d9d9d; /* Grey for uncommon */
  box-shadow: 0 0 6px rgba(157, 157, 157, 0.2);
}

.exchange-item-card.border-common {
  border-color: #ffffff; /* White for common */
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
}

.exchange-item-card.border-looking-for {
  border-color: #FF9800; /* Orange for looking-for */
}

.exchange-item-card.border-have-extra {
  border-color: #4CAF50; /* Green for have-extra */
}

/* Blueprint items get orange border and text */
.exchange-item-card.is-blueprint {
  border-color: #FF9800 !important; /* Orange for blueprints */
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.3);
}

.exchange-item-card.is-blueprint:hover {
  box-shadow: 0 8px 24px rgba(255, 152, 0, 0.5);
  transform: translateY(-2px);
}

.exchange-item-card.is-blueprint .item-card-title h3 {
  color: #FF9800 !important;
  text-shadow: 0 0 8px rgba(255, 152, 0, 0.4);
}

/* Rarity-based title colors */
.rarity-legendary .item-card-title h3 {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.rarity-epic .item-card-title h3 {
  color: #a335ee;
  text-shadow: 0 0 8px rgba(163, 53, 238, 0.4);
}

.rarity-rare .item-card-title h3 {
  color: #0070dd;
  text-shadow: 0 0 8px rgba(0, 112, 221, 0.4);
}

.rarity-uncommon .item-card-title h3 {
  color: #9d9d9d;
}

.rarity-common .item-card-title h3 {
  color: #ffffff;
}

/* Enhanced hover states with increased glow */
.exchange-item-card.border-legendary:hover {
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.5);
  transform: translateY(-2px);
}

.exchange-item-card.border-epic:hover {
  box-shadow: 0 8px 24px rgba(163, 53, 238, 0.5);
  transform: translateY(-2px);
}

.exchange-item-card.border-rare:hover {
  box-shadow: 0 8px 24px rgba(0, 112, 221, 0.5);
  transform: translateY(-2px);
}

.exchange-item-card.border-uncommon:hover {
  box-shadow: 0 8px 20px rgba(157, 157, 157, 0.4);
  transform: translateY(-2px);
}

.exchange-item-card.border-common:hover {
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Default hover for items without rarity border */
.exchange-item-card:hover {
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

/* Card Link */
.item-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 1;
}

.item-card-link > * {
  pointer-events: auto;
}

/* Card Image */
.item-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.item-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

/* Removed scale animation on hover */

/* Blueprint background - using high resolution 1024x1024 version */
.exchange-item-card.is-blueprint .item-card-image {
  background-image: url('../images/UI_Blueprint_background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Placeholder for missing images */
.item-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.no-image-icon {
  font-size: 3rem;
  opacity: 0.3;
}

/* Card Title */
.item-card-title {
  padding: 10px 8px;
  text-align: center;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
}

.item-card-title h3 {
  font-size: 0.8rem; /* Reduce from 0.875rem */
  font-weight: 600;
  margin: 0;
  color: #ffffff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.exchange-item-title a {
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* Quick Action Buttons */
.item-quick-actions {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.exchange-item-card:hover .item-quick-actions {
  opacity: 1;
  pointer-events: all;
}

.quick-action-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 110px;
  width: 110px;
}

.status-action-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: auto;
  font-family: inherit;
}

.looking-for-btn {
  border: 2px solid #FF9800;
  color: #FF9800;
}

.looking-for-btn:hover {
  background: rgba(255, 152, 0, 0.2);
  border-color: #FFB74D;
  transform: translateY(-2px);
}

.looking-for-btn.active {
  background: rgba(255, 152, 0, 0.3);
  border-color: #FF9800;
  box-shadow: 0 0 12px rgba(255, 152, 0, 0.5);
}

.have-extra-btn {
  border: 2px solid #4CAF50;
  color: #4CAF50;
}

.have-extra-btn:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: #81C784;
  transform: translateY(-2px);
}

.have-extra-btn.active {
  background: rgba(76, 175, 80, 0.3);
  border-color: #4CAF50;
  box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
}

.crafting-graph-btn {
  border: 2px solid #8b5cf6;
  color: #8b5cf6;
}

.crafting-graph-btn:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: #a78bfa;
  transform: translateY(-2px);
}

.crafting-graph-btn.active {
  background: rgba(139, 92, 246, 0.3);
  border-color: #8b5cf6;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

.action-icon {
  font-size: 1rem;
  line-height: 1;
}

.action-icon:empty {
  display: none;
}

.action-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Inline Quantity Controls */
.quick-action-group {
  position: relative;
}

.inline-quantity-controls {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 8px;
  gap: 6px;
  z-index: 100;
  min-width: max-content;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: rgba(26, 26, 26, 0.98);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.inline-quantity-controls.show,
.quick-action-group:hover .inline-quantity-controls {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.inline-quantity-controls .quantity-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 4px;
  color: #c4b5fd;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inline-quantity-controls .quantity-btn:hover {
  background: rgba(139, 92, 246, 0.4);
  border-color: #8b5cf6;
  color: #fff;
}

.inline-quantity-controls .quantity-input {
  width: 50px;
  height: 28px;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  -moz-appearance: textfield;
}

.inline-quantity-controls .quantity-input::-webkit-outer-spin-button,
.inline-quantity-controls .quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.exchange-item-title a:hover {
  text-decoration: underline;
}

/* Card Metadata */
.exchange-item-meta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  margin-top: auto;
}

.exchange-item-meta-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.exchange-item-meta-label {
  font-weight: var(--font-weight-medium);
  opacity: 0.8;
}

.exchange-item-meta-value {
  opacity: 0.9;
}

/* Author Info */
.exchange-item-author {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.exchange-item-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
}

.exchange-item-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exchange-item-author-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

/* Gallery Indicator */
.exchange-item-gallery-indicator {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  z-index: var(--z-base);
}

/* ============================================
   Homepage Player Card Sections
   ============================================ */
.looking-for-grid,
.have-extra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(55px, 65px));
  gap: 8px;
  padding: 12px;
}

.exchange-item-gallery-indicator::before {
  content: '\1F5BC';
  font-size: var(--font-size-sm);
}

/* ============================================
   Filter Controls
   ============================================ */
.exchange-filters {
  background: var(--color-bg-secondary);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

.exchange-filters-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--spacing-md) 0;
}

.exchange-filters-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

@media (min-width: 768px) {
  .exchange-filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .exchange-filters-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.exchange-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.exchange-filter-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  opacity: 0.9;
}

/* ============================================
   Form Elements
   ============================================ */
.exchange-input,
.exchange-select,
.exchange-textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.exchange-input:focus,
.exchange-select:focus,
.exchange-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

.exchange-input::placeholder,
.exchange-textarea::placeholder {
  color: var(--color-text-tertiary);
  opacity: 0.6;
}

.exchange-textarea {
  min-height: 120px;
  resize: vertical;
}

.exchange-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--spacing-md) center;
  padding-right: calc(var(--spacing-md) * 2.5);
}

/* Checkbox and Radio */
.exchange-checkbox,
.exchange-radio {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  user-select: none;
}

.exchange-checkbox input[type="checkbox"],
.exchange-radio input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* File Upload */
.exchange-file-upload {
  position: relative;
  display: inline-block;
}

.exchange-file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0.1px;
  height: 0.1px;
  overflow: hidden;
}

.exchange-file-upload-label {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--color-bg-tertiary);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.exchange-file-upload-label:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}

/* ============================================
   Buttons
   ============================================ */
.exchange-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.exchange-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.exchange-button-primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.exchange-button-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.exchange-button-secondary {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.exchange-button-secondary:hover:not(:disabled) {
  background: var(--color-bg-secondary);
  border-color: var(--color-text-secondary);
}

.exchange-button-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.exchange-button-outline:hover:not(:disabled) {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.exchange-button-small {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-sm);
}

.exchange-button-large {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-lg);
}

.exchange-button-block {
  width: 100%;
}

/* Icon Buttons */
.exchange-button-icon {
  padding: var(--spacing-sm);
  aspect-ratio: 1;
}

/* ============================================
   Loading States
   ============================================ */
.exchange-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  min-height: 200px;
}

.exchange-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: exchange-spin 0.8s linear infinite;
}

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

.exchange-loading-text {
  margin-left: var(--spacing-md);
  color: var(--color-text-secondary);
}

/* Skeleton Loading */
.exchange-skeleton {
  background: linear-gradient(
    90deg,
    var(--color-bg-tertiary) 0%,
    var(--color-bg-secondary) 50%,
    var(--color-bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: exchange-skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes exchange-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   Empty State
   ============================================ */
.exchange-empty-state {
  text-align: center;
  padding: var(--spacing-xl);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 600px;
  margin: var(--spacing-xl) auto;
}

.exchange-empty-state-icon {
  font-size: 4rem;
  opacity: 0.3;
  margin-bottom: var(--spacing-md);
}

.exchange-empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--spacing-sm) 0;
}

.exchange-empty-state-message {
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-lg) 0;
}

/* ============================================
   Pagination
   ============================================ */
.exchange-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xl) var(--spacing-lg);
  flex-wrap: wrap;
}

.exchange-pagination-button {
  min-width: 40px;
  height: 40px;
  padding: var(--spacing-xs) var(--spacing-md);
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.exchange-pagination-button:hover:not(:disabled):not(.active) {
  background: var(--color-bg-tertiary);
  border-color: var(--color-primary);
}

.exchange-pagination-button.active {
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-color: var(--color-primary);
}

.exchange-pagination-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   Accessibility
   ============================================ */
.exchange-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .exchange-filters,
  .exchange-button,
  .exchange-pagination,
  .exchange-item-gallery-indicator {
    display: none !important;
  }

  .item-exchange-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .exchange-item-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid #ccc;
  }

  .exchange-item-card:hover {
    transform: none;
  }
}

/* ============================================
   Responsive Typography
   ============================================ */
@media (max-width: 767px) {
  :root {
    --font-size-xs: 0.7rem;
    --font-size-sm: 0.8rem;
    --font-size-base: 0.9rem;
    --font-size-lg: 1rem;
    --font-size-xl: 1.1rem;
    --font-size-2xl: 1.3rem;
  }

  .exchange-filters,
  .item-exchange-grid {
    padding: var(--spacing-md);
  }
}

/* ============================================
   Utility Classes
   ============================================ */
.exchange-hidden {
  display: none !important;
}

.exchange-visible {
  display: block !important;
}

.exchange-text-center {
  text-align: center;
}

.exchange-text-right {
  text-align: right;
}

.exchange-mt-0 { margin-top: 0 !important; }
.exchange-mt-1 { margin-top: var(--spacing-xs) !important; }
.exchange-mt-2 { margin-top: var(--spacing-sm) !important; }
.exchange-mt-3 { margin-top: var(--spacing-md) !important; }
.exchange-mt-4 { margin-top: var(--spacing-lg) !important; }
.exchange-mt-5 { margin-top: var(--spacing-xl) !important; }

.exchange-mb-0 { margin-bottom: 0 !important; }
.exchange-mb-1 { margin-bottom: var(--spacing-xs) !important; }
.exchange-mb-2 { margin-bottom: var(--spacing-sm) !important; }
.exchange-mb-3 { margin-bottom: var(--spacing-md) !important; }
.exchange-mb-4 { margin-bottom: var(--spacing-lg) !important; }
.exchange-mb-5 { margin-bottom: var(--spacing-xl) !important; }

/* ============================================
   AJAX Filter Loading States
   ============================================ */
#exchange-items-grid {
  position: relative;
  min-height: 200px;
}

#exchange-items-grid.loading {
  opacity: 0.6;
  pointer-events: none;
}

.filter-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  border-radius: 12px;
}

.filter-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(139, 92, 246, 0.2);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: filter-spin 0.8s linear infinite;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

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

/* Smooth transition when content changes */
#exchange-items-grid .exchange-grid,
#exchange-items-grid .exchange-no-results {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   SINGLE ITEM PAGE & CRAFTING GRAPH
   ============================================ */

/* Single Item Layout */
.exchange-single-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 40px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Sidebar with item details */
.exchange-single-sidebar {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 24px;
  border: 2px solid #3a3a3a;
  height: fit-content;
  position: sticky;
  top: 20px;
}

.exchange-single-sidebar .item-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0a0a0a;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 2px solid #8b5cf6;
}

.exchange-single-sidebar .item-image img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.item-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #3a3a3a;
}

.item-meta-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(156, 163, 175);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-meta-value {
  font-size: 0.875rem;
  color: #ffffff;
  font-weight: 600;
}

/* Main content area */
.exchange-single-content {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 32px;
  border: 2px solid #3a3a3a;
}

.exchange-single-content h1 {
  font-size: 2rem;
  color: #ffffff;
  margin: 0 0 16px 0;
}

/* Crafting Graph Section */
.crafting-graph-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 2px solid #3a3a3a;
}

.crafting-graph-section h2 {
  font-size: 1.5rem;
  color: #ffffff;
  margin: 0 0 20px 0;
  background: linear-gradient(135deg, #c4b5fd 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Graph Container */
#crafting-graph-container {
  width: 100%;
  height: 600px;
  background: #0a0a0a;
  border: 2px solid #3a3a3a;
  border-radius: 12px;
  position: relative;
}

/* Graph Controls */
.graph-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  justify-content: center;
}

.graph-controls button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.graph-controls button:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

/* Empty state */
.crafting-graph-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: #b0b0b0;
  text-align: center;
}

.crafting-graph-empty h3 {
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 8px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .exchange-single-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .exchange-single-sidebar {
    position: static;
  }

  #crafting-graph-container {
    height: 500px;
  }
}

@media (max-width: 768px) {
  .exchange-single-content {
    padding: 20px;
  }

  #crafting-graph-container {
    height: 400px;
  }
}

/* ============================================
   Crafting Graph Modal
   ============================================ */
.crafting-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crafting-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.crafting-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  background: linear-gradient(135deg, rgba(10, 15, 30, 0.98) 0%, rgba(20, 25, 40, 0.98) 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crafting-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
}

.crafting-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: #ffffff;
}

.crafting-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.crafting-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.crafting-modal-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#modal-crafting-graph-container {
  width: 100%;
  height: 600px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  position: relative;
}

.loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 1rem;
  opacity: 0.7;
}

/* Modal is visible when not display:none */
.crafting-modal[style*="display: flex"],
.crafting-modal[style*="display:flex"] {
  display: flex !important;
}

/* Responsive modal */
@media (max-width: 1024px) {
  .crafting-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  #modal-crafting-graph-container {
    height: 500px;
  }
}

@media (max-width: 768px) {
  .crafting-modal-content {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .crafting-modal-header {
    padding: 16px 20px;
  }

  .crafting-modal-header h2 {
    font-size: 1.25rem;
  }

  .crafting-modal-body {
    padding: 16px;
  }

  #modal-crafting-graph-container {
    height: 400px;
  }
}

/* ============================================
   Quantity Badge on Active Buttons
   ============================================ */
.quick-action-btn .qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.looking-for-btn.active .qty-badge {
  background: #FF9800;
  color: #000;
}

.have-extra-btn.active .qty-badge {
  background: #4CAF50;
  color: #000;
}

.quick-action-btn.active .action-label {
  font-size: 0.65rem;
}

/* ============================================
   Toast Notification with Action
   ============================================ */
.exchange-notice {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exchange-notice .notice-message {
  flex: 1;
}

.exchange-notice .notice-action {
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.exchange-notice .notice-action:hover {
  background: rgba(255, 255, 255, 0.1);
}

.exchange-notice.success .notice-action {
  border-color: #4CAF50;
  color: #4CAF50;
}

.exchange-notice.success .notice-action:hover {
  background: rgba(76, 175, 80, 0.2);
}

/* ============================================
   Mobile Bottom Sheet
   ============================================ */
body.sheet-open {
  overflow: hidden;
}

.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bottom-sheet-overlay.show {
  opacity: 1;
}

.bottom-sheet {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-bottom: none;
}

.bottom-sheet-overlay.show .bottom-sheet {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: 12px auto;
}

.bottom-sheet-header {
  padding: 8px 20px 16px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.bottom-sheet-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

.bottom-sheet-content {
  padding: 20px;
}

.bottom-sheet-item-info {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.bottom-sheet-item-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  background: #0a0a0a;
}

.bottom-sheet-item-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
}

.bottom-sheet-quantity {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bottom-sheet-quantity label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bottom-sheet-quantity .quantity-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.bottom-sheet-quantity .quantity-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid;
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bottom-sheet-quantity .quantity-btn:hover,
.bottom-sheet-quantity .quantity-btn:active {
  transform: scale(1.05);
}

.bottom-sheet-quantity #sheet-quantity {
  width: 80px;
  height: 48px;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  -moz-appearance: textfield;
}

.bottom-sheet-quantity #sheet-quantity::-webkit-outer-spin-button,
.bottom-sheet-quantity #sheet-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bottom-sheet-actions {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  background: rgba(0, 0, 0, 0.2);
}

.bottom-sheet-actions button {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.bottom-sheet-cancel {
  background: rgba(100, 100, 100, 0.3);
  color: #b0b0b0;
  border: 1px solid rgba(100, 100, 100, 0.5) !important;
}

.bottom-sheet-cancel:hover {
  background: rgba(100, 100, 100, 0.5);
  color: #ffffff;
}

.bottom-sheet-confirm {
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bottom-sheet-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.bottom-sheet-remove {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  flex: 0 0 auto;
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.bottom-sheet-remove:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #ffffff;
}

/* Tablet and larger - center the sheet */
@media (min-width: 500px) {
  .bottom-sheet {
    margin-bottom: 20px;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
  }

  .bottom-sheet-overlay {
    align-items: center;
  }
}

/* ============================================
   Item Details Right-Side Drawer
   ============================================ */
.item-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.item-drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.item-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  border-left: 1px solid rgba(139, 92, 246, 0.3);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.item-drawer.open {
  transform: translateX(0);
}

.item-drawer-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.item-drawer-close {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-drawer-close:hover {
  background: rgba(139, 92, 246, 0.4);
  color: #fff;
}

.item-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.item-drawer-loading,
.item-drawer-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #9ca3af;
  font-size: 1rem;
}

.item-drawer-error {
  color: #fca5a5;
}

/* Drawer Item Content */
.drawer-item {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-item-image {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(139, 92, 246, 0.3);
}

.drawer-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.drawer-item-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  text-align: center;
}

/* Rarity-based title colors in drawer */
.drawer-item.rarity-legendary .drawer-item-title {
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.drawer-item.rarity-epic .drawer-item-title {
  color: #a335ee;
  text-shadow: 0 0 12px rgba(163, 53, 238, 0.5);
}

.drawer-item.rarity-rare .drawer-item-title {
  color: #0070dd;
  text-shadow: 0 0 12px rgba(0, 112, 221, 0.5);
}

.drawer-item.rarity-uncommon .drawer-item-title {
  color: #9d9d9d;
}

.drawer-item-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-meta-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-meta-tag.rarity {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.drawer-meta-tag.type {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.drawer-item-description {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.drawer-item-description p {
  margin: 0;
  color: #d1d5db;
  font-size: 0.9rem;
  line-height: 1.6;
}

.drawer-item-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.drawer-detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drawer-detail-value {
  font-size: 0.875rem;
  color: #ffffff;
  font-weight: 500;
}

/* Crafting Sections in Drawer */
.drawer-crafting-section {
  margin-top: 10px;
}

.drawer-crafting-section h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px 0;
}

.drawer-crafting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.drawer-crafting-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.drawer-crafting-item:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
}

.drawer-crafting-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 4px;
}

.drawer-crafting-item .no-image {
  width: 50px;
  height: 50px;
  background: #2a2a2a;
  border-radius: 4px;
}

.crafting-item-name {
  font-size: 0.7rem;
  color: #d1d5db;
  text-align: center;
  margin-top: 6px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.crafting-item-qty {
  font-size: 0.65rem;
  font-weight: 700;
  color: #8b5cf6;
  margin-top: 2px;
}

/* Drawer Quick Actions */
.drawer-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.drawer-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.5);
}

.drawer-action-btn.looking-for-btn {
  border: 2px solid #FF9800;
  color: #FF9800;
}

.drawer-action-btn.looking-for-btn:hover {
  background: rgba(255, 152, 0, 0.2);
}

.drawer-action-btn.have-extra-btn {
  border: 2px solid #4CAF50;
  color: #4CAF50;
}

.drawer-action-btn.have-extra-btn:hover {
  background: rgba(76, 175, 80, 0.2);
}

.drawer-action-btn.crafting-graph-btn {
  border: 2px solid #8b5cf6;
  color: #8b5cf6;
}

.drawer-action-btn.crafting-graph-btn:hover {
  background: rgba(139, 92, 246, 0.2);
}

.drawer-view-full {
  display: block;
  text-align: center;
  padding: 14px 20px;
  margin-top: 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.drawer-view-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Mobile Drawer - Full Width */
@media (max-width: 500px) {
  .item-drawer {
    max-width: 100%;
  }
}

/* ============================================
   Site Footer
   ============================================ */
.site-footer {
  background: #1a1a1a;
  border-top: 1px solid #3a3a3a;
  padding: 30px 20px;
  margin-top: 40px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0;
}

.footer-text a {
  color: #8b5cf6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-text a:hover {
  color: #a78bfa;
}
