/* ============================================================================
   eBay Integration - Modern Design System
   CSS3 Variables, Flexbox, Grid, Animations
   ============================================================================ */

/* FOUC Prevention - Smooth content reveal */
html:not(.css-ready) {
  /* Content is hidden by inline styles until css-ready class is added */
}

html.css-ready {
  visibility: visible !important;
  opacity: 1 !important;
  transition: opacity 0.2s ease-in;
}

/* CSS Variables for Design Tokens */
:root {
  /* Colors - Black & Gold Theme */
  --color-primary: #d4af37;
  --color-primary-light: #f4d03f;
  --color-primary-dark: #b8942e;
  --color-bg-dark: #0a0a0a;
  --color-bg-darker: #1a1a1a;
  --color-surface: rgba(20, 20, 20, 0.95);
  --color-surface-light: rgba(30, 30, 30, 0.8);
  --color-text-primary: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-muted: #888888;
  --color-border: #444444;
  --color-error: #dc3545;
  --color-error-bg: rgba(220, 53, 69, 0.2);
  --color-error-text: #ff6b7a;
  --color-success: #28a745;
  --color-success-bg: rgba(40, 167, 69, 0.2);
  --color-success-text: #5dff7a;
  --color-warning: #ffc107;
  --color-warning-bg: rgba(255, 193, 7, 0.2);
  --color-info: #17a2b8;
  --color-info-bg: rgba(23, 162, 184, 0.2);
  
  /* New Semantic Color Aliases */
  --error: var(--color-error);
  --error-bg: var(--color-error-bg);
  --error-text: var(--color-error-text);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --text-secondary: var(--color-text-secondary);
  
  /* Responsive Spacing Scale with clamp() */
  --space-xs: clamp(0.25rem, 1vw, 0.5rem);
  --space-sm: clamp(0.5rem, 2vw, 0.75rem);
  --space-md: clamp(0.75rem, 2.5vw, 1rem);
  --space-lg: clamp(1rem, 3vw, 1.5rem);
  --space-xl: clamp(1.5rem, 4vw, 2rem);
  --space-2xl: clamp(2rem, 5vw, 3rem);
  --space-3xl: clamp(2.5rem, 6vw, 4rem);
  
  /* Fluid Typography */
  --font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-xs: clamp(0.7rem, 1.5vw, 0.75rem);
  --font-size-sm: clamp(0.8rem, 1.8vw, 0.875rem);
  --font-size-base: clamp(0.9rem, 2vw, 1rem);
  --font-size-lg: clamp(1rem, 2.3vw, 1.125rem);
  --font-size-xl: clamp(1.1rem, 2.5vw, 1.25rem);
  --font-size-2xl: clamp(1.25rem, 3vw, 1.5rem);
  --font-size-3xl: clamp(1.5rem, 4vw, 2rem);
  --font-size-4xl: clamp(1.75rem, 5vw, 2.5rem);
  
  /* Responsive Border Radius */
  --radius-sm: clamp(6px, 1vw, 8px);
  --radius-md: clamp(8px, 1.5vw, 10px);
  --radius-lg: clamp(10px, 2vw, 12px);
  --radius-xl: clamp(12px, 3vw, 20px);
  
  /* Enhanced Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 5px 15px rgba(212, 175, 55, 0.4);
  --shadow-lg: 0 10px 30px rgba(212, 175, 55, 0.2);
  --shadow-xl: 0 20px 60px rgba(212, 175, 55, 0.3);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.5);
  --shadow-hover: 0 8px 25px rgba(212, 175, 55, 0.5);
  
  /* Smooth Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Breakpoints (for reference in clamp calculations) */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
  
  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Global overflow and text wrapping rules */
* {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

p, h1, h2, h3, h4, h5, h6, span, div, a, label {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
  background-attachment: fixed;
  color: var(--color-text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: clamp(0.5rem, 2vw, 1.5rem);
  box-sizing: border-box;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  font-size: var(--font-size-base);
}

/* ============================================================================
   Layout Components
   ============================================================================ */

.page-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.container {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  padding: clamp(1rem, 4vw, 2.5rem);
  width: 100%;
  max-width: min(550px, calc(100vw - 1rem));
  margin: 0 auto;
  box-shadow: var(--shadow-xl), 0 0 40px rgba(212, 175, 55, 0.1);
  backdrop-filter: blur(10px);
  animation: fadeInUp var(--transition-base);
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.container-wide {
  max-width: min(1400px, calc(100vw - 1rem));
  padding: clamp(1rem, 3vw, 2rem);
}

.container-full {
  max-width: calc(100vw - 1rem);
}

/* Mobile-specific container adjustments */
@media (max-width: 640px) {
  .container {
    border-width: 1px;
    border-radius: var(--radius-md);
    padding: clamp(0.75rem, 3vw, 1.5rem);
  }
}

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

/* ============================================================================
   Typography
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

h1 {
  font-size: var(--font-size-4xl);
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: var(--shadow-glow);
  letter-spacing: clamp(0.02em, 0.5vw, 0.05em);
  line-height: 1.1;
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-lg);
  line-height: 1.2;
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-sm);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
}

h6 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-xs);
}

p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

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

.text-muted {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.text-small {
  font-size: var(--font-size-sm);
}

/* ============================================================================
   Form Components
   ============================================================================ */

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: clamp(0.75rem, 2vw, var(--space-lg));
  width: 100%;
}

.form-label {
  color: var(--color-primary);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.form-label.optional {
  color: var(--color-primary-dark);
}

.form-label .icon {
  font-size: var(--font-size-lg);
}

.form-input {
  padding: clamp(0.625rem, 2vw, var(--space-md)) clamp(0.75rem, 3vw, var(--space-lg));
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-light);
  color: var(--color-text-primary);
  font-size: clamp(0.875rem, 2vw, var(--font-size-base));
  font-family: inherit;
  transition: all var(--transition-base);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--color-primary);
  background: rgba(40, 40, 40, 0.9);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: -5px;
}

.form-error {
  font-size: var(--font-size-sm);
  color: var(--color-error-text);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.info-box {
  background: var(--color-surface-light);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  margin-top: var(--space-md);
}

.info-box h4 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.info-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-box li {
  padding: var(--space-xs) 0;
}

.policy-link {
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.policy-link:hover {
  color: var(--color-primary-light);
  text-decoration: underline;
}

/* Checkbox Input */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  font-weight: 400;
  user-select: none;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  cursor: pointer;
  user-select: none;
  padding: clamp(0.625rem, 1.5vw, 0.75rem);
  border-radius: var(--radius-md);
  transition: background-color 0.2s ease;
}

.form-checkbox:hover {
  background-color: var(--color-surface-light);
}

.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
  border: 2px solid var(--color-border);
  border-radius: 4px;
  margin: 0;
  flex-shrink: 0;
}

.form-checkbox span {
  color: var(--color-text-secondary);
  font-size: clamp(0.875rem, 2vw, 1rem);
  line-height: 1.5;
  word-break: break-word;
}

.form-checkbox:hover span {
  color: var(--color-text-primary);
}

/* Password Strength Indicator */
.password-strength {
  display: flex;
  gap: 5px;
  height: 4px;
  margin-top: 5px;
}

.password-strength span {
  flex: 1;
  background: var(--color-border);
  border-radius: 2px;
  transition: background var(--transition-base);
}

.password-strength.weak span:nth-child(1) {
  background: var(--color-error);
}

.password-strength.medium span:nth-child(1),
.password-strength.medium span:nth-child(2) {
  background: #ffa500;
}

.password-strength.strong span {
  background: var(--color-success);
}

/* Password Strength Bar (alternative style) */
.strength-bar {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 4px 0;
}

.strength-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 2px;
}

/* Password Requirements List */
.requirements-list {
  list-style: none;
  padding: 10px 15px;
  background: rgba(212, 175, 55, 0.05);
  border-radius: 8px;
  margin-top: 10px;
}

.requirement-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  transition: color var(--transition-base);
}

.requirement-item .check-icon {
  font-weight: bold;
  color: var(--color-text-muted);
}

.requirement-item.passed {
  color: var(--color-success-text);
}

.requirement-item.passed .check-icon {
  color: var(--color-success);
}

/* Secret Box Component */
.secret-box {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-md);
  word-break: break-all;
}

.secret-box strong {
  color: var(--color-primary-light);
  font-family: 'Courier New', monospace;
  font-size: var(--font-size-sm);
}

.no-secret {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Action Navigation */
.action-nav {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  margin-top: clamp(0.75rem, 2vw, 1rem);
  width: 100%;
}

.action-nav .btn {
  width: 100%;
  justify-content: center;
}

/* Button Groups & Game Selection */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.5rem, 2vw, 0.85rem);
  margin-top: clamp(0.75rem, 2vw, 1rem);
  width: 100%;
}

.button-group .btn {
  flex: 1 1 auto;
  min-width: min(160px, 100%);
}

@media (max-width: 640px) {
  .button-group {
    flex-direction: column;
  }
  
  .button-group .btn {
    width: 100%;
    min-width: 100%;
  }
}

.btn-lg {
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
}

.game-btn {
  transition: all 0.2s ease;
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* Card Results & Previews */
.card-result {
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.card-result:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-color: var(--primary);
}

.card-preview {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--primary);
}

/* Loading States */
.loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: var(--text-secondary);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Main Content Wrapper */
.main-content {
  max-width: min(1400px, calc(100vw - 1rem));
  margin: 0 auto;
  padding: clamp(0.5rem, 2vw, 1rem);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (max-width: 640px) {
  .main-content {
    padding: clamp(0.5rem, 2vw, 0.75rem);
  }
}

/* ============================================================================
   Button Components
   ============================================================================ */

.btn {
  padding: clamp(0.6rem, 2vw, 0.875rem) clamp(1rem, 3vw, 1.5rem);
  border: none;
  border-radius: var(--radius-md);
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.3rem, 1vw, 0.5rem);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-align: center;
  line-height: 1.4;
  min-height: 44px;
  min-width: 44px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.btn span {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1;
}

.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 var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
  color: var(--color-bg-dark);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.5);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
  color: var(--color-text-primary);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #3a3a3a 0%, #4a4a4a 100%);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  padding: clamp(0.6rem, 2vw, 0.875rem) clamp(1rem, 3vw, 1.5rem);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-primary);
}

.btn-block {
  width: 100%;
  margin-top: var(--space-sm);
}

/* Button Sizes */
.btn-sm {
  padding: clamp(0.4rem, 1.5vw, 0.6rem) clamp(0.75rem, 2vw, 1rem);
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  min-height: 36px;
  min-width: 36px;
}

.btn-sm span {
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.btn-lg {
  padding: clamp(0.875rem, 2.5vw, 1.125rem) clamp(1.5rem, 4vw, 2rem);
  font-size: clamp(0.95rem, 2.3vw, 1.1rem);
  min-height: 52px;
}

.btn-lg span {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

/* Button States */
.btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}

/* Mobile button improvements */
@media (max-width: 640px) {
  .btn {
    white-space: normal;
    line-height: 1.3;
  }
  
  .btn-block {
    margin-top: clamp(0.5rem, 2vw, 0.75rem);
  }
}

/* ============================================================================
   Alert & Message Components
   ============================================================================ */

.alert {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: slideDown var(--transition-base);
}

/* Fixed notifications that appear at top of viewport */
.alert-fixed,
.alert[style*="position: fixed"] {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  z-index: 9999 !important;
  max-width: min(400px, calc(100vw - 40px)) !important;
  margin-bottom: 0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

@media (max-width: 640px) {
  .alert-fixed,
  .alert[style*="position: fixed"] {
    top: 10px !important;
    right: 10px !important;
    left: 10px !important;
    max-width: none !important;
  }
}

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

@keyframes slideUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.alert-error {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  color: var(--color-error-text);
}

.alert-success {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success);
  color: var(--color-success-text);
}

.alert-info {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info);
  color: var(--color-info);
}

.alert-warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  color: var(--color-warning);
}

.alert-icon {
  font-size: var(--font-size-xl);
}

