/* ============================================================
   Club Penguin Item Trading System (Wand CPPS)
   Authentic Classic CP Aesthetic, Burbank Typography & Pastel Palette
   ============================================================ */

@font-face {
  font-family: 'Burbank Small Bold';
  font-weight: 700;
  font-style: normal;
  src: url('/landing/fonts/Burbank-Small.woff') format('woff');
}

@font-face {
  font-family: 'Burbank Small';
  font-weight: 500;
  font-style: normal;
  src: url('/landing/fonts/BurbankSmall-Medium.woff') format('woff');
}

@font-face {
  font-family: 'Burbank Small Light';
  font-weight: 300;
  font-style: normal;
  src: url('/landing/fonts/BurbankSmall-Light.woff') format('woff');
}

#wand-trade-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  background: rgba(0, 20, 45, 0.72);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Burbank Small Bold', ArialRounded, 'Arial Rounded MT Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  user-select: none;
  animation: wtFadeIn 0.22s ease-out;
  box-sizing: border-box;
}

@keyframes wtFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

#wand-trade-modal * {
  box-sizing: border-box;
}

/* Outer Window Frame */
.wt-window {
  width: min(920px, calc(100% - 16px));
  height: min(590px, calc(100% - 14px));
  max-height: calc(100% - 10px);
  max-width: calc(100% - 12px);
  background: linear-gradient(180deg, #0288D1 0%, #01579B 100%);
  border: 4px solid #8FE2FF;
  box-shadow: 0 14px 40px rgba(0, 15, 35, 0.65), 
              inset 0 2px 3px rgba(255, 255, 255, 0.5), 
              inset 0 -3px 0 rgba(0, 45, 80, 0.5);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Header */
.wt-header {
  height: 50px;
  background: linear-gradient(180deg, #0081CC 0%, #0064A3 100%);
  border-bottom: 3px solid #004675;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.wt-title {
  color: #FFFFFF;
  font-size: 21px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 0 #00365A, 0 3px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
}

.wt-title-icon {
  font-size: 22px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.wt-close-btn {
  background: linear-gradient(180deg, #FF6B6B 0%, #D83A3A 100%);
  border: 2.5px solid #FFBEBE;
  color: #FFFFFF;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 #8B1B1B, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.12s, background 0.12s;
  outline: none;
}

.wt-close-btn:hover {
  transform: scale(1.08);
  background: linear-gradient(180deg, #FF7B7B 0%, #E24444 100%);
}

.wt-close-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 1px 0 #8B1B1B, 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Main Body Layout */
.wt-body {
  flex: 1;
  display: flex;
  padding: 12px 16px;
  gap: 14px;
  overflow: hidden;
  min-height: 0;
}

/* Left: Offers Stage */
.wt-trade-stage {
  flex: 0 0 430px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Offer Cards */
.wt-offer-card {
  background: linear-gradient(180deg, #F3FAFE 0%, #E2F2FC 100%);
  border: 3px solid #84C5ED;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 4px 10px rgba(0, 30, 60, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.wt-offer-card.confirmed {
  background: linear-gradient(180deg, #F0FDF4 0%, #DCFCE7 100%);
  border-color: #86EFAC;
  box-shadow: 0 4px 12px rgba(16, 120, 60, 0.16), inset 0 2px 0 rgba(255, 255, 255, 0.9);
}

.wt-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wt-card-name {
  font-size: 16px;
  color: #02639B;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.wt-offer-card.confirmed .wt-card-name {
  color: #15803D;
}

.wt-status-pill {
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 14px;
  background: #CFD8DC;
  color: #37474F;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.wt-status-pill.confirmed {
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%);
  color: #FFFFFF;
  border: 1.5px solid #BBF7D0;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* Slots */
.wt-slots-row {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0;
}

.wt-slot {
  width: 90px;
  height: 90px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5FAFD 100%);
  border: 3px dashed #90CAF9;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 5px rgba(0, 60, 110, 0.08);
  transition: all 0.15s ease;
}

.wt-slot.has-item {
  border: 3px solid #38BDF8;
  background: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 80, 160, 0.15), inset 0 1px 0 #FFFFFF;
}

.wt-slot.has-item:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: #F87171;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.2);
}

.wt-slot.has-item:hover::after {
  content: '✕';
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  background: linear-gradient(180deg, #FF6B6B 0%, #DC2626 100%);
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.wt-slot-icon {
  max-width: 74px;
  max-height: 74px;
  object-fit: contain;
  pointer-events: none;
}

.wt-slot-empty-icon {
  font-size: 26px;
  color: #B3E5FC;
  font-weight: 700;
}

/* Action Controls (Pastel Club Penguin Palette) */
.wt-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

/* Confirm Button - Soft Pastel Clover Green */
.wt-btn-confirm {
  background: linear-gradient(180deg, #82D066 0%, #60B842 100%);
  border: 2.5px solid #A8EE84;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 #468625, 0 6px 12px rgba(0, 0, 0, 0.18), inset 0 1.5px 0 rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 2px #3D7820;
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
  letter-spacing: 0.3px;
}

.wt-btn-confirm:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #92DE74 0%, #6EC44E 100%);
  box-shadow: 0 5px 0 #468625, 0 8px 14px rgba(0, 0, 0, 0.2), inset 0 1.5px 0 rgba(255, 255, 255, 0.6);
}

.wt-btn-confirm:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #468625, 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* When already confirmed, button offers to modify - Soft Pastel Gold */
.wt-btn-confirm.confirmed {
  background: linear-gradient(180deg, #FFC043 0%, #FA9C1B 100%);
  border: 2.5px solid #FFE08A;
  color: #FFFFFF;
  text-shadow: 0 1px 2px #9C5808;
  box-shadow: 0 4px 0 #A85E08, 0 6px 12px rgba(0, 0, 0, 0.18), inset 0 1.5px 0 rgba(255, 255, 255, 0.55);
}

.wt-btn-confirm.confirmed:hover {
  background: linear-gradient(180deg, #FFCB5C 0%, #FFA82E 100%);
  box-shadow: 0 5px 0 #A85E08, 0 8px 14px rgba(0, 0, 0, 0.2), inset 0 1.5px 0 rgba(255, 255, 255, 0.6);
}

.wt-btn-confirm:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 3px 0 #888, 0 4px 8px rgba(0,0,0,0.1);
}

/* Cancel Button - Soft Pastel Coral Rose */
.wt-btn-cancel {
  background: linear-gradient(180deg, #F88A8A 0%, #E46666 100%);
  border: 2px solid #FFBCBC;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 3px 0 #A83838, 0 5px 8px rgba(0, 0, 0, 0.16), inset 0 1.5px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 2px #882B2B;
  transition: all 0.15s ease;
  outline: none;
  font-family: inherit;
  letter-spacing: 0.2px;
}

.wt-btn-cancel:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #FA9A9A 0%, #E87474 100%);
  box-shadow: 0 4px 0 #A83838, 0 6px 10px rgba(0, 0, 0, 0.18), inset 0 1.5px 0 rgba(255, 255, 255, 0.55);
}

.wt-btn-cancel:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #A83838, 0 2px 4px rgba(0, 0, 0, 0.12);
}

.wt-hint-text {
  font-size: 11px;
  color: #E1F5FE;
  text-align: center;
  font-weight: 500;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  min-height: 16px;
}

/* Right: Inventory Panel */
.wt-inventory-panel {
  flex: 1;
  background: #FFFFFF;
  border: 3px solid #8FE2FF;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 20, 50, 0.2);
  min-height: 0;
}

.wt-inv-header {
  background: linear-gradient(180deg, #F0F8FF 0%, #E4F2FB 100%);
  padding: 10px 12px;
  border-bottom: 2px solid #C4E4F8;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Sort Controls Container */
.wt-sort-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px;
}

.wt-sort-label {
  font-size: 13px;
  color: #02639B;
  font-weight: 700;
  text-shadow: 0 1px 0 #FFFFFF;
}

.wt-sort-buttons {
  display: flex;
  gap: 6px;
}

.wt-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
  background: linear-gradient(180deg, #FFFFFF 0%, #E6F3FA 100%);
  color: #0277BD;
  border: 1.5px solid #B0DCF4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.wt-sort-btn:hover:not(.active) {
  background: #DCF0FA;
  border-color: #81D4FA;
  color: #01579B;
}

.wt-sort-btn.active {
  background: linear-gradient(180deg, #FFDE59 0%, #F5BA13 100%);
  color: #4A3300;
  border: 1.5px solid #FFE98A;
  box-shadow: 0 2px 6px rgba(245, 186, 19, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.wt-sort-arrow {
  font-size: 10px;
  opacity: 0.85;
}

/* Category Tabs */
.wt-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.wt-tabs::-webkit-scrollbar {
  height: 4px;
}

.wt-tabs::-webkit-scrollbar-thumb {
  background: #81D4FA;
  border-radius: 2px;
}

.wt-tab {
  background: linear-gradient(180deg, #E1F1FB 0%, #CEE6F7 100%);
  color: #0277BD;
  border: 1.5px solid #AED7F2;
  border-radius: 10px;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  outline: none;
}

.wt-tab:hover:not(.active) {
  background: #BAE1F8;
  color: #01579B;
}

.wt-tab.active {
  background: linear-gradient(180deg, #FFD54F 0%, #FFB300 100%);
  color: #3E2723;
  border-color: #FFE082;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Inventory Grid */
.wt-inv-grid {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 76px;
  gap: 8px;
  background: #FFFFFF;
}

.wt-inv-grid::-webkit-scrollbar {
  width: 8px;
}

.wt-inv-grid::-webkit-scrollbar-track {
  background: #F0F7FB;
}

.wt-inv-grid::-webkit-scrollbar-thumb {
  background: #38BDF8;
  border-radius: 4px;
}

.wt-inv-grid::-webkit-scrollbar-thumb:hover {
  background: #0288D1;
}

.wt-inv-item {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FBFE 100%);
  border: 2px solid #E1EDF5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.14s ease-in-out;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.wt-inv-item:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: #38BDF8;
  box-shadow: 0 6px 12px rgba(56, 189, 248, 0.25);
  z-index: 2;
}

.wt-inv-item.offered {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #81D4FA;
  transform: none;
}

.wt-inv-item.offered::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  background: linear-gradient(180deg, #4ADE80 0%, #22C55E 100%);
  color: #FFFFFF;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.wt-inv-item-img {
  max-width: 66px;
  max-height: 66px;
  object-fit: contain;
  pointer-events: none;
}

.wt-empty-inv {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 10px;
  color: #78909C;
  font-size: 13px;
  font-family: inherit;
}

/* Tooltip */
.wt-tooltip {
  position: absolute;
  background: rgba(0, 36, 71, 0.94);
  color: #FFFFFF;
  padding: 5px 10px;
  border: 1.5px solid #38BDF8;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  z-index: 100000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: none;
  white-space: nowrap;
  font-family: inherit;
}

/* ============================================================
   RESPONSIVE DESIGN PARA CELULARES Y DISPOSITIVOS MÓVILES
   ============================================================ */

/* Optimización para celulares en horizontal / paisaje (iPhone, Android) */
@media (max-height: 600px) {
  .wt-window {
    width: calc(100% - 10px) !important;
    height: calc(100% - 8px) !important;
    max-height: calc(100% - 8px) !important;
    border-radius: 14px !important;
    border-width: 2.5px !important;
  }

  .wt-header {
    height: 32px !important;
    padding: 0 10px !important;
    border-bottom-width: 2px !important;
  }

  .wt-title {
    font-size: 13px !important;
    gap: 6px !important;
  }

  .wt-title-icon {
    font-size: 14px !important;
  }

  .wt-close-btn {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
    border-width: 1.5px !important;
  }

  .wt-body {
    padding: 4px 8px !important;
    gap: 8px !important;
    min-height: 0 !important;
    flex: 1 !important;
  }

  .wt-trade-stage {
    flex: 0 0 40% !important;
    min-width: 180px !important;
    max-width: 240px !important;
    gap: 4px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .wt-offer-card {
    padding: 4px 6px !important;
    border-radius: 10px !important;
    border-width: 2px !important;
    gap: 3px !important;
  }

  .wt-card-name {
    font-size: 11px !important;
  }

  .wt-status-pill {
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
  }

  .wt-slots-row {
    padding: 0 !important;
  }

  .wt-slot {
    width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    border-width: 2px !important;
  }

  .wt-slot-icon {
    max-width: 38px !important;
    max-height: 38px !important;
  }

  .wt-slot-empty-icon {
    font-size: 18px !important;
  }

  .wt-actions {
    gap: 4px !important;
    margin-top: 2px !important;
  }

  .wt-btn-confirm {
    font-size: 12px !important;
    padding: 5px 8px !important;
    border-radius: 9px !important;
    border-width: 2px !important;
    box-shadow: 0 2px 0 #468625 !important;
  }

  .wt-btn-confirm:active:not(:disabled) {
    transform: translateY(2px) !important;
    box-shadow: 0 1px 0 #468625 !important;
  }

  .wt-btn-confirm.confirmed {
    box-shadow: 0 2px 0 #A85E08 !important;
  }

  .wt-btn-cancel {
    font-size: 10px !important;
    padding: 3px 6px !important;
    border-radius: 8px !important;
    border-width: 1.5px !important;
    box-shadow: 0 2px 0 #A83838 !important;
  }

  .wt-hint-text {
    font-size: 8.5px !important;
    line-height: 1.1 !important;
    min-height: auto !important;
    margin-top: 0 !important;
  }

  .wt-inventory-panel {
    border-radius: 12px !important;
    border-width: 2px !important;
    min-height: 0 !important;
    flex: 1 !important;
  }

  .wt-inv-header {
    padding: 4px 6px !important;
    gap: 4px !important;
    border-bottom-width: 1.5px !important;
  }

  .wt-sort-container {
    padding: 0 !important;
    gap: 4px !important;
  }

  .wt-sort-label {
    font-size: 10px !important;
  }

  .wt-sort-buttons {
    gap: 4px !important;
  }

  .wt-sort-btn {
    font-size: 9.5px !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
  }

  .wt-tabs {
    gap: 3px !important;
    padding-bottom: 2px !important;
  }

  .wt-tab {
    font-size: 9.5px !important;
    padding: 2px 6px !important;
    border-radius: 7px !important;
  }

  .wt-inv-grid {
    padding: 4px !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: 46px !important;
    gap: 4px !important;
    min-height: 0 !important;
  }

  .wt-inv-item {
    border-radius: 8px !important;
    border-width: 1.5px !important;
  }

  .wt-inv-item-img {
    max-width: 38px !important;
    max-height: 38px !important;
  }

  .wt-empty-inv {
    padding: 15px 4px !important;
    font-size: 10px !important;
  }
}

/* Optimización para celulares en vertical / portrait */
@media (max-width: 650px) and (min-height: 601px) {
  .wt-window {
    width: calc(100% - 10px) !important;
    height: calc(100% - 10px) !important;
    border-radius: 16px !important;
  }

  .wt-header {
    height: 38px !important;
    padding: 0 12px !important;
  }

  .wt-title {
    font-size: 15px !important;
  }

  .wt-body {
    flex-direction: column !important;
    padding: 8px !important;
    gap: 8px !important;
    overflow-y: auto !important;
  }

  .wt-trade-stage {
    flex: 0 0 auto !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .wt-offer-card {
    padding: 6px 10px !important;
  }

  .wt-slot {
    width: 52px !important;
    height: 52px !important;
  }

  .wt-slot-icon {
    max-width: 44px !important;
    max-height: 44px !important;
  }

  .wt-inventory-panel {
    flex: 1 1 200px !important;
    min-height: 180px !important;
  }

  .wt-inv-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: 56px !important;
  }
}
