/**
 * trade-central.css
 * 
 * Dedicated styles for the Trade Central feature in Aether Chronicles.
 * This file implements a modern, distinct visual style with animations.
 */

/* ===== Base Styles ===== */

#screen-trade-central {
  /* Use a more visually appealing gradient background */
  background: linear-gradient(135deg, #8a0303, #b30000, #8a0303);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  padding: 20px;
  /* Reduced padding for better fit */
  color: #f0f0f0;
  /* Slightly lighter base text color */
  height: calc(100vh - 60px);
  /* Account for header height */
  position: fixed;
  top: 60px;
  /* Position below header */
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
  overflow-x: hidden;
  /* Prevent horizontal scrolling */
  line-height: 1.5;
  /* Consistent base line-height */
  box-sizing: border-box;
  /* Ensure padding is included in dimensions */
}

/* Add styles for the create trade request section specifically */
#create-trade-request-area {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Take available space */
  min-height: 0;
  /* Allow shrinking */
  overflow: hidden;
  /* Prevent overflow */
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Main heading - hidden to avoid conflicts with other elements */
#screen-trade-central h2 {
  display: none;
  /* Hide the header completely */
}

/* Section headings */
#screen-trade-central h3 {
  font-size: 2rem;
  /* Slightly larger */
  margin-bottom: 25px;
  /* Increased margin */
  color: #FFF0E0;
  /* FloralWhite - warmer off-white */
  font-weight: 600;
  /* Bolder */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  /* Slightly stronger shadow for contrast */
}

/* Sub-section headings */
#screen-trade-central h4 {
  font-size: 1.5rem;
  /* Slightly larger */
  margin-bottom: 18px;
  /* Increased margin */
  color: #FDF5E6;
  /* OldLace - warmer, slightly less bright than h3 */
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  /* Slightly stronger shadow */
}

/* Paragraphs */
#screen-trade-central p {
  font-size: 1.05rem;
  /* Slightly larger for readability */
  line-height: 1.7;
  /* Increased line height */
  margin-bottom: 18px;
  color: rgba(240, 240, 240, 0.95);
  /* Brighter for better contrast */
}

/* Main layout container */
.trade-central-layout {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
  width: calc(100% - 40px);
  /* Account for screen padding */
  height: calc(100vh - 140px);
  /* Account for header and padding */
  box-sizing: border-box;
  overflow: hidden;
  /* Prevent layout overflow */
}

/* Trade explanation section */
.trade-explanation {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  padding: 15px 20px;
  /* Reduced padding */
  margin-top: 15px;
  /* Reduced margin */
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-left: 4px solid rgba(255, 215, 0, 0.5);
  font-size: 0.9em;
  /* Reduced font size */
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 20px;
  /* Reduced margin */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  line-height: 1.5;
  /* Reduced line height */
  flex-shrink: 0;
  /* Prevent shrinking */
  box-sizing: border-box;
}

.trade-explanation strong {
  color: rgba(255, 215, 0, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ===== Navigation and Options ===== */

/* Options container */
.trade-options {
  display: flex;
  justify-content: center;
  gap: 20px;
  /* Reduced gap for better fit */
  margin-bottom: 15px;
  /* Reduced margin */
  margin-top: 10px;
  /* Reduced top margin */
  position: sticky;
  top: 0;
  width: 100%;
  padding: 15px;
  /* Reduced padding */
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  z-index: 10;
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-sizing: border-box;
  flex-shrink: 0;
  /* Prevent shrinking */
}

/* Main navigation buttons */
#create-trade-request-btn,
#view-trade-requests-btn,
#random-trade-btn {
  background: rgba(0, 0, 0, 0.25);
  /* More subtle background */
  color: #e0e0e0;
  /* Lighter text */
  border: 1px solid #C8A86C;
  /* Muted gold accent border */
  border-radius: 8px;
  /* Slightly smaller radius */
  padding: 12px 25px;
  /* Adjusted padding */
  font-size: 1.1rem;
  /* Adjusted font size */
  font-weight: 500;
  /* Normal weight */
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), inset 0 0 5px rgba(200, 168, 108, 0.1);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
}