.alert-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
  padding: 0;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.alert-close:hover {
  opacity: 1;
}

/* ============================================================================
   Card Components
   ============================================================================ */

.card {
  background: linear-gradient(135deg, #1a1a1a 0%, var(--color-surface) 50%, #1a1a1a 100%);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(212, 175, 55, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  transition: left 0.5s;
  pointer-events: none;
}

@media (hover: hover) {
  .card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(212, 175, 55, 0.3);
    transform: translateY(-6px);
  }
  
  .card:hover::before {
    left: 100%;
  }
}

/* Mobile card adjustments */
@media (max-width: 640px) {
  .card {
    border-width: 1px;
    border-radius: var(--radius-md);
    padding: clamp(0.85rem, 3vw, 1.25rem);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  flex-wrap: wrap;
  padding: 0 0 clamp(0.75rem, 2vw, 1rem);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

@media (hover: hover) {
  .card-header:hover {
    background-color: rgba(212, 175, 55, 0.05);
  }
}

.card-title {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.5vw, 0.6rem);
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

.card-title span {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  flex-shrink: 0;
}

.card-toggle {
  font-size: 1.25rem;
  transition: transform 0.3s ease;
  color: var(--color-primary);
  opacity: 0.7;
}

.card-toggle.collapsed {
  transform: rotate(-90deg);
}

.card-body {
  color: var(--color-text-secondary);
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  opacity: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  line-height: 1.6;
}

.card-body p {
  margin-bottom: clamp(0.5rem, 2vw, 0.75rem);
}

.card-body.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.card-footer {
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  flex-wrap: wrap;
  padding-top: clamp(0.75rem, 2vw, 1rem);
  margin-top: auto;
  border-top: 1px solid var(--color-border);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
  width: 100%;
}

/* Responsive card grid adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  }
}

@media (min-width: 1025px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

/* ============================================================================
   Premium Page Headers & Section Cards
   ============================================================================ */

.page-header {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(212, 175, 55, 0.2), inset 0 1px 0 rgba(212, 175, 55, 0.1);
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.page-header h1 {
  margin: 0 0 0.5rem 0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  position: relative;
  z-index: 1;
}

.page-header p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

.section-card,
.card-section {
  background: linear-gradient(135deg, #1a1a1a 0%, var(--color-surface) 50%, #1a1a1a 100%);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(212, 175, 55, 0.1);
  position: relative;
}

.section-card::before,
.card-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  pointer-events: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-primary);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.section-header h2 {
  margin: 0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.section-description {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg-secondary);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .page-header {
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
  }
  
  .section-card,
  .card-section {
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================================
   Navigation & Links
   ============================================================================ */

.nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: 1rem;
  text-align: center;
}

.link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.link:hover {
  color: var(--color-primary-light);
  text-shadow: var(--shadow-glow);
}

.link-block {
  display: block;
  padding: var(--space-md) var(--space-xl);
  background: rgba(212, 175, 55, 0.1);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
}

.link-block:hover {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #000000;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================================================
   Header Component
   ============================================================================ */

.header {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  padding: clamp(0.75rem, 2.5vw, 1.5rem);
  margin: 0 auto clamp(1rem, 3vw, 2rem);
  max-width: min(1600px, calc(100vw - 1rem));
  width: 100%;
  box-sizing: border-box;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  overflow: visible;
  position: relative;
}

.header h1 {
  margin: 0;
  text-align: left;
  font-size: clamp(1.1rem, 4vw, 1.75rem);
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  text-shadow: none;
}

.header-nav {
  display: flex;
  gap: clamp(0.4rem, 1.5vw, 0.75rem);
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

/* Mobile header improvements */
@media (max-width: 640px) {
  .header {
    border-width: 1px;
    border-radius: var(--radius-md);
    padding: clamp(0.6rem, 3vw, 1rem);
    flex-wrap: nowrap;
  }
  
  .header h1 {
    font-size: clamp(1rem, 5vw, 1.3rem);
  }
  
  .header-nav {
    gap: 0.4rem;
  }
  
  .header-nav .btn {
    padding: clamp(0.4rem, 2vw, 0.6rem) clamp(0.6rem, 3vw, 0.9rem);
    font-size: clamp(0.75rem, 2.5vw, 0.85rem);
  }
  
  .header-nav .btn span {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
  }
}

/* ============================================================================
   Utility Classes
   ============================================================================ */

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ============================================================================
   Responsive Design
   ============================================================================ */

/* Tablet and smaller desktop - optimize listings layout */
@media (max-width: 1024px) {
  .listing-card {
    grid-template-columns: 2fr 1fr 1fr 0.8fr 0.6fr 1.2fr;
    gap: var(--space-md);
    column-gap: var(--space-md);
    font-size: var(--font-size-sm);
  }
  
  .listings-table-header {
    grid-template-columns: 2fr 1fr 1fr 0.8fr 0.6fr 1.2fr;
    gap: var(--space-md);
    column-gap: var(--space-md);
  }
  
  .bulk-actions-toolbar {
    flex-wrap: wrap;
  }
  
  .search-container {
    flex-direction: column;
  }
  
  .search-input {
    width: 100%;
  }
}

/* Mobile devices - stack listings vertically */
@media (max-width: 768px) {
  /* Make listings stack on mobile for better readability */
  .listing-card,
  .looking-for-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
    padding-left: calc(var(--space-md) + 28px);
    min-width: auto;
    width: 100%;
  }
  
  .listing-card > *,
  .looking-for-row > * {
    border-right: none;
    padding-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--space-sm);
  }
  
  .listing-card > *:last-child,
  .looking-for-row > *:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .listings-table-header {
    display: none; /* Hide header on mobile since cards are stacked */
  }
  
  .looking-for-row .listing-title,
  .looking-for-row .detail-value {
    white-space: normal;
    overflow: visible;
  }
  
  .looking-for-row .listing-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  
  .listing-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    -webkit-line-clamp: 3;
    margin-bottom: var(--space-xs);
  }
  
  .detail-label {
    display: inline;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-right: var(--space-xs);
  }
  
  .detail-label::after {
    content: ':';
  }
  
  .listing-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--space-sm);
    border-bottom: none !important;
  }
  
  .listing-actions .btn {
    flex: 1;
    min-width: fit-content;
  }
  
  .bulk-actions-toolbar {
    padding: var(--space-sm);
  }
  
  .bulk-actions-left {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
  }
  
  body {
    padding: clamp(0.75rem, 2vw, 1rem);
  }
  
  .container {
    padding: var(--space-xl) var(--space-lg);
  }
  
  .header {
    flex-direction: column;
    text-align: center;
    align-items: stretch;
  }
  
  .header h1 {
    text-align: center;
    width: 100%;
  }
  
  .header-nav {
    width: 100%;
    justify-content: center;
  }
  
  .header-content {
    flex-direction: column;
    text-align: center;
    width: 100%;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: var(--space-sm);
  }
  
  .container {
    padding: clamp(0.75rem, 3vw, var(--space-lg)) clamp(0.75rem, 2vw, var(--space-md));
    border-radius: var(--radius-md);
  }
  
  h1 {
    font-size: var(--font-size-3xl);
  }
  
  .header {
    padding: var(--space-md);
    gap: var(--space-sm);
  }
  
  .header h1 {
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    width: 100%;
  }
  
  .header-nav {
    width: 100%;
    justify-content: stretch;
    gap: var(--space-xs);
  }
  
  .header-nav .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-xs);
    font-size: var(--font-size-xs);
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-container {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Loading & Animation States
   ============================================================================ */

.loading {
  pointer-events: none;
  opacity: 0.6;
}

.spinner {
  border: 3px solid rgba(212, 175, 55, 0.3);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================================
   Collections Management Styles - Responsive CSS3/HTML5 Design
   ============================================================================ */

/* Collections Container - Fluid responsive container */
.container.collections-container {
  max-width: min(1600px, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Page Header - Responsive flex layout */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: clamp(1.25rem, 4vw, 2.5rem);
  gap: clamp(0.85rem, 2vw, 1.25rem);
  flex-wrap: wrap;
  width: 100%;
}

.page-header-content {
  flex: 1 1 auto;
  min-width: 0;
}

.page-title {
  font-size: clamp(1.5rem, 4.5vw, 2.25rem);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 clamp(0.4rem, 1vw, 0.6rem) 0;
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  line-height: 1.15;
  word-wrap: break-word;
}

.page-title span {
  font-size: clamp(1.5rem, 4vw, 2rem);
  flex-shrink: 0;
}

.page-subtitle {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: clamp(0.75rem, 3vw, 1rem);
  }
  
  .page-header .btn-lg {
    width: 100%;
  }
}

/* Game Filter Tabs - Responsive grid */
.game-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(110px, 45%), 1fr));
  gap: clamp(0.5rem, 1.5vw, 1rem);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
  background: var(--color-surface);
  padding: clamp(0.75rem, 2vw, 1.25rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  width: 100%;
  box-sizing: border-box;
}

.tab-btn {
  padding: clamp(0.5rem, 1.5vw, 0.75rem) clamp(0.6rem, 2vw, 1rem);
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: clamp(0.75rem, 1.8vw, 0.85rem);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.3rem, 1vw, 0.5rem);
  white-space: nowrap;
  text-align: center;
  line-height: 1.3;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn span {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

@media (hover: hover) {
  .tab-btn:hover {
    background: var(--color-surface-light);
    color: var(--color-primary);
    transform: translateY(-1px);
    border-color: var(--color-primary);
  }
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: var(--color-bg-dark);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .game-tabs {
    grid-template-columns: repeat(2, 1fr);
    padding: clamp(0.5rem, 2vw, 0.75rem);
    gap: clamp(0.4rem, 1.5vw, 0.6rem);
  }
}

/* Search Section - Fluid responsive */
.search-section {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.search-box-wrapper {
  position: relative;
  max-width: min(600px, 100%);
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: clamp(0.75rem, 2vw, 1rem);
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  pointer-events: none;
  color: var(--color-text-muted);
  z-index: 1;
  line-height: 1;
}

.search-input {
  width: 100%;
  padding: clamp(0.75rem, 2vw, 1rem) clamp(0.85rem, 2.5vw, 1.15rem) clamp(0.75rem, 2vw, 1rem) clamp(2.5rem, 6vw, 3.25rem);
  font-size: clamp(0.9rem, 2vw, 1rem);
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-sizing: border-box;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 48px;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  background: rgba(20, 20, 20, 1);
  outline: none;
}

@media (max-width: 640px) {
  .search-input {
    font-size: 16px; /* Prevents zoom on iOS */
    border-width: 1px;
  }
}

/* Collections Grid - Responsive CSS Grid */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: clamp(0.85rem, 3vw, 1.5rem);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 641px) and (max-width: 1024px) {
  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  }
}

@media (min-width: 1025px) {
  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: clamp(1.25rem, 2vw, 1.75rem);
  }
}

.collection-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-border);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 350px;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .collection-card {
    border-width: 1px;
    min-height: 320px;
  }
}

.collection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary), var(--color-primary-light));
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (hover: hover) {
  .collection-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary);
  }
  
  .collection-card:hover::before {
    opacity: 1;
  }
}

.collection-card-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.collection-card-header {
  padding: clamp(1rem, 3vw, 1.5rem);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(212, 175, 55, 0.02));
  border-bottom: 1px solid var(--color-border);
}

.collection-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
  gap: 0.75rem;
}

.collection-icon {
  font-size: clamp(1.5rem, 4vw, 2rem);
  width: clamp(40px, 10vw, 50px);
  height: clamp(40px, 10vw, 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.collection-title {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.collection-game-badge {
  display: inline-block;
  padding: clamp(0.3rem, 1vw, 0.4rem) clamp(0.75rem, 2vw, 1rem);
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: var(--color-bg-dark);
  border-radius: var(--radius-md);
  font-size: clamp(0.6875rem, 1.5vw, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.collection-card-body {
  padding: clamp(1rem, 3vw, 1.5rem);
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1rem);
}

.collection-description {
  color: var(--color-text-secondary);
  font-size: clamp(0.8125rem, 1.8vw, 0.875rem);
  margin: 0;
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: clamp(2.4em, 5vw, 2.8em);
  word-break: break-word;
}

.collection-description-empty {
  color: var(--color-text-muted);
  font-style: italic;
  opacity: 0.6;
}

.collection-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: clamp(0.5rem, 2vw, 0.875rem);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.stat-box {
  background: var(--color-surface-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: clamp(0.625rem, 2vw, 0.875rem);
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  transition: all 0.2s ease;
  min-width: 0;
}

@media (hover: hover) {
  .stat-box:hover {
    border-color: var(--color-primary);
    background: rgba(212, 175, 55, 0.05);
    transform: scale(1.02);
  }
}

.stat-box-full {
  grid-column: 1 / -1;
}

.stat-icon-small {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  width: clamp(32px, 8vw, 40px);
  height: clamp(32px, 8vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.stat-content-small {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.stat-value-large {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-label-small {
  font-size: clamp(0.625rem, 1.5vw, 0.75rem);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-meta {
  margin-top: auto;
  padding-top: clamp(0.625rem, 2vw, 0.875rem);
  border-top: 1px solid var(--color-border);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: clamp(0.375rem, 1vw, 0.5rem);
  font-size: clamp(0.6875rem, 1.5vw, 0.75rem);
  color: var(--color-text-muted);
}

.meta-icon {
  opacity: 0.7;
  flex-shrink: 0;
}

.collection-card-footer {
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  padding: clamp(0.875rem, 2.5vw, 1.25rem) clamp(1rem, 3vw, 1.5rem);
  background: var(--color-surface-light);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.collection-card-footer .btn {
  flex: 1 1 auto;
  min-width: 0;
  font-size: clamp(0.8125rem, 1.8vw, 0.875rem);
}

.collection-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.btn-icon {
  flex: 0 0 auto;
  width: clamp(40px, 10vw, 48px);
  height: clamp(40px, 10vw, 48px);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ghost {
  background: transparent;
  border: 2px solid var(--color-border);
  color: var(--color-text-secondary);
}

@media (hover: hover) {
  .btn-ghost:hover {
    background: var(--color-error-bg);
    border-color: var(--color-error);
    color: var(--color-error-text);
  }
  
  .toggle-public-btn:hover {
    background: var(--color-primary-bg) !important;
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
  }
}

.visibility-badge {
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: all 0.2s ease;
}

.badge-public {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-private {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* Collection Detail Page - Responsive Design */
.header-content {
  display: flex;
  align-items: center;
  gap: clamp(0.625rem, 2vw, 1rem);
  flex-wrap: wrap;
}

.collection-info-card {
  margin-bottom: clamp(1.25rem, 3vw, 1.5rem);
}

.collection-actions {
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  flex-wrap: wrap;
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

/* Statistics Dashboard - Responsive Grid */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: clamp(0.875rem, 2.5vw, 1.25rem);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(0.875rem, 2.5vw, 1.25rem);
  display: flex;
  align-items: center;
  gap: clamp(0.625rem, 2vw, 1rem);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

@media (hover: hover) {
  .stat-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
}

.stat-icon {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  width: clamp(48px, 12vw, 60px);
  height: clamp(48px, 12vw, 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-light);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.stat-content {
  flex: 1 1 auto;
  min-width: 0;
}

.stat-label {
  font-size: clamp(0.75rem, 1.8vw, 0.875rem);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: clamp(1.25rem, 3.5vw, 2rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Add Card Section - Responsive */
.add-card-section {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.search-container {
  display: flex;
  gap: clamp(0.625rem, 2vw, 1rem);
  margin-bottom: clamp(1rem, 2.5vw, 1.25rem);
  flex-wrap: wrap;
}

.search-container .form-input {
  flex: 1 1 auto;
  min-width: min(200px, 100%);
}

.search-container .btn {
  flex: 0 1 auto;
  white-space: nowrap;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: clamp(0.75rem, 2vw, 1rem);
  max-height: clamp(400px, 60vh, 600px);
  overflow-y: auto;
  padding: clamp(0.5rem, 1.5vw, 0.75rem);
}

.search-result-card {
  background: var(--color-surface-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: clamp(0.75rem, 2vw, 1rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  transition: all 0.2s ease;
  min-width: 0;
}

@media (hover: hover) {
  .search-result-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
  }
}

.result-card-image {
  width: 100%;
  aspect-ratio: 5/7;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-bg-darker);
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-placeholder {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--color-text-muted);
}

.result-card-info {
  flex: 1 1 auto;
  min-width: 0;
}

.result-card-name {
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
  font-size: clamp(0.8125rem, 1.8vw, 0.875rem);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.result-card-set,
.result-card-number {
  font-size: clamp(0.6875rem, 1.5vw, 0.75rem);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-result-btn {
  width: 100%;
  margin-top: auto;
}

.loading,
.no-results {
  text-align: center;
  padding: clamp(1.5rem, 4vw, 2rem);
  color: var(--color-text-muted);
  font-style: italic;
  font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Cards List Section - Responsive */
.cards-list-section {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.header-actions {
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  flex-wrap: wrap;
}

.form-input-sm {
  padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1rem);
  font-size: clamp(0.8125rem, 1.8vw, 0.875rem);
  min-width: min(150px, 100%);
}

/* Table - Responsive Design */
.table-responsive {
  overflow-x: auto;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.cards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(0.75rem, 1.8vw, 0.875rem);
  min-width: min(600px, 100%);
  table-layout: auto;
}

.cards-table thead {
  background: var(--color-surface-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cards-table th {
  padding: clamp(0.5rem, 2vw, 0.875rem);
  text-align: left;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-border);
  white-space: normal;
  font-size: clamp(0.7rem, 1.8vw, 0.875rem);
  word-break: break-word;
  min-width: 80px;
}

.cards-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.cards-table th.sortable:hover {
  background: rgba(212, 175, 55, 0.1);
}

.cards-table th .sort-indicator {
  display: inline-block;
  margin-left: 0.25rem;
  opacity: 0.3;
  font-size: 0.75em;
  transition: opacity 0.2s ease;
}

.cards-table td {
  padding: clamp(0.625rem, 2vw, 0.875rem);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  font-size: clamp(0.75rem, 1.8vw, 0.875rem);
}

.cards-table tbody tr {
  transition: background-color 0.15s ease;
}

@media (hover: hover) {
  .cards-table tbody tr:hover {
    background: var(--color-surface-light);
  }
}

.card-image-cell {
  width: clamp(60px, 15vw, 80px);
}

.card-thumbnail {
  width: clamp(48px, 12vw, 60px);
  height: clamp(67px, 17vw, 84px);
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: block;
}

.card-thumbnail-placeholder {
  width: clamp(48px, 12vw, 60px);
  height: clamp(67px, 17vw, 84px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--color-text-muted);
}

.card-name-cell {
  font-weight: 600;
  color: var(--color-text-primary);
  max-width: clamp(150px, 30vw, 250px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-finish-select,
.card-condition-select {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 150px;
}

.card-finish-select:hover,
.card-condition-select:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-light);
}

.card-finish-select:focus,
.card-condition-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.price-cell {
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}

.text-muted {
  color: var(--color-text-muted);
}

/* Quantity Controls - Responsive */
.quantity-control {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 1vw, 0.375rem);
  justify-content: center;
}

.qty-btn {
  width: clamp(28px, 7vw, 32px);
  height: clamp(28px, 7vw, 32px);
  border: 1px solid var(--color-border);
  background: var(--color-surface-light);
  color: var(--color-text-primary);
  border-radius: var(--radius-sm);
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

@media (hover: hover) {
  .qty-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg-dark);
    border-color: var(--color-primary);
    transform: scale(1.05);
  }
}

.qty-input {
  width: clamp(50px, 12vw, 60px);
  text-align: center;
  font-size: clamp(0.8125rem, 1.8vw, 0.875rem);
  font-weight: 600;
  padding: clamp(0.375rem, 1vw, 0.5rem);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  transition: border-color 0.2s ease;
  /* Hide native number input spinners - we use custom +/- buttons */
  -moz-appearance: textfield;
}

/* Hide spinners in WebKit browsers (Chrome, Safari, Edge) */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

/* Card Preview in Modal - Responsive */
.card-preview {
  display: flex;
  gap: clamp(0.875rem, 2.5vw, 1.25rem);
  padding: clamp(0.875rem, 2.5vw, 1.25rem);
  background: var(--color-surface-light);
  border-radius: var(--radius-md);
  margin-bottom: clamp(1rem, 2.5vw, 1.25rem);
  flex-wrap: wrap;
}

.preview-image {
  width: clamp(100px, 25vw, 120px);
  flex-shrink: 0;
}

.preview-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 5/7;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  display: block;
}

.preview-info {
  flex: 1 1 auto;
  min-width: min(200px, 100%);
}

.preview-info h3 {
  color: var(--color-primary);
  margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem);
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  word-break: break-word;
}

.preview-info p {
  color: var(--color-text-secondary);
  font-size: clamp(0.8125rem, 1.8vw, 0.875rem);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* Empty State - Responsive */
.empty-state {
  text-align: center;
  padding: clamp(1.75rem, 6vw, 3rem) clamp(1rem, 3vw, 2rem);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--color-border);
  max-width: min(650px, 100%);
  margin: clamp(1.5rem, 5vw, 2.5rem) auto;
}

.empty-icon,
.empty-icon-large {
  font-size: clamp(2.5rem, 10vw, 4.5rem);
  margin-bottom: clamp(0.85rem, 2.5vw, 1.15rem);
  opacity: 0.5;
  line-height: 1;
}

.empty-title {
  font-size: clamp(1.2rem, 4vw, 1.75rem);
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 clamp(0.6rem, 2vw, 0.85rem) 0;
  line-height: 1.25;
}

.empty-description {
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 0 clamp(1rem, 3vw, 1.35rem) 0;
  max-width: min(450px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.empty-state .btn {
  margin-top: clamp(0.6rem, 2vw, 0.85rem);
}

@media (max-width: 640px) {
  .empty-state {
    border-width: 1px;
    padding: clamp(1.5rem, 5vw, 2rem) clamp(0.85rem, 3vw, 1.5rem);
  }
}

/* Button Sizes - Responsive */
.btn-lg {
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 600;
}

.btn-sm {
  padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.875rem, 2.5vw, 1.125rem);
  font-size: clamp(0.75rem, 1.8vw, 0.8125rem);
  font-weight: 600;
}

/* ============================================================================
   Modal Styles
   ============================================================================ */

.modal {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease-out;
  -webkit-overflow-scrolling: touch;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  min-height: 100%;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a1a 0%, var(--color-surface) 50%, #1a1a1a 100%);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: min(650px, calc(100vw - 2rem));
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(212, 175, 55, 0.2), inset 0 1px 0 rgba(212, 175, 55, 0.1);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile modal adjustments */
@media (max-width: 640px) {
  .modal.active {
    padding: 0.5rem;
    align-items: flex-start;
  }
  
  .modal-content {
    max-width: calc(100vw - 1rem);
    border-radius: var(--radius-lg);
    border-width: 2px;
  }
  
  .modal-content form {
    max-height: calc(100vh - 8rem);
  }
}

/* Tablet modal adjustments */
@media (max-width: 768px) {
  .modal-content form {
    max-height: calc(100vh - 9rem);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2xl);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  margin-bottom: var(--space-xl);
}

.modal-header h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--color-primary);
  font-weight: 700;
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

.modal-body {
  padding: 0 var(--space-2xl) var(--space-2xl);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.modal-close {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-primary);
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-primary);
  transform: rotate(90deg);
}
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .modal-close:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
    transform: rotate(90deg);
  }
}

.modal-content form {
  padding: clamp(1rem, 3vw, 1.5rem);
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 10rem);
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  display: flex;
  gap: clamp(0.6rem, 2vw, 0.85rem);
  justify-content: flex-end;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  background: var(--color-surface);
  flex-shrink: 0;
}

.modal-footer .btn {
  flex: 1 1 auto;
  min-width: clamp(100px, 25vw, 130px);
}

@media (max-width: 640px) {
  .modal-footer {
    flex-direction: column-reverse;
  }
  
  .modal-footer .btn {
    width: 100%;
    min-width: 100%;
  }
}

.modal-cancel {
  background: transparent;
  border: 2px solid var(--color-border);
  color: var(--color-text-secondary);
}

.modal-cancel:hover {
  background: var(--color-surface-light);
  border-color: var(--color-text-secondary);
  color: var(--color-text-primary);
}

/* Modal Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

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

/* Alert Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================================
   Responsive Breakpoints - Mobile-First Approach
   ============================================================================ */

/* Tablet and below (768px) */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-header .btn-lg {
    width: 100%;
    justify-content: center;
  }
  
  .collections-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  
  .stats-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .search-container {
    flex-direction: column;
  }
  
  .search-container .form-input,
  .search-container .btn {
    width: 100%;
  }
  
  .collection-actions {
    flex-direction: column;
  }
  
  .collection-actions .btn {
    width: 100%;
  }
  
  .card-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .header-actions {
    width: 100%;
  }
  
  .form-input-sm {
    width: 100%;
    min-width: 100%;
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .game-tabs {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
    padding: var(--space-sm);
  }
  
  .tab-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.7rem;
    gap: 0.25rem;
  }
  
  .collections-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .collection-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-dashboard {
    grid-template-columns: 1fr;
  }
  
  .search-results {
    grid-template-columns: 1fr;
  }
  
  .cards-table {
    min-width: 100%;
    overflow-x: auto;
    display: block;
  }
  
  .card-preview {
    flex-direction: column;
    text-align: center;
  }
  
  .preview-image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-header-content {
    width: 100%;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Extra small devices (320px and below) */
@media (max-width: 360px) {
  body {
    padding: 0.5rem;
  }
  
  .container {
    padding: 0.75rem;
    border-radius: var(--radius-md);
  }
  
  .header {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .header h1 {
    font-size: 1.1rem;
  }
  
  .game-tabs {
    grid-template-columns: 1fr;
  }
  
  .tab-btn {
    padding: 0.5rem;
  }
}

/* Large screens - optimize spacing */
@media (min-width: 1400px) {
  .collections-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  }
}

/* ============================================================================
   Pricing Suggestions Display
   ============================================================================ */

.pricing-display {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.pricing-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pricing-stat-card {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition-base);
}

.pricing-stat-card:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.stat-value {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.stat-value.suggested {
  color: var(--color-success-text);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.stat-value.small {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.stat-note {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

.pricing-info {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-primary);
}

.pricing-info p {
  margin: 0.5rem 0;
}

#get-pricing-btn {
  white-space: nowrap;
  min-width: fit-content;
}

#get-pricing-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#pricing-limit-info {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* Responsive pricing display */
@media (max-width: 768px) {
  .pricing-stats {
    grid-template-columns: 1fr 1fr;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .stat-value.suggested {
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .pricing-stats {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Site Footer
   ============================================================================ */

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(0.75rem, 2vw, 1.5rem);
  margin-top: clamp(2rem, 5vw, 4rem);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(0.5rem, 2vw, 1rem);
}

.footer-content p {
  margin: 0 0 clamp(0.75rem, 2vw, 1rem) 0;
  color: var(--color-text-muted);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1rem);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  transition: color 0.2s ease;
  padding: clamp(0.25rem, 1vw, 0.5rem);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-links span {
  color: var(--color-text-muted);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
}

@media (max-width: 640px) {
  .site-footer {
    padding: clamp(1rem, 4vw, 1.5rem) clamp(0.5rem, 2vw, 1rem);
  }
  
  .footer-links {
    flex-direction: column;
    gap: clamp(0.5rem, 2vw, 0.75rem);
  }

  .footer-links span {
    display: none;
  }
}

/* Ensure body takes full height for footer positioning */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-wrapper {
  flex: 1;
}

/* ============================================================================
   Help Dropdown Menu
   ============================================================================ */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  min-width: 200px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: dropdownFadeIn 0.2s ease-out;
}

.dropdown-menu.show {
  display: block;
}

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

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--color-surface-light);
  color: var(--color-primary);
}

.dropdown-item span {
  margin-right: 0.5rem;
}

/* Header navigation improvements */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .header-nav {
    gap: 0.25rem;
  }

  .dropdown-menu {
    right: auto;
    left: 0;
  }
}

/* ============================================================================
   Cookie Consent Banner
   ============================================================================ */

.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 2px solid var(--color-primary);
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-consent-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cookie-consent-text {
  flex: 1;
  min-width: 300px;
}

.cookie-consent-text h3 {
  color: var(--color-primary);
  margin: 0 0 0.5rem 0;
  font-size: var(--font-size-lg);
}

.cookie-consent-text p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.cookie-consent-text a {
  color: var(--color-primary);
  text-decoration: underline;
}

.cookie-consent-text a:hover {
  color: var(--color-primary-light);
}

.cookie-consent-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-consent-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-consent-btn.primary {
  background: var(--color-primary);
  color: var(--color-bg-dark);
}

.cookie-consent-btn.primary:hover {
  background: var(--color-primary-light);
  transform: translateY(-2px);
}

.cookie-consent-btn.secondary {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.cookie-consent-btn.secondary:hover {
  background: var(--color-surface-light);
  color: var(--color-text-primary);
}

@media (max-width: 768px) {
  .cookie-consent-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .cookie-consent-actions {
    width: 100%;
  }

  .cookie-consent-btn {
    flex: 1;
    text-align: center;
  }
}

/* ============================================================================
   News Feed Styles
   ============================================================================ */

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.filter-pill {
  padding: 0.5rem 1.25rem;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.filter-pill:hover {
  border-color: var(--color-primary);
  background: var(--color-surface-light);
  transform: translateY(-2px);
}

.filter-pill.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #000;
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* News Card */
.news-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2);
  border-color: var(--color-primary);
}

.news-card-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--color-bg-darker);
}

.news-card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--color-primary);
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
}

.news-card-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.news-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--color-text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  padding: 0.25rem 0.5rem;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: lowercase;
}

/* News Article Detail */
.news-article {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.article-hero-image img {
  width: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  max-height: 400px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.article-title {
  margin-bottom: 1rem;
  font-size: 2rem;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.article-tags {
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.article-summary {
  margin-bottom: 2rem;
  padding: 1rem;
  background: rgba(212, 175, 55, 0.1);
  border-left: 3px solid var(--color-primary);
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--color-text-primary);
}

.article-body {
  margin-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.article-body p {
  margin-bottom: 1rem;
}

.article-source {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.article-source h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--color-text-primary);
}

.article-source p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
}

.article-actions {
  margin-top: 2rem;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Responsive Design for News */
@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .filter-pills {
    justify-content: flex-start;
  }
  
  .filter-pill {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
  }
  
  .news-card-title {
    font-size: 1.1rem;
  }
  
  .article-title {
    font-size: 1.5rem;
  }
  
  .news-article {
    padding: 1.25rem;
  }
  
  .article-actions {
    flex-direction: column;
  }
  
  .article-actions .btn {
    width: 100%;
  }
}

/* ============================================================================
   eBay Listings Page
   ============================================================================ */

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.stat-card h3 {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-sm) 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}

.listings-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.listing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  transition: all 0.2s ease;
  display: grid;
  grid-template-columns: 3fr minmax(10rem, 1fr) minmax(11rem, 1.2fr) minmax(8rem, 0.8fr) minmax(5rem, 0.6fr) minmax(16rem, 1.6fr);
  gap: var(--space-lg);
  align-items: center;
  column-gap: var(--space-xl);
  min-width: fit-content;
  width: 100%;
  cursor: pointer;
  user-select: none;
}

.listing-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.15);
  background: rgba(212, 175, 55, 0.05);
}

.listing-card:active {
  transform: scale(0.995);
}

/* Add separators between grid items */
.listing-card > * {
  padding-right: var(--space-lg);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  min-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-card > *:last-child {
  border-right: none;
  padding-right: 0;
}

.listing-header {
  display: contents;
}

.listing-header .listing-title {
  padding-right: var(--space-md);
}

.listing-title {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-active {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.status-draft {
  background: rgba(255, 193, 7, 0.2);
  color: #ffc107;
}

.status-ended {
  background: rgba(108, 117, 125, 0.2);
  color: #adb5bd;
}

.status-unknown {
  background: var(--color-surface-light);
  color: var(--color-text-muted);
}

.listing-details {
  display: contents;
}

.listing-detail-row {
  display: block;
}

.detail-label {
  display: none;
}

.detail-value {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-value.price {
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1.4;
}

/* Enhanced price display */
.price-main {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.fee-breakdown {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.fee-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
  color: var(--color-text-secondary);
}

.fee-label {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.fee-amount {
  color: var(--color-text-secondary);
  font-weight: 500;
}

.fee-divider {
  height: 1px;
  background: rgba(212, 175, 55, 0.15);
  margin: 0.4rem 0;
}

.net-proceeds,
.buyer-total {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  padding-top: 0.3rem;
}

.net-label,
.buyer-label {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.8rem;
}

.net-amount {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.9rem;
}

.buyer-amount {
  font-weight: 700;
  color: var(--color-success);
  font-size: 0.9rem;
}

.fee-breakdown-private .fee-amount {
  color: rgba(40, 167, 69, 0.8);
}

/* Price column styling for grid layout */
.listing-price-row {
  min-height: 80px;
  display: flex;
  align-items: flex-start;
}

.listing-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-xs);
}

.listing-actions .btn {
  padding: 0.4rem 0.8rem;
  font-size: var(--font-size-xs);
}

/* Bulk actions toolbar */
.bulk-actions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--color-surface-light);
  border-radius: var(--radius-md);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-border);
}

.bulk-actions-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.bulk-actions-left label {
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.bulk-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.selected-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  padding-left: var(--space-md);
  border-left: 1px solid var(--color-border);
}

.bulk-actions-right {
  display: flex;
  gap: var(--space-sm);
}

/* Listing checkbox */
.listing-checkbox {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: var(--space-sm);
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 10;
}

.listing-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.listing-card {
  position: relative;
  padding-left: calc(var(--space-md) + 28px); /* Make room for checkbox */
}

/* Selected state for listing cards */
.listing-card:has(.listing-checkbox:checked) {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
}

.listing-card:has(.listing-checkbox:checked) .listing-title {
  color: var(--color-primary);
}

/* Deletion Progress Indicator */
.deletion-progress {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  animation: fadeIn 0.3s ease;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.progress-title {
  font-weight: 600;
  color: var(--color-primary);
  font-size: var(--font-size-base);
}

.progress-counter {
  font-weight: 700;
  color: var(--color-text-primary);
  font-size: var(--font-size-lg);
}

.progress-bar-container {
  width: 100%;
  height: 24px;
  background: var(--color-surface-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--color-border);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary), var(--color-primary-light));
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-percentage {
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--font-size-base);
}

.progress-status {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-style: italic;
}

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

/* Search filter styles */
.search-container {
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  width: 100%;
}

.search-input {
  flex: 1;
  min-width: min(280px, 100%);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-base);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
  width: 100%;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.search-input::placeholder {
  color: var(--color-text-secondary);
  opacity: 0.7;
}

.search-results-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

/* Game section styles */
.game-section {
  margin-bottom: var(--space-xl);
}

.game-header {
  cursor: pointer;
  padding: var(--space-md);
  background: var(--color-surface-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  transition: all 0.2s ease;
}

.game-header:hover {
  background: rgba(212, 175, 55, 0.1);
}

.game-title {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.collapse-icon {
  display: inline-block;
  font-size: var(--font-size-sm);
  transition: transform 0.2s ease;
  min-width: 20px;
}

.game-count {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: normal;
}

.game-listings {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Table header for listings */
.listings-table-header {
  display: grid;
  grid-template-columns: 3fr minmax(10rem, 1fr) minmax(11rem, 1.2fr) minmax(8rem, 0.8fr) minmax(5rem, 0.6fr) minmax(15rem, 1.5fr);
  gap: var(--space-sm);
  column-gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: fit-content;
  overflow-x: auto;
}

.listings-table-header > * {
  padding-right: var(--space-lg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Looking For page specific grid (7 columns: name, game, number, condition, finish, status, actions) */
.listings-table-header:has(+ .listings-container .looking-for-row),
.game-listings .listings-table-header {
  grid-template-columns: minmax(150px, 2fr) minmax(100px, 0.8fr) minmax(80px, 0.6fr) minmax(90px, 0.7fr) minmax(80px, 0.6fr) minmax(70px, 0.5fr) minmax(80px, 0.6fr) minmax(100px, 0.7fr);
  gap: var(--space-sm);
  column-gap: var(--space-md);
}

.looking-for-row {
  display: grid;
  grid-template-columns: minmax(150px, 2fr) minmax(100px, 0.8fr) minmax(80px, 0.6fr) minmax(90px, 0.7fr) minmax(80px, 0.6fr) minmax(70px, 0.5fr) minmax(80px, 0.6fr) minmax(100px, 0.7fr);
  gap: var(--space-sm);
  column-gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  align-items: center;
  transition: all 0.2s ease;
}

.looking-for-row:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.looking-for-row .listing-detail-row {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.looking-for-row .detail-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.looking-for-row .listing-title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  white-space: nowrap;
  font-size: var(--font-size-sm);
}

.looking-for-row .detail-value {
  font-size: var(--font-size-sm);
}

.looking-for-row .status-badge {
  font-size: var(--font-size-xs);
  padding: 0.25rem 0.5rem;
}

.looking-for-row .listing-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
}

.looking-for-row .listing-actions .btn {
  padding: 0.35rem 0.5rem;
  font-size: var(--font-size-xs);
  white-space: nowrap;
  min-width: auto;
  border-radius: var(--radius-sm);
}

.looking-for-row .listing-actions .btn span {
  font-size: 0.9rem;
}

/* Mobile labels - hidden by default */
.mobile-only {
  display: none;
}

.mobile-label {
  display: none;
}

/* Mobile responsive styles for looking-for page */
@media (max-width: 768px) {
  .looking-for-row {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .looking-for-row .listing-title,
  .looking-for-row .detail-value {
    white-space: normal;
    overflow: visible;
    display: flex;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  
  .mobile-only {
    display: inline-block;
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 5rem;
    flex-shrink: 0;
  }
  
  .mobile-label {
    display: inline;
    margin-left: 0.25rem;
  }
  
  .looking-for-row .listing-actions {
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
  }
  
  .looking-for-row .listing-actions .btn {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base);
  }
  
  .looking-for-row .listing-actions .check-matches-btn::after {
    content: ' Check';
    margin-left: 0.25rem;
  }
  
  .looking-for-row .listing-actions .delete-card-btn::after {
    content: ' Delete';
    margin-left: 0.25rem;
  }
  
  .badge-any-version {
    display: block !important;
    margin-left: 0 !important;
    margin-top: 0.25rem !important;
  }
  
  .game-section {
    margin-bottom: var(--space-lg);
  }
  
  .game-header {
    padding: var(--space-md);
  }
  
  .game-title {
    font-size: var(--font-size-lg);
  }
  
  /* Hide table headers on mobile for looking-for page */
  .game-listings .listings-table-header {
    display: none;
  }
}

@media (max-width: 480px) {
  .looking-for-row {
    padding: var(--space-sm);
  }
  
  .looking-for-row .listing-actions {
    flex-direction: column;
  }
  
  .looking-for-row .listing-actions .btn {
    width: 100%;
  }
  
  .page-header {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .page-header-content {
    text-align: center;
  }
  
  .page-header-content .page-title {
    font-size: var(--font-size-xl);
  }
  
  .page-header-content .page-subtitle {
    font-size: var(--font-size-sm);
  }
  
  #add-looking-for-btn {
    width: 100%;
  }
  
  .add-btn-text::before {
    content: '';
  }
  
  .header-nav {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .header-nav .btn {
    width: 100%;
  }
  
  .mobile-only {
    min-width: 4.5rem;
    font-size: var(--font-size-sm);
  }
  
  .search-container {
    padding: var(--space-sm);
  }
  
  .search-input {
    font-size: var(--font-size-base);
  }
  
  .info-banner {
    margin-bottom: var(--space-md) !important;
    padding: var(--space-sm);
  }
  
  .alert {
    padding: var(--space-sm);
  }
  
  .alert-icon {
    font-size: var(--font-size-lg);
  }
}

/* Sortable column headers */
.sortable-header {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  user-select: none;
  transition: color 0.2s ease;
}

.sortable-header:hover {
  color: var(--color-primary);
}

.sortable-header.active-sort {
  color: var(--color-primary);
  font-weight: 700;
}

.sort-icon {
  font-size: 0.75rem;
  opacity: 0.4;
  transition: all 0.2s ease;
}

.sortable-header:hover .sort-icon {
  opacity: 0.7;
}

.sort-icon.active {
  opacity: 1;
  color: var(--color-primary);
}

.listing-actions .btn {
  flex: 1;
  justify-content: center;
}

.loading-state {
  text-align: center;
  padding: var(--space-3xl);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-lg);
}

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

.error-state,
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: var(--space-xl);
}

.error-state {
  border-color: var(--color-error);
  background: var(--color-error-bg);
}

.error-state p {
  color: var(--color-error-text);
  margin-bottom: var(--space-lg);
}

.empty-state h2 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.empty-state p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

/* ============================================================================
   Business Registration Styles
   ============================================================================ */

/* Divider with text */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--color-border);
}

.divider span {
  padding: 0 var(--space-md);
}

/* Business signup section */
.business-signup {
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.1) 100%);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
}

.business-signup-header {
  text-align: center;
  margin-bottom: 1rem;
}

.business-signup-header h2 {
  color: var(--color-text-primary);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.business-signup-header p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.business-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: var(--space-md);
  margin-bottom: 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-text-primary);
}

.feature-icon {
  font-size: 1.5rem;
}

.business-note {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Business registration form */
.container-wide {
  max-width: 60rem;
}

.business-register-header,
.business-login-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.business-register-header h1,
.business-login-header h1 {
  color: var(--color-text-primary);
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.business-register-header p,
.business-login-header p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
}

.business-form {
  max-width: 100%;
}

.form-section {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-border);
}

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

.form-section h2 {
  color: var(--color-text-primary);
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: var(--space-lg);
}

.form-label.required::after {
  content: ' *';
  color: var(--color-error);
}

.form-help {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.form-textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  resize: vertical;
  min-height: 5rem;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-error {
  display: block;
  margin-top: var(--space-xs);
  color: var(--color-error);
  font-size: 0.8125rem;
}

.input-error {
  border-color: var(--color-error);
}

.form-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-2xl);
}

.business-info-box {
  margin-top: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.business-info-box h3 {
  color: var(--color-text-primary);
  font-size: 1.125rem;
  margin-bottom: var(--space-md);
}

.business-info-box ol {
  padding-left: var(--space-lg);
  color: var(--color-text-secondary);
}

.business-info-box li {
  margin-bottom: var(--space-sm);
}

/* Auth required notice */
.auth-notice {
  margin: var(--space-2xl) 0;
  padding: var(--space-2xl);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.1) 100%);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  text-align: center;
}

.auth-notice-content h2 {
  color: var(--color-text-primary);
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.auth-notice-content p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  margin-bottom: var(--space-xl);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.auth-notice-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* Document upload styles */
.document-upload-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.document-upload-header h1 {
  color: var(--color-text-primary);
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.document-upload-header p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
}

.upload-progress {
  margin-bottom: var(--space-2xl);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  max-width: 50rem;
  margin: 0 auto;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 1.5rem;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-border);
  z-index: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  position: relative;
  z-index: 1;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 1.125rem;
}

.progress-step.completed .step-number {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-surface);
}

.progress-step.active .step-number {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-surface);
}

.step-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.progress-step.active .step-label {
  color: var(--color-text-primary);
  font-weight: 600;
}

.upload-instructions {
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.upload-instructions h2,
.upload-instructions h3 {
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.upload-instructions h3 {
  font-size: 1rem;
  margin-top: var(--space-lg);
}

.upload-instructions ul {
  padding-left: var(--space-lg);
  color: var(--color-text-secondary);
}

.upload-instructions li {
  margin-bottom: var(--space-sm);
}

.upload-requirements {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(212, 175, 55, 0.05);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
}

.upload-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.upload-section h3 {
  color: var(--color-text-primary);
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.upload-area {
  position: relative;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: all 0.3s ease;
}

.upload-area:hover {
  border-color: var(--color-primary);
  background: rgba(212, 175, 55, 0.02);
}

.upload-area.drag-over {
  border-color: var(--color-primary);
  background: rgba(212, 175, 55, 0.05);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-2xl) var(--space-xl);
  cursor: pointer;
}

.upload-icon {
  font-size: 3rem;
}

.upload-text {
  color: var(--color-text-primary);
  font-weight: 500;
}

.upload-hint {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.upload-preview {
  padding: var(--space-md);
}

.upload-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
}

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

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

.upload-success {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.success-details {
  flex: 1;
}

.file-name {
  color: var(--color-text-primary);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  word-break: break-word;
}

.file-info {
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.remove-btn {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: var(--color-error);
  border-color: var(--color-error);
  color: white;
}

.btn-ready {
  background: var(--color-success);
  border-color: var(--color-success);
}

.btn-ready:hover {
  background: var(--color-success);
  opacity: 0.9;
}

/* ============================================================================
   Admin Dashboard Styles
   ============================================================================ */

.admin-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--color-background);
}

.admin-header {
  background: linear-gradient(135deg, var(--color-bg-darker) 0%, #000000 100%);
  border-bottom: 2px solid var(--color-primary);
  color: white;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.admin-header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-user-info span {
  font-size: 0.95rem;
  opacity: 0.9;
}

.admin-nav {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0 2rem;
}

.admin-nav ul {
  max-width: 1400px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: flex;
  gap: 2rem;
}

.admin-nav li {
  margin: 0;
}

.admin-nav a {
  display: block;
  padding: 1rem 0;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.admin-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.admin-nav a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.admin-main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem;
}

.admin-controls {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.filter-group,
.search-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.form-select {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.search-group input {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 0.95rem;
  min-width: 300px;
}

.search-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.stats-summary {
  display: flex;
  gap: 1rem;
}

.stat-card {
  background: var(--color-background);
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  text-align: center;
  min-width: 90px;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.3rem;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.business-list-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead {
  background: var(--color-background);
  border-bottom: 2px solid var(--color-border);
}

.admin-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background 0.2s;
}

.admin-table tbody tr:hover {
  background: var(--color-background);
}

.admin-table td {
  padding: 1rem;
  vertical-align: top;
}

.business-name-cell strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.business-name-cell small {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-danger {
  background: #f8d7da;
  color: #721c24;
}

.badge-secondary {
  background: #e2e3e5;
  color: #383d41;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.loading-spinner {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.error-message {
  text-align: center;
  padding: 3rem;
  color: var(--color-danger);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-secondary);
}

/* Modal Styles */
.modal {
  display: none !important;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal.active,
.modal[style*="display: flex"],
.modal[style*="display: block"] {
  display: flex !important;
}

.modal-content {
  background: var(--color-surface);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-large {
  max-width: 900px;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-text-secondary);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Business Detail Modal */
.business-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.detail-section {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.25rem;
  background: var(--color-background);
}

.detail-section h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--color-text);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5rem;
}

.detail-section.full-width {
  grid-column: 1 / -1;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table tr {
  border-bottom: 1px solid var(--color-border);
}

.detail-table tr:last-child {
  border-bottom: none;
}

.detail-table th {
  text-align: left;
  padding: 0.6rem 0;
  font-weight: 600;
  color: var(--color-text-secondary);
  width: 40%;
}

.detail-table td {
  padding: 0.6rem 0;
  color: var(--color-text);
}

.document-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.document-list li {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin-bottom: 1rem;
  background: var(--color-surface);
}

.document-list li:last-child {
  margin-bottom: 0;
}

.modal-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--color-border);
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .admin-controls {
    grid-template-columns: 1fr;
  }
  
  .stats-summary {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .admin-header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .admin-nav ul {
    flex-direction: column;
    gap: 0;
  }
  
  .admin-table {
    font-size: 0.85rem;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .business-detail-grid {
    grid-template-columns: 1fr;
  }
  
  .search-group input {
    min-width: auto;
    width: 100%;
  }
}

/* ============================================================================
   Location Cards with Delete Buttons
   ============================================================================ */

.location-card {
  position: relative;
}

.location-card:hover {
  border-color: var(--color-primary) !important;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.delete-location-btn {
  transition: all 0.2s ease;
}

.delete-location-btn:hover:not([disabled]) {
  background: #c82333 !important;
  transform: scale(1.05);
}

.delete-location-btn:active:not([disabled]) {
  transform: scale(0.95);
}

.delete-location-btn[disabled] {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.location-card-content {
  transition: background-color 0.2s ease;
}

.location-card:hover .location-card-content {
  background-color: rgba(212, 175, 55, 0.05);
  border-radius: 4px;
}

/* ============================================================================
   Modal Styles - Update Offer Dialog
   ============================================================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal.active,
.modal[style*="display: flex"] {
  display: flex;
}

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

.modal-content {
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(212, 175, 55, 0.3);
  max-width: 600px;
  width: calc(100% - 2rem);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  background: rgba(212, 175, 55, 0.05);
}

.modal-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  line-height: 1;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: var(--color-bg-darker);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-light);
}

.modal-footer {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
  font-size: var(--font-size-sm);
}

.form-input,
.form-textarea,
.form-select,
select {
  width: 100%;
  padding: var(--space-md);
  background: var(--color-bg-dark);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  transition: all var(--transition-base);
  box-sizing: border-box;
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}

select,
.form-select {
  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='%23d4af37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right clamp(0.75rem, 2vw, 1rem) center;
  padding-right: clamp(2rem, 5vw, 2.5rem);
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover,
select:hover {
  border-color: var(--color-primary);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  background: var(--color-bg-dark);
}

.form-input:disabled,
.form-textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.3);
}

.form-textarea {
  resize: vertical;
  min-height: clamp(100px, 20vw, 140px);
  line-height: 1.6;
}

/* Mobile form adjustments */
@media (max-width: 640px) {
  .form-input,
  .form-textarea,
  select {
    font-size: 16px; /* Prevents zoom on iOS */
    border-width: 1px;
  }
}

.form-hint {
  display: block;
  margin-top: var(--space-xs);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  font-style: italic;
}

/* Mobile responsiveness for modal */
@media (max-width: 768px) {
  .modal-content {
    max-width: 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

/* ============================================================================
   Smart Fulfillment Service Cards
   ============================================================================ */

.fulfillment-service-card {
  transition: all 0.3s ease;
}

.fulfillment-service-card:hover {
  border-color: var(--color-primary) !important;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}

.fulfillment-service-card input[type="checkbox"]:checked + span {
  color: var(--color-primary);
}

/* Service configuration sections with smooth animations */
.service-config-section {
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
  max-height: 0;
  opacity: 1;
}

.service-config-section[style*="display: block"] {
  opacity: 1;
}

/* ============================================================================
   Looking For Cards
   ============================================================================ */

.looking-for-card {
  position: relative;
}

.looking-for-card .card-header-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
}

.looking-for-card .game-icon {
  font-size: 1.5rem;
}

.looking-for-card .game-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.looking-for-card .status-badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.looking-for-card .status-badge.status-active {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success);
}

.looking-for-card .status-badge.status-found {
  background: rgba(0, 123, 255, 0.2);
  color: #5eb3ff;
  border: 1px solid #007bff;
}

.looking-for-card .status-badge.status-expired {
  background: rgba(128, 128, 128, 0.2);
  color: #aaaaaa;
  border: 1px solid #666666;
}

.looking-for-card .card-detail {
  margin: var(--space-xs) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.looking-for-card .card-detail strong {
  color: var(--color-primary);
  font-weight: 600;
}

.looking-for-card .card-notes {
  margin-top: var(--space-md);
  padding: var(--space-sm);
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-style: italic;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.looking-for-card .card-meta {
  margin-top: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.looking-for-card .card-footer {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

.looking-for-card .check-matches-btn {
  flex: 1;
  min-width: fit-content;
}

.looking-for-card .edit-card-btn,
.looking-for-card .delete-card-btn {
  flex: 0 0 auto;
}

/* Alert animation */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================================
   Loading States & Skeletons
   ============================================================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-light) 0%,
    rgba(212, 175, 55, 0.1) 50%,
    var(--color-surface-light) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 1em;
}

.skeleton-card {
  height: 200px;
  width: 100%;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-3xl);
  flex-direction: column;
  gap: var(--space-lg);
}

.loading-text {
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================================================
   Accessibility Improvements
   ============================================================================ */

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

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary);
  color: #000;
  padding: var(--space-md);
  z-index: var(--z-tooltip);
  transition: top 0.3s;
}

.skip-to-main:focus {
  top: 0;
}

/* Screen reader only */
.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;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  .header-nav,
  .site-footer,
  .btn,
  button {
    display: none !important;
  }
  
  .card,
  .container {
    border: 1px solid #000 !important;
    page-break-inside: avoid;
  }
}

/* ============================================================================
   Matches Modal & Cards
   ============================================================================ */

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr));
  gap: var(--space-lg);
  padding: var(--space-sm);
}

@media (max-width: 768px) {
  .matches-grid {
    grid-template-columns: 1fr;
  }
}

.match-card {
  background: var(--color-surface-light);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.match-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.match-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-surface);
}

.match-card-no-image {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-style: italic;
}

.match-card-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.match-card-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 var(--space-sm) 0;
  line-height: 1.2;
}

.match-card-detail {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.match-owner-info {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.match-owner,
.match-collection,
.match-stores {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: var(--space-xs) 0;
  line-height: 1.5;
}

.match-owner strong,
.match-collection strong,
.match-stores strong {
  color: var(--color-text-primary);
}

.contact-owner-btn {
  margin-top: var(--space-md);
  width: 100%;
}

/* ============================================================================
   Card Suggestions Dropdown
   ============================================================================ */

.card-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  margin-top: -2px;
}

.card-suggestion-item {
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--color-border);
}

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

.card-suggestion-item:hover {
  background: rgba(212, 175, 55, 0.1);
}

.card-suggestion-name {
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.card-suggestion-details {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.card-suggestion-detail {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.suggestion-loading {
  padding: var(--space-md);
  text-align: center;
  color: var(--color-text-secondary);
}

.suggestion-empty {
  padding: var(--space-md);
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ============================================================================
   Messages Page Styles - Modern Chat UI
   ============================================================================ */

.messages-app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-dark);
  overflow: hidden;
}

.messages-container {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100%;
  background: var(--color-bg-dark);
  box-shadow: inset 0 1px 0 rgba(212, 175, 55, 0.1);
}

/* Messages Sidebar */
.messages-sidebar {
  background: var(--color-bg-darker);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Sidebar Header */
.sidebar-header {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  background: var(--color-bg-darker);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-title {
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-primary);
  flex: 1;
}

.sidebar-header-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.btn-icon-secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-icon-secondary:hover {
  background: var(--color-primary);
  color: var(--color-bg-dark);
  border-color: var(--color-primary);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* Sidebar Tabs */
.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--color-bg-darker);
  border-bottom: 1px solid var(--color-border);
}

.tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.tab-button svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.tab-button:hover {
  background: var(--color-surface-light);
  color: var(--color-text-primary);
  border-color: var(--color-primary-dark);
}

.tab-button:hover svg {
  opacity: 1;
}

.tab-button.active {
  background: var(--color-primary);
  color: var(--color-bg-dark);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

.tab-button.active svg {
  opacity: 1;
}

/* Search Box */
.search-box {
  position: relative;
  padding: var(--space-md);
  background: var(--color-bg-darker);
  border-bottom: 1px solid var(--color-border);
}

.search-icon {
  position: absolute;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  background: var(--color-surface);
  color: var(--color-text-primary);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface-light);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

/* Tab Content */
.tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg-darker);
}

.tab-content.active {
  display: flex;
}

.threads-items {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.threads-items::-webkit-scrollbar {
  width: 6px;
}

.threads-items::-webkit-scrollbar-track {
  background: var(--color-bg-dark);
}

.threads-items::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.threads-items::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/* Thread & Contact Items */
.thread-item,
.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  background: var(--color-bg-darker);
}

.thread-item:hover,
.contact-item:hover {
  background: var(--color-surface);
  border-left: 2px solid var(--color-primary-dark);
}

.thread-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, transparent 100%);
  border-left: 3px solid var(--color-primary);
  box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.1);
}

.thread-item:last-child,
.contact-item:last-child {
  border-bottom: none;
}

/* Avatars */
.thread-avatar,
.thread-avatar-small {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

.thread-avatar-small {
  width: 44px;
  height: 44px;
}

.thread-avatar img,
.thread-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #c89f5d 100%);
  color: var(--color-bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Thread Info */
.thread-info,
.contact-info {
  flex: 1;
  min-width: 0;
}

.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.thread-username,
.contact-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-left: var(--space-sm);
}

.thread-preview {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.thread-preview.unread {
  font-weight: 600;
  color: var(--color-primary-light);
}

.unread-badge {
  position: absolute;
  right: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primary);
  color: var(--color-bg-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
  box-shadow: var(--shadow-glow);
}

/* Empty States */
.no-threads,
.loading-state {
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  color: var(--color-text-muted);
}

.no-threads p {
  margin: var(--space-sm) 0 0;
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

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

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

/* Contact Store Badge */
.contact-store {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
}

.contact-action-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 18px;
  background: var(--color-surface);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  transition: all 0.2s ease;
}

.contact-action-btn:hover {
  background: var(--color-primary);
  color: var(--color-bg-dark);
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

/* Thread View (Main Chat Area) */
.thread-view {
  background: var(--color-bg-dark);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Empty State */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-3xl);
  text-align: center;
}

.empty-state-icon {
  opacity: 0.2;
  color: var(--color-primary);
}

.empty-state h3 {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-primary);
}

.empty-state p {
  margin: 0;
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
  max-width: 400px;
}

/* Thread Header Bar */
.thread-header-bar {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-darker);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.thread-participant {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.btn-icon-danger {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-error);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon-danger:hover {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(220, 53, 69, 0.5);
}

.participant-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.participant-name {
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
}

.view-profile-link {
  font-size: var(--font-size-sm);
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

.view-profile-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Messages List */
.messages-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background: var(--color-bg-dark);
}

.messages-list::-webkit-scrollbar {
  width: 8px;
}

.messages-list::-webkit-scrollbar-track {
  background: var(--color-bg-darker);
}

.messages-list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.messages-list::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 65%;
  animation: messageSlideIn 0.25s ease-out;
}

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

.message-received {
  align-self: flex-start;
}

.message-sent {
  align-self: flex-end;
}

.message-content {
  padding: 12px 16px;
  border-radius: 18px;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: var(--font-size-base);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.message-received .message-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  border-bottom-left-radius: 4px;
}

.message-sent .message-content {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-bg-dark);
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
}

.message-deleted .message-content {
  background: var(--color-bg-darker);
  border: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-style: italic;
  opacity: 0.6;
}

.message-time {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
  padding: 0 8px;
}

/* Message Input Area */
.message-input-container {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-darker);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

#reply-form {
  display: flex;
  gap: var(--space-md);
  align-items: flex-end;
}

.message-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: 24px;
  font-family: inherit;
  font-size: var(--font-size-base);
  resize: none;
  min-height: 48px;
  max-height: 160px;
  transition: all 0.2s ease;
  line-height: 1.5;
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.message-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
  background: var(--color-surface-light);
}

.message-input::placeholder {
  color: var(--color-text-muted);
}

#reply-form .btn {
  height: 48px;
  width: 48px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

#reply-form .btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

#reply-form .btn svg {
  margin: 0;
}

/* Recipient Suggestions */
#recipient-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.suggestion-item:hover {
  background: var(--color-surface);
  border-left: 2px solid var(--color-primary);
}

.suggestion-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.suggestion-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-results {
  padding: var(--space-md);
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Compose Modal */
#compose-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}

#compose-modal.show {
  display: flex;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.messages-page .modal-content {
  background: var(--color-bg-darker);
  padding: 32px;
  border-radius: 16px;
  max-width: 540px;
  width: 90%;
  border: 1px solid var(--color-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.2);
  animation: modalSlideIn 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.messages-page .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--color-border);
}

.messages-page .modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.close-modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.close-modal:hover {
  background: var(--color-primary);
  color: var(--color-bg-dark);
  border-color: var(--color-primary);
  transform: rotate(90deg);
  box-shadow: var(--shadow-glow);
}

.messages-page .form-group {
  margin-bottom: 20px;
}

.messages-page .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.messages-page .form-group input,
.messages-page .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: var(--font-size-base);
  transition: all 0.2s ease;
  box-sizing: border-box;
  background: var(--color-surface);
  color: var(--color-text-primary);
}

.messages-page .form-group input:focus,
.messages-page .form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface-light);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.messages-page .form-group input::placeholder,
.messages-page .form-group textarea::placeholder {
  color: var(--color-text-muted);
}

.messages-page .form-group input[readonly] {
  background: var(--color-bg-dark);
  cursor: not-allowed;
  color: var(--color-text-muted);
  border-style: dashed;
}

.messages-page .form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.messages-page .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.messages-page .modal-actions .btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.messages-page .modal-actions .btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.messages-page .modal-actions .btn-secondary:hover {
  background: var(--color-surface-light);
  border-color: var(--color-primary-dark);
}

.messages-page .modal-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

/* Confirmation Dialog */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease-out;
}