#create-trade-request-btn:hover,
#view-trade-requests-btn:hover,
#random-trade-btn:hover {
  background: rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 0 8px rgba(200, 168, 108, 0.15);
  border-color: #D4B77A;
  /* Brighter gold on hover */
  color: #ffffff;
}

#create-trade-request-btn:active,
#view-trade-requests-btn:active,
#random-trade-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Active button state */
.trade-options button.active {
  background: #C8A86C;
  /* Solid muted gold background */
  color: #2c1e08;
  /* Dark text for contrast */
  border-color: #B08D57;
  /* Darker gold border */
  box-shadow: 0 0 15px rgba(200, 168, 108, 0.5), inset 0 0 10px rgba(0, 0, 0, 0.2);
  /* Stronger shadow, inner shadow */
  transform: translateY(-1px);
  /* Slight lift */
  font-weight: 600;
  /* Bolder text for active state */
}

/* Button hover effect - subtle glow */
#create-trade-request-btn::after,
#view-trade-requests-btn::after,
#random-trade-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#create-trade-request-btn:hover::after,
#view-trade-requests-btn:hover::after,
#random-trade-btn:hover::after {
  opacity: 1;
}

/* ===== Trade Sections ===== */

/* Common styles for all trade sections */
.trade-section {
  background: rgba(10, 2, 2, 0.45);
  /* Darker, subtly red-brown tinted for depth */
  border-radius: 20px;
  padding: 20px;
  /* Reduced padding */
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), inset 0 0 20px rgba(0, 0, 0, 0.35);
  /* Deeper inset shadow */
  transition: opacity 0.5s ease, transform 0.5s ease;
  opacity: 0;
  transform: translateY(0);
  display: none;
  border: 1px solid #B08D57;
  /* Darker bronze border for richness */
  margin: 0 auto;
  max-width: 100%;
  /* Use full available width */
  position: relative;
  top: 0;
  width: 100%;
  z-index: 5;
  overflow-y: auto;
  flex: 1;
  /* Take available space */
  min-height: 0;
  /* Allow shrinking */
  backdrop-filter: blur(6px);
  /* Slightly increased blur */
  box-sizing: border-box;
}

/* Active section state - applied via JS */
.trade-section.active-section {
  opacity: 1;
  transform: translateY(0);
  display: block;
  animation: fadeIn 0.7s ease-in-out;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.2), 0 15px 40px rgba(0, 0, 0, 0.4);
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Create trade request area */
#create-trade-request-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Trade creation interface */
.trade-creation-interface {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  /* Reduced gap */
  margin-top: 10px;
  /* Reduced top margin */
  margin-bottom: 15px;
  /* Reduced bottom margin */
  width: 100%;
  /* Ensure full width */
  flex: 1;
  /* Allow it to grow and take available space */
  min-height: 0;
  /* Allow shrinking */
  overflow: hidden;
  /* Prevent interface overflow */
}

@media (max-width: 768px) {
  .trade-creation-interface {
    grid-template-columns: 1fr;
  }
}

/* Trade give/receive sections */
.trade-give-section,
.trade-receive-section {
  background: rgba(25, 15, 10, 0.4);
  /* Distinct, warmer brown background */
  border-radius: 15px;
  padding: 15px;
  /* Reduced padding */
  display: flex;
  flex-direction: column;
  gap: 15px;
  /* Reduced gap */
  border: 1px solid #C8A86C;
  /* Muted gold border, consistent with other accents */
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.25);
  /* Refined shadow */
  margin-bottom: 10px;
  /* Reduced margin */
  flex: 1;
  min-width: 0;
  /* Allow shrinking */
  min-height: 0;
  /* Allow shrinking */
  overflow: hidden;
  /* Prevent overflow */
  box-sizing: border-box;
}