.confirm-modal-content {
  background: var(--color-bg-darker);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.2);
  animation: modalSlideIn 0.3s ease-out;
  text-align: center;
}

.confirm-icon {
  margin-bottom: 20px;
  color: var(--color-warning);
}

.confirm-icon svg {
  filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.5));
}

.confirm-title {
  margin: 0 0 24px 0;
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.4;
}

.confirm-details {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.confirm-listing-title {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  margin-bottom: 8px;
  word-wrap: break-word;
}

.confirm-sku {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-family: 'Courier New', monospace;
  margin-bottom: 12px;
}

.confirm-bulk-count {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  padding: 12px;
  background: rgba(212, 175, 55, 0.1);
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.confirm-bulk-count strong {
  color: var(--color-primary);
  font-size: var(--font-size-lg);
  margin: 0 4px;
}

.confirm-warning {
  background: rgba(220, 53, 69, 0.1);
  border-left: 3px solid var(--color-error);
  padding: 12px;
  border-radius: 4px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-actions .btn {
  flex: 1;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(220, 53, 69, 0.6);
}

.btn-warning {
  background: #ff9800;
  color: white;
}

.btn-warning:hover {
  background: #f57c00;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 152, 0, 0.6);
}

/* ============================================================================
   MOBILE RESPONSIVE - Messages Page
   Complete responsive overhaul for mobile and tablet devices
   ============================================================================ */

/* Tablet and Mobile (768px and below) */
@media (max-width: 768px) {
  /* Full-screen app on mobile */
  .messages-app {
    top: 0;
  }
  
  /* Single column layout - sidebar and thread view stack */
  .messages-container {
    grid-template-columns: 1fr;
    position: relative;
  }
  
  /* Sidebar takes full width on mobile */
  .messages-sidebar {
    width: 100%;
    border-right: none;
  }
  
  /* Thread view overlays sidebar on mobile */
  .thread-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: none; /* Hidden by default */
  }
  
  /* Show thread view when mobile-visible class is added */
  .thread-view.mobile-visible {
    display: flex;
  }
  
  /* Hide sidebar when mobile-hidden class is added */
  .messages-sidebar.mobile-hidden {
    display: none;
  }
  
  /* Mobile back button - only visible on mobile */
  .mobile-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: var(--space-md);
  }
  
  .mobile-back-btn:hover {
    background: var(--color-primary);
    color: var(--color-bg-dark);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
  }
  
  /* Larger touch targets for mobile */
  .thread-item,
  .contact-item {
    padding: var(--space-lg);
    min-height: 80px;
  }
  
  .thread-avatar,
  .thread-avatar-small {
    width: 56px;
    height: 56px;
  }
  
  .avatar-placeholder {
    font-size: 24px;
  }
  
  /* Larger text on mobile */
  .sidebar-title {
    font-size: var(--font-size-xl);
  }
  
  .thread-username,
  .contact-name {
    font-size: var(--font-size-lg);
  }
  
  .thread-preview,
  .contact-store {
    font-size: var(--font-size-base);
  }
  
  /* Tab buttons larger on mobile */
  .tab-button {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-base);
  }
  
  .tab-button svg {
    width: 22px;
    height: 22px;
  }
  
  /* Search input larger */
  .search-input {
    padding: var(--space-md) var(--space-md) var(--space-md) 44px;
    font-size: var(--font-size-base);
  }
  
  .search-icon {
    left: 30px;
    width: 18px;
    height: 18px;
  }
  
  /* Contact action button larger */
  .contact-action-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  /* Thread header adjustments */
  .thread-header-bar {
    padding: var(--space-md) var(--space-lg);
    flex-wrap: nowrap;
  }
  
  .thread-participant {
    flex: 1;
    min-width: 0;
  }
  
  .participant-name {
    font-size: var(--font-size-base);
  }
  
  .view-profile-link {
    font-size: 13px;
  }
  
  .btn-icon-danger {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }
  
  /* Messages list padding */
  .messages-list {
    padding: var(--space-lg);
  }
  
  /* Message bubbles wider on mobile */
  .message {
    max-width: 80%;
  }
  
  .message-content {
    padding: 14px 18px;
    font-size: var(--font-size-base);
  }
  
  /* Message input larger */
  .message-input-container {
    padding: var(--space-md) var(--space-lg);
  }
  
  .message-input {
    padding: 14px 18px;
    font-size: var(--font-size-base);
    min-height: 52px;
  }
  
  #reply-form .btn {
    width: 52px;
    height: 52px;
  }
  
  #reply-form .btn svg {
    width: 20px;
    height: 20px;
  }
  
  /* Modal adjustments */
  .messages-page .modal-content {
    width: 95%;
    padding: 24px;
  }
  
  .messages-page .modal-header h2 {
    font-size: 20px;
  }
  
  .messages-page .form-group input,
  .messages-page .form-group textarea {
    font-size: var(--font-size-base);
    padding: 14px;
  }
  
  .messages-page .modal-actions {
    flex-direction: column;
  }
  
  .messages-page .modal-actions .btn {
    width: 100%;
    padding: 14px;
  }
  
  /* Confirmation modal */
  .confirm-modal-content {
    width: 95%;
    padding: 24px;
  }
  
  .confirm-actions {
    flex-direction: column;
  }
  
  .confirm-actions .btn {
    width: 100%;
    padding: 14px;
  }
  
  /* Empty state */
  .empty-state {
    padding: var(--space-2xl);
  }
  
  .empty-state-icon {
    width: 64px;
    height: 64px;
  }
  
  .empty-state h3 {
    font-size: var(--font-size-lg);
  }
  
  .empty-state p {
    font-size: var(--font-size-sm);
  }
}

/* Small Mobile (480px and below) */
@media (max-width: 480px) {
  /* Reduce spacing further */
  .messages-app {
    top: 0;
  }
  
  .sidebar-header {
    padding: var(--space-md);
  }
  
  .sidebar-title {
    font-size: var(--font-size-lg);
  }
  
  .sidebar-tabs {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-xs);
  }
  
  .tab-button {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    gap: 6px;
  }
  
  .tab-button svg {
    width: 18px;
    height: 18px;
  }
  
  .tab-button span {
    display: none; /* Hide text, show only icons on very small screens */
  }
  
  .search-box {
    padding: var(--space-sm) var(--space-md);
  }
  
  .thread-item,
  .contact-item {
    padding: var(--space-md);
  }
  
  .thread-avatar,
  .thread-avatar-small {
    width: 48px;
    height: 48px;
  }
  
  .avatar-placeholder {
    font-size: 20px;
  }
  
  .thread-username,
  .contact-name {
    font-size: var(--font-size-base);
  }
  
  .thread-preview,
  .contact-store {
    font-size: var(--font-size-sm);
  }
  
  .thread-header-bar {
    padding: var(--space-sm) var(--space-md);
  }
  
  .mobile-back-btn {
    width: 40px;
    height: 40px;
    margin-right: var(--space-sm);
  }
  
  .mobile-back-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .btn-icon-danger {
    width: 40px;
    height: 40px;
  }
  
  .btn-icon-danger svg {
    width: 16px;
    height: 16px;
  }
  
  .participant-name {
    font-size: var(--font-size-sm);
  }
  
  .view-profile-link {
    font-size: 12px;
  }
  
  .messages-list {
    padding: var(--space-md);
  }
  
  .message {
    max-width: 85%;
  }
  
  .message-content {
    padding: 12px 16px;
    font-size: var(--font-size-sm);
  }
  
  .message-time {
    font-size: 10px;
  }
  
  .message-input-container {
    padding: var(--space-sm) var(--space-md);
  }
  
  .message-input {
    padding: 12px 16px;
    font-size: var(--font-size-sm);
    min-height: 48px;
  }
  
  #reply-form .btn {
    width: 48px;
    height: 48px;
  }
  
  #reply-form .btn svg {
    width: 18px;
    height: 18px;
  }
  
  /* Hide back button text on desktop (CSS for desktop - desktop hides by default) */
  .mobile-back-btn {
    display: none; /* Will be overridden on mobile */
  }
}