/* Card selection areas */
.card-selection-area {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  /* Reduced card size for better fit */
  gap: 15px;
  /* Reduced gap */
  flex: 1;
  /* Take available space */
  min-height: 200px;
  /* Reduced minimum height */
  max-height: 300px;
  /* Set maximum height */
  overflow-y: auto;
  padding: 15px;
  /* Reduced padding */
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.15);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

/* Scrollbar styling */
.card-selection-area::-webkit-scrollbar {
  width: 8px;
}

.card-selection-area::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.card-selection-area::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.card-selection-area::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Selected card display */
.selected-card-display {
  height: 180px;
  /* Reduced height */
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 10px;
  /* Reduced padding */
  border: 2px solid rgba(255, 215, 0, 0.4);
  position: relative;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  /* Reduced margin */
  flex-shrink: 0;
  /* Prevent shrinking */
  box-sizing: border-box;
}

/* Add a hint text for drop zones */
.selected-card-display::before {
  content: 'Drop card here';
  position: absolute;
  color: rgba(255, 215, 0, 0.5);
  font-style: italic;
  pointer-events: none;
  opacity: 0.7;
  font-size: 1.1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Hide the hint text when a card is present */
.selected-card-display:has(.card)::before {
  display: none;
}

/* Card styling within trade central */
.card-selection-area .card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 215, 0, 0.1);
}

.card-selection-area .card:hover {
  transform: translateY(-8px) scale(1.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.2);
  z-index: 5;
}

.card-selection-area .card.selected {
  border: 2px solid rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Drag and drop styles */
.card-selection-area .card.dragging {
  opacity: 0.6;
  transform: scale(1.05);
  cursor: grabbing;
}

.selected-card-display.drop-hover {
  background: rgba(255, 215, 0, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.8);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), inset 0 0 30px rgba(255, 215, 0, 0.1);
}

/* ===== Action Buttons ===== */

/* Primary action buttons */
#submit-trade-request-btn,
#submit-random-trade-btn {
  background: linear-gradient(135deg, #c50000, #e00000);
  /* Brighter red gradient */
  color: #ffffff;
  border: 1px solid #8a0000;
  /* Slightly darker border */
  border-bottom: 4px solid #600000;
  /* Even stronger bottom border */
  border-radius: 10px;
  /* Slightly more rounded */
  padding: 18px 40px;
  /* More horizontal padding */
  font-size: 1.35rem;
  /* Slightly larger font */
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease-out;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35), inset 0 -3px 4px rgba(0, 0, 0, 0.25);
  /* Enhanced shadow */
  margin-top: 25px;
  align-self: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  /* Stronger text shadow */
  letter-spacing: 1.3px;
  /* More letter spacing */
  width: 340px;
  /* Wider */
  margin-bottom: 20px;
}

#submit-trade-request-btn:hover,
#submit-random-trade-btn:hover {
  transform: translateY(-4px) scale(1.03);
  /* More lift and scale */
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), inset 0 -2px 3px rgba(0, 0, 0, 0.2);
  /* Enhanced hover shadow */
  background: linear-gradient(135deg, #dc0000, #f50000);
  /* Even brighter red on hover */
}

#submit-trade-request-btn:active,
#submit-random-trade-btn:active {
  transform: translateY(-1px) scale(0.98);
  /* More noticeable press down effect */
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(0, 0, 0, 0.35);
  /* Adjusted active shadow */
  background: linear-gradient(135deg, #a00000, #b30000);
  /* Slightly adjusted active red */
}

/* Disabled state */
#submit-trade-request-btn:disabled,
#submit-random-trade-btn:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

/* Secondary action buttons */
#cancel-trade-request-btn,
#cancel-random-trade-btn {
  background: rgba(30, 30, 30, 0.5);
  /* Darker, slightly transparent */
  color: #d0d0d0;
  border: 1px solid #555;
  /* Grey border */
  border-bottom: 2px solid #333;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 15px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

#cancel-trade-request-btn:hover,
#cancel-random-trade-btn:hover {
  background: rgba(50, 50, 50, 0.6);
  border-color: #777;
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

/* ===== Trade List and Filters ===== */

/* View trades area */
#view-trade-requests-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Trade filters */
.trade-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
}