/* Desktop - hide mobile back button */
@media (min-width: 769px) {
  .mobile-back-btn {
    display: none !important;
  }
}

/* ============================================================================
   Empty States & No Results
   ============================================================================ */

.empty-state,
.no-results-message {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, var(--color-bg-darker) 50%, rgba(212, 175, 55, 0.05) 100%);
  border: 2px dashed rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-xl);
  color: var(--color-text-secondary);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.empty-state h2,
.empty-state h3,
.no-results-message h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-md);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
}

.empty-state p,
.no-results-message p {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: var(--space-md) 0;
}

.empty-state-icon,
.no-results-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  opacity: 0.3;
}

.loading-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-secondary);
}

.loading-state p {
  margin-top: var(--space-md);
  color: var(--color-text-secondary);
}

/* ============================================================================
   Badges & Status Indicators
   ============================================================================ */

.badge,
.store-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.badge-success,
.store-badge.connected {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid var(--color-success);
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.badge-warning,
.store-badge.pending {
  background: rgba(237, 137, 54, 0.2);
  color: #fbd38d;
  border: 1px solid #ed8936;
  box-shadow: 0 2px 8px rgba(237, 137, 54, 0.3);
}

.badge-info,
.store-badge.verified {
  background: rgba(212, 175, 55, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid var(--color-error);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* ============================================================================
   Dark Mode Support (Future Enhancement)
   ============================================================================ */

@media (prefers-color-scheme: light) {
  /* Light mode overrides can be added here if needed */
}

/* ============================================================================
   MOBILE-FIRST RESPONSIVE OVERHAUL
   Comprehensive mobile navigation, touch targets, and layouts
   ============================================================================ */

/* Safe Area Insets for notched devices (iPhone X+, modern Android) */
:root {
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
}

/* Apply safe area padding to body */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-left: max(env(safe-area-inset-left), var(--space-sm));
    padding-right: max(env(safe-area-inset-right), var(--space-sm));
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============================================================================
   Mobile Hamburger Menu System
   ============================================================================ */

/* Hamburger menu button - hidden by default on desktop */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  cursor: pointer;
  z-index: var(--z-sticky);
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-primary-light);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* Hamburger icon bars */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 24px;
  height: 24px;
}

.hamburger-icon span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger animation when menu is open */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile navigation overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile slide-out menu */
.mobile-nav-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100%;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg-dark) 100%);
  border-left: 2px solid var(--color-primary);
  z-index: var(--z-modal);
  padding: var(--space-xl);
  padding-top: calc(var(--space-xl) + var(--safe-area-inset-top));
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-menu.active {
  display: flex;
  flex-direction: column;
  right: 0;
}

/* Mobile menu header */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}

.mobile-menu-header h2 {
  margin: 0;
  font-size: var(--font-size-lg);
  color: var(--color-primary);
}

.mobile-menu-close {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-close:hover,
.mobile-menu-close:active {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Mobile menu navigation items */
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
}

.mobile-menu-nav a,
.mobile-menu-nav button {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: var(--font-size-base);
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  width: 100%;
  text-align: left;
  min-height: 52px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-nav a:hover,
.mobile-menu-nav a:active,
.mobile-menu-nav button:hover,
.mobile-menu-nav button:active {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateX(4px);
}

.mobile-menu-nav a span,
.mobile-menu-nav button span {
  font-size: 1.25rem;
}

/* Mobile menu divider */
.mobile-menu-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-md) 0;
}

/* Mobile menu footer */
.mobile-menu-footer {
  margin-top: auto;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

/* ============================================================================
   Mobile Header Improvements
   ============================================================================ */

@media (max-width: 768px) {
  /* Show hamburger menu */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* Hide desktop nav items */
  .header-nav {
    display: none !important;
  }
  
  /* Adjust header for mobile */
  .header {
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
  }
  
  .header h1 {
    font-size: clamp(0.95rem, 4.5vw, 1.2rem);
    line-height: 1.2;
    flex: 1;
    text-align: left;
    padding-right: var(--space-sm);
  }
  
  /* Prevent body scroll when menu is open */
  body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
}

/* Tablet - show compact nav */
@media (min-width: 769px) and (max-width: 1024px) {
  .header-nav .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .header-nav .btn span {
    display: none;
  }
}

/* ============================================================================
   Mobile Card Grid Improvements
   ============================================================================ */

@media (max-width: 768px) {
  .card-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
  }
  
  .card,
  .stat-card,
  .section-card,
  .card-section {
    margin: 0;
    padding: var(--space-lg);
  }
  
  .card-header {
    padding: var(--space-md) 0;
  }
  
  .card-body {
    padding: var(--space-sm) 0;
  }
  
  .card-title {
    font-size: var(--font-size-lg);
  }
  
  /* Grid layouts become single column */
  .stats-grid,
  .stores-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .card,
  .stat-card,
  .section-card,
  .card-section {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }
  
  .card-title {
    font-size: var(--font-size-base);
  }
  
  .action-nav {
    gap: var(--space-sm);
  }
  
  .action-nav .btn {
    padding: var(--space-md);
    font-size: var(--font-size-sm);
  }
}