#filter-my-trades,
#filter-all-trades {
  background: rgba(20, 10, 0, 0.4);
  /* Slightly warmer subtle background */
  color: #e0e0e0;
  /* Lighter text for subtle buttons */
  border: 1px solid rgba(200, 168, 108, 0.25);
  /* Muted gold, slightly more visible */
  border-radius: 8px;
  padding: 10px 22px;
  /* Slightly more padding */
  font-size: 1rem;
  font-weight: 500;
  /* Normal weight */
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

#filter-my-trades:hover,
#filter-all-trades:hover {
  background: rgba(30, 15, 0, 0.5);
  /* Warmer hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border-color: rgba(200, 168, 108, 0.4);
  /* Brighter gold on hover */
  color: #ffffff;
}

#filter-my-trades.active,
#filter-all-trades.active {
  background: linear-gradient(135deg, #D4B77A, #C8A86C);
  /* Brighter, solid gold gradient */
  color: #3a2e10;
  /* Darker text for contrast on gold */
  border-color: #B08D57;
  /* Darker gold border */
  box-shadow: 0 0 20px rgba(200, 168, 108, 0.6), inset 0 0 12px rgba(0, 0, 0, 0.25);
  /* Stronger shadow for active */
  font-weight: 600;
  /* Bolder text */
  transform: translateY(-1px);
  /* Slight lift */
}

/* Trade list */
.trade-list {
  display: flex;
  flex-direction: column;
  gap: 35px;
  /* Proposal 1: Further Increased vertical spacing */
  max-height: 600px;
  overflow-y: auto;
  padding: 20px 10px;
  /* Adjust padding, less horizontal if cards have their own */
}

/* Trade request item */
.trade-request-item {
  background: rgba(10, 5, 0, 0.45);
  /* Darker base for cards */
  border-radius: 15px;
  /* Consistent rounded corners */
  padding: 20px;
  /* Adjusted padding */
  display: flex;
  /* Changed from grid to flex */
  flex-direction: column;
  /* Stack content and actions vertically */
  gap: 15px;
  /* Gap between content and actions */
  border: 1px solid rgba(200, 168, 108, 0.3);
  /* Muted gold border */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 0 5px rgba(0, 0, 0, 0.2);
  /* Refined shadow */
  margin-bottom: 5px;
  /* Keep existing margin */
  position: relative;
  /* For potential pseudo-elements like icons */
}

/* New "Trading Card" Styles */
.trade-card-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  /* Offer section, arrow, Want section */
  gap: 15px;
  align-items: center;
  width: 100%;
}

.trade-card-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.trade-offering-section .trade-player-info strong,
.trade-wanting-section .trade-player-info strong {
  color: #FFD700;
  /* Gold for player name emphasis */
}

.trade-player-info p {
  margin-bottom: 8px;
  /* Increased margin */
  font-size: 0.9rem;
  line-height: 1.4;
  /* Added line-height */
  color: #ddd;
}

.trade-player-info strong {
  font-weight: 600;
  /* Bolder player names */
}