/* ============================================================================
   Mobile Form Improvements
   ============================================================================ */

@media (max-width: 768px) {
  /* Ensure all form elements are touch-friendly */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  select,
  textarea {
    width: 100%;
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }
  
  /* Form groups stack vertically */
  .form-group,
  .form-row {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .form-group label {
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-xs);
  }
  
  /* Button improvements */
  .btn {
    min-height: 48px;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-base);
  }
  
  /* Button groups */
  .button-group,
  .form-actions,
  .modal-actions {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .button-group .btn,
  .form-actions .btn,
  .modal-actions .btn {
    width: 100%;
  }
  
  /* Search inputs */
  .search-container {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .search-input {
    width: 100%;
  }
  
  .search-btn {
    width: 100%;
  }
}

/* ============================================================================
   Mobile Modal Improvements  
   ============================================================================ */

@media (max-width: 640px) {
  .modal.active {
    padding: 0;
    align-items: stretch;
  }
  
  .modal-content {
    max-width: 100%;
    max-height: 100%;
    min-height: 100vh;
    border-radius: 0;
    border-width: 0;
    border-top: 2px solid var(--color-primary);
  }
  
  .modal-header {
    padding: var(--space-lg);
    padding-top: calc(var(--space-lg) + var(--safe-area-inset-top));
    position: sticky;
    top: 0;
    background: var(--color-surface);
    z-index: 1;
  }
  
  .modal-header h2 {
    font-size: var(--font-size-lg);
  }
  
  .modal-body {
    padding: var(--space-lg);
    padding-bottom: calc(var(--space-lg) + var(--safe-area-inset-bottom));
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal-close {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
}

/* ============================================================================
   Mobile Table & Data Display Improvements
   ============================================================================ */

@media (max-width: 768px) {
  /* Horizontal scroll wrapper for complex tables */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
  }
  
  /* Collection cards table already stacks - ensure proper spacing */
  .collection-cards-table {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .collection-card-row {
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
  }
  
  /* Stats row on collections */
  .collection-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
  }
  
  .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
  }
  
  .stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-xs);
  }
  
  .stat-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-primary);
  }
}

/* ============================================================================
   Touch & Scroll Improvements
   ============================================================================ */

/* Better touch handling */
* {
  -webkit-tap-highlight-color: rgba(212, 175, 55, 0.2);
}

/* Momentum scrolling for iOS */
.scrollable,
.modal-body,
.mobile-nav-menu,
.messages-container,
.thread-messages {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Prevent pull-to-refresh on main content */
html, body {
  overscroll-behavior-y: none;
}

/* Touch-friendly dropdown improvements */
@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed;
    left: var(--space-md) !important;
    right: var(--space-md) !important;
    bottom: var(--space-xl);
    top: auto !important;
    margin-top: 0;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    animation: slideUpMobile 0.3s ease-out;
  }
  
  @keyframes slideUpMobile {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .dropdown-item {
    padding: var(--space-md) var(--space-lg);
    min-height: 52px;
    display: flex;
    align-items: center;
  }
}

/* ============================================================================
   Mobile Page Header Improvements
   ============================================================================ */

@media (max-width: 768px) {
  .page-header {
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    text-align: center;
  }
  
  .page-header h1 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .page-header p {
    font-size: var(--font-size-sm);
  }
  
  /* Page header with buttons */
  .page-header-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    width: 100%;
  }
  
  .page-header-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .page-header {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }
  
  .page-header h1 {
    font-size: var(--font-size-xl);
  }
}

/* ============================================================================
   Mobile Footer Improvements
   ============================================================================ */

@media (max-width: 768px) {
  .site-footer {
    padding: var(--space-lg);
    padding-bottom: calc(var(--space-lg) + var(--safe-area-inset-bottom));
  }
  
  .footer-links {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .footer-links span {
    display: none;
  }
  
  .footer-links a {
    padding: var(--space-sm);
  }
}

/* ============================================================================
   Mobile-Specific Visibility Utilities
   ============================================================================ */

/* Hide on mobile */
.hide-on-mobile {
  display: block;
}

@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}

/* Show only on mobile */
.show-on-mobile {
  display: none !important;
}

@media (max-width: 768px) {
  .show-on-mobile {
    display: block !important;
  }
  
  .show-on-mobile-flex {
    display: flex !important;
  }
  
  .show-on-mobile-inline {
    display: inline !important;
  }
}

/* Hide on tablet and below */
.hide-below-tablet {
  display: block;
}

@media (max-width: 1024px) {
  .hide-below-tablet {
    display: none !important;
  }
}

/* ============================================================================
   Mobile Touch Target Minimum Size
   ============================================================================ */

@media (max-width: 768px) {
  /* Ensure all interactive elements meet 44x44 minimum */
  a:not(.link):not([class*="text"]),
  button:not(.mobile-menu-close),
  .btn,
  .tab-button,
  .dropdown-toggle,
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Checkbox and radio larger touch targets */
  input[type="checkbox"],
  input[type="radio"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
  }
  
  /* Links within text can be smaller */
  p a,
  .text-link,
  .inline-link {
    min-height: auto;
    min-width: auto;
    padding: var(--space-xs) 0;
  }
}

/* ============================================================================
   Mobile-Specific Animation Performance
   ============================================================================ */

@media (max-width: 768px) {
  /* Reduce motion for better performance */
  .card:hover,
  .stat-card:hover,
  .btn:hover,
  .store-card:hover {
    transform: none;
  }
  
  /* Use simpler transitions on mobile */
  * {
    transition-duration: 0.15s !important;
  }
  
  /* Disable complex animations on low-power preference */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation: none !important;
      transition: none !important;
    }
  }
}

/* ============================================================================
   Mobile Collection Detail Page
   ============================================================================ */

@media (max-width: 768px) {
  /* Stats dashboard on collections */
  .stats-dashboard {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  
  .stats-dashboard .stat-card {
    padding: var(--space-md);
    flex-direction: column;
    text-align: center;
  }
  
  .stats-dashboard .stat-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
  }
  
  .stats-dashboard .stat-value {
    font-size: var(--font-size-lg);
    word-break: break-all;
  }
  
  .stats-dashboard .stat-label {
    font-size: var(--font-size-xs);
  }
  
  /* Collection search section */
  .add-card-section .search-container {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .add-card-section .search-container input,
  .add-card-section .search-container button {
    width: 100%;
  }
  
  /* Cards table - convert to card layout on mobile */
  .cards-table {
    display: block;
  }
  
  .cards-table thead {
    display: none;
  }
  
  .cards-table tbody {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .cards-table tr {
    display: grid;
    grid-template-columns: 60px 1fr;
    grid-template-rows: auto;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }
  
  .cards-table .card-image-cell {
    grid-row: 1 / 3;
    align-self: start;
  }
  
  .cards-table .card-thumbnail {
    width: 50px;
    height: auto;
    border-radius: var(--radius-sm);
  }
  
  .cards-table .card-name-cell {
    grid-column: 2;
    font-weight: 600;
    font-size: var(--font-size-base);
  }
  
  /* Stack other cells */
  .cards-table td {
    display: flex;
    align-items: center;
    padding: var(--space-xs) 0;
    font-size: var(--font-size-sm);
  }
  
  .cards-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-secondary);
    min-width: 80px;
    font-size: var(--font-size-xs);
  }
  
  /* Quantity control on mobile */
  .quantity-control {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
  }
  
  .quantity-control .qty-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    font-size: 1.2rem;
  }
  
  .quantity-control .qty-input {
    width: 50px;
    text-align: center;
    padding: var(--space-xs);
  }
  
  /* Cards selects on mobile */
  .card-finish-select,
  .card-condition-select {
    width: 100%;
    min-height: 40px;
    font-size: var(--font-size-sm);
  }
  
  /* Collection header actions */
  .collection-header .header-actions {
    flex-direction: column;
    gap: var(--space-sm);
    align-items: stretch;
    width: 100%;
  }
  
  .collection-header .header-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Filter input on mobile */
  .header-actions .form-input-sm {
    width: 100%;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .stats-dashboard {
    grid-template-columns: 1fr;
  }
  
  .stats-dashboard .stat-card {
    flex-direction: row;
    text-align: left;
    gap: var(--space-md);
  }
  
  .stats-dashboard .stat-icon {
    margin-bottom: 0;
  }
  
  .cards-table tr {
    grid-template-columns: 1fr;
  }
  
  .cards-table .card-image-cell {
    grid-row: auto;
    justify-content: center;
  }
  
  .cards-table .card-thumbnail {
    width: 100px;
    max-width: 100%;
  }
}

/* ============================================================================
   Mobile-Specific Game Tabs
   ============================================================================ */

@media (max-width: 768px) {
  .game-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
  }
  
  .game-tabs .tab-btn {
    flex: 1 1 calc(50% - var(--space-xs));
    padding: var(--space-sm);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    justify-content: center;
  }
  
  .game-tabs .tab-btn span {
    margin-right: var(--space-xs);
  }
}

@media (max-width: 360px) {
  .game-tabs .tab-btn {
    flex: 1 1 100%;
  }
}