.card-mini-display {
  /* Already styled, but ensure it fits */
  width: 80px;
  /* Adjust as needed */
  height: 110px;
  /* Adjust as needed */
  background-size: cover;
  background-position: center;
  border-radius: 5px;
  border: 1px solid rgba(200, 168, 108, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.trade-details p {
  margin: 4px 0;
  /* Increased margin */
  font-size: 0.95rem;
  line-height: 1.4;
  /* Added line-height */
  overflow-wrap: break-word;
  /* Prevent long words from breaking layout */
  /* Consistent font size for card details */
}

.trade-details .card-name {
  font-weight: 600;
  /* Bolder card names */
  color: #f0f0f0;
  font-size: 1rem;
}

.trade-details .card-rarity {
  font-size: 0.8rem;
  color: #aaa;
  font-style: italic;
}

.trade-arrow-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.trade-arrow {
  font-size: 2rem;
  color: #C8A86C;
  /* Muted gold arrow */
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.trade-card-actions {
  display: flex;
  justify-content: flex-end;
  /* Align buttons to the right */
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(200, 168, 108, 0.2);
  /* Separator line */
}


.trade-request-item:nth-child(odd) {
  /* Keep distinct background for odd items if desired, or remove for uniform card look */
  background-color: rgba(25, 15, 5, 0.45);
}

.trade-request-item:hover {
  transform: translateY(-5px) scale(1.02);
  /* Slightly more pronounced hover */
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(200, 168, 108, 0.4);
  border-color: rgba(200, 168, 108, 0.6);
}

/* My trade request styling - Enhanced */
.trade-request-item.my-trade {
  border-left: 6px solid #FFD700;
  /* Brighter, thicker gold border */
  background: linear-gradient(to right, rgba(255, 215, 0, 0.2), rgba(15, 8, 0, 0.5) 40%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 8px #FFD700, inset 4px 0 8px rgba(255, 215, 0, 0.15);
  /* Add a small icon if possible - example using pseudo-element */
}

.trade-request-item.my-trade::before {
  content: '★';
  /* Example star icon */
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2rem;
  color: #FFD700;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}


/* Redundant .trade-offer-card and .trade-want-card can be removed if .trade-card-section covers it */
/*
.trade-offer-card,
.trade-want-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
*/

/* Trade action buttons */
/* Ensuring .primary class from JS is styled */
.accept-trade-btn.primary,
/* Target the button with the primary class added in JS */
.accept-trade-btn {
  /* Fallback for existing accept buttons if any */
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  /* Green for accept */
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.accept-trade-btn.primary:hover,
.accept-trade-btn:hover {
  background: linear-gradient(135deg, #5CBF60, #3E8D42);
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.4);
  transform: translateY(-1px);
}

.cancel-my-trade-btn.secondary,
/* Target the button with secondary class (default for cancel) */
.cancel-my-trade-btn {
  /* Fallback for existing cancel buttons */
  background: linear-gradient(135deg, #757575, #424242);
  /* Grey for cancel/secondary */
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cancel-my-trade-btn.secondary:hover,
.cancel-my-trade-btn:hover {
  background: linear-gradient(135deg, #8A8A8A, #525252);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

/* Disabled button state for accept button (already present in JS) */
.accept-trade-btn:disabled {
  background: #555;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  transform: none;
}

.accept-trade-btn:disabled:hover {
  background: #555;
  /* Keep same on hover when disabled */
}


/* ===== Form Elements ===== */

/* Search input */
#trade-want-search {
  width: 100%;
  padding: 15px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

#trade-want-search:focus {
  outline: none;
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2), inset 0 0 10px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.4);
}

#trade-want-search::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Trade want controls */
.trade-want-controls {
  margin-bottom: 15px;
}

/* ===== Random Trade Section ===== */

/* Random trade area */
#random-trade-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Random trade interface */
.random-trade-interface {
  background: rgba(0, 0, 0, 0.3);
  /* Darker background */
  border-radius: 15px;
  /* Increased border radius */
  padding: 30px;
  /* Increased padding */
  display: flex;
  flex-direction: column;
  gap: 25px;
  /* Increased gap */
  border: 1px solid rgba(255, 215, 0, 0.2);
  /* Added border */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  /* Added shadow */
  margin-top: 20px;
  /* Added top margin */
  margin-bottom: 30px;
  /* Added bottom margin */
}

/* Random trade result */
#random-trade-result {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  /* Increased border radius */
  padding: 20px;
  /* Increased padding */
  text-align: center;
  min-height: 70px;
  /* Increased height */
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 215, 0, 0.15);
  /* Added border */
  margin-top: 10px;
  /* Added top margin */
  font-size: 1.1rem;
  /* Increased font size */
}

/* ===== Animation Keyframes ===== */

/* Card trade animation */
@keyframes cardTradeOut {
  0% {
    transform: translateX(0) rotate(0);
    opacity: 1;
  }

  100% {
    transform: translateX(-150px) rotate(-10deg);
    opacity: 0;
  }
}

@keyframes cardTradeIn {
  0% {
    transform: translateX(150px) rotate(10deg);
    opacity: 0;
  }

  100% {
    transform: translateX(0) rotate(0);
    opacity: 1;
  }
}

/* Success flash animation */
@keyframes successFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(76, 175, 80, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

/* Card selection pulse */
@keyframes selectionPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(150, 0, 0, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(150, 0, 0, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(150, 0, 0, 0);
  }
}

/* ===== Trade Result Modal ===== */

/* Trade result modal */
.trade-result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.trade-result-modal.active {
  opacity: 1;
  visibility: visible;
}

.trade-result-content {
  background: linear-gradient(135deg, #5a0000, #8a0303);
  border-radius: 15px;
  padding: 30px;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s ease;
}

.trade-result-modal.active .trade-result-content {
  transform: scale(1);
}

.trade-result-title {
  font-size: 2rem;
  color: white;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.trade-result-message {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
}

.trade-result-cards {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-bottom: 30px;
  position: relative;
}

.trade-result-card-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.trade-result-card-label {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Arrow between cards */
.trade-result-cards::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: #a00;
}

.trade-result-close {
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.trade-result-close:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ===== Animation Support Classes ===== */

/* Button ripple effect */
.button-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Card selection pulse animation */
.selection-pulse {
  animation: selectionPulse 1s ease-out;
}

/* Trade animation overlay */
.trade-animation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.trade-animation-card {
  position: absolute;
  transition: transform 1s ease, opacity 1s ease;
}

.trade-animation-card.offered-card {
  transform: translateX(-150px) rotate(-5deg);
}

.trade-animation-card.received-card {
  transform: translateX(150px) rotate(5deg);
  opacity: 0;
}

.trade-animation-card.offered-card.animate-out {
  transform: translateX(-300px) rotate(-15deg);
  opacity: 0;
}

.trade-animation-card.received-card.animate-in {
  transform: translateX(0) rotate(0);
  opacity: 1;
}

/* Trade particles */
.trade-particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes particleFade {
  0% {
    transform: scale(0) translateY(0);
    opacity: 1;
  }

  100% {
    transform: scale(1) translateY(-100px);
    opacity: 0;
  }
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .trade-options {
    flex-direction: column;
    align-items: center;
  }

  .trade-request-item {
    grid-template-columns: 1fr;
  }

  .trade-result-cards {
    flex-direction: column;
    gap: 30px;
  }

  .trade-result-cards::after {
    content: '↕';
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
}

/* Make headings for card sections more prominent */
#create-trade-request-area h3 {
  font-size: 2rem;
  margin-bottom: 25px;
  color: rgba(255, 215, 0, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#create-trade-request-area h4 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: rgba(255, 215, 0, 0.8);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Make the instruction text more visible */
#create-trade-request-area p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

/* Fade-in animation for trade lists */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* ===== ENHANCED TRADE FEATURES ===== */

/* Advanced Filters Panel */
.trade-advanced-filters {
    background: rgba(15, 5, 0, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    color: rgba(255, 215, 0, 0.9);
    font-weight: 600;
    font-size: 0.95rem;
}

.filter-group select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.filter-btn {
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, #C8A86C, #B08D57);
    color: #2c1e08;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 168, 108, 0.4);
}

.filter-btn.secondary {
    background: rgba(60, 60, 60, 0.8);
    color: #ddd;
    border-color: rgba(255, 255, 255, 0.3);
}

.filter-btn.secondary:hover {
    background: rgba(80, 80, 80, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Enhanced Card Indicators */
.card-quantity-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.card-owned-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #2196F3, #1565C0);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.card-recommended-indicator {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    animation: pulse 2s infinite;
}

.card-favorite-indicator {
    position: absolute;
    bottom: 8px;
    right: 8px;
    color: #ff6b6b;
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.8);
    z-index: 10;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.2); }
    28% { transform: scale(1); }
    42% { transform: scale(1.2); }
    70% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* Context Menu */
.card-context-menu {
    background: rgba(20, 10, 5, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    padding: 8px 0;
    min-width: 180px;
    backdrop-filter: blur(10px);
}

.context-menu-item {
    padding: 10px 16px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.context-menu-item:hover {
    background: rgba(255, 215, 0, 0.2);
    color: white;
}

/* Card Details Modal */
.card-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.card-details-modal .modal-content {
    background: linear-gradient(135deg, #5a0000, #8a0303);
    border-radius: 15px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.card-details-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
}

.card-details-modal .modal-header h3 {
    color: rgba(255, 215, 0, 0.95);
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #ddd;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.card-details-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    padding: 20px;
}

.card-image-section img {
    width: 100%;
    max-width: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-info-section p {
    margin: 8px 0;
    color: #ddd;
    line-height: 1.5;
}

.card-info-section strong {
    color: rgba(255, 215, 0, 0.9);
}

/* Trade Recommendations Panel */
.trade-recommendations-panel {
    background: rgba(25, 15, 0, 0.6);
    border: 1px solid rgba(255, 152, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.trade-recommendations-panel h4 {
    color: rgba(255, 152, 0, 0.9);
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recommendation-item {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 3px solid rgba(255, 152, 0, 0.6);
}

.recommendation-item span {
    color: #ddd;
    font-size: 0.9rem;
    display: block;
}

.recommendation-item small {
    color: rgba(255, 152, 0, 0.7);
    font-size: 0.8rem;
    font-style: italic;
}

/* Enhanced Notifications */
.trade-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 10, 5, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 1001;
    animation: slideUp 0.3s ease-out;
    max-width: 400px;
    word-wrap: break-word;
}

.trade-notification.fade-out {
    animation: slideDown 0.3s ease-in forwards;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
}

.trade-notification-success {
    border-color: rgba(76, 175, 80, 0.6);
    background: rgba(76, 175, 80, 0.1);
}

.trade-notification-error {
    border-color: rgba(244, 67, 54, 0.6);
    background: rgba(244, 67, 54, 0.1);
}

.trade-notification-warning {
    border-color: rgba(255, 152, 0, 0.6);
    background: rgba(255, 152, 0, 0.1);
}

.notification-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.trade-notification-success .notification-icon {
    color: #4CAF50;
}

.trade-notification-error .notification-icon {
    color: #F44336;
}

.trade-notification-warning .notification-icon {
    color: #FF9800;
}

.notification-message {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus improvements */
.card:focus {
    outline: 2px solid rgba(255, 215, 0, 0.8);
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus {
    outline: 2px solid rgba(255, 215, 0, 0.6);
    outline-offset: 2px;
}

/* Enhanced card hover effects */
.card-selection-area .card {
    position: relative;
    overflow: hidden;
}

.card-selection-area .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.card-selection-area .card:hover::before {
    left: 100%;
}

/* Trade List Enhancements */
.trade-request-item {
    position: relative;
}

.trade-request-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(255, 215, 0, 0.1) 50%, transparent 51%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.trade-request-item:hover::after {
    opacity: 1;
}

/* Button Enhancements */
.trade-options button,
.filter-btn,
#submit-trade-request-btn,
#submit-random-trade-btn {
    position: relative;
    overflow: hidden;
}

.trade-options button::before,
.filter-btn::before,
#submit-trade-request-btn::before,
#submit-random-trade-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.trade-options button:active::before,
.filter-btn:active::before,
#submit-trade-request-btn:active::before,
#submit-random-trade-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Loading States */
.loading-spinner {
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    border-top: 2px solid rgba(255, 215, 0, 0.8);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.trade-section.loading {
    position: relative;
}

.trade-section.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-section.loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 215, 0, 0.9);
    font-size: 1.2rem;
    z-index: 101;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .trade-advanced-filters {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        grid-column: 1;
        justify-content: stretch;
    }
    
    .filter-actions .filter-btn {
        flex: 1;
    }
    
    .card-details-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .trade-notification {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .trade-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .trade-creation-interface {
        grid-template-columns: 1fr;
    }
}