/* ============================================================
   OKK Neon Glass Web3 - NFT Trading Room & Cards
   Responsive for Desktop, Tablet, and Mobile
   ============================================================ */

/* NFT Cards Grid */
.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

@media (max-width: 575px) {
  .nft-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 12px;
  }
}

.nft-card {
  background: var(--okk-surface);
  border: 1px solid var(--okk-border);
  border-radius: var(--okk-radius-lg);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

@media (max-width: 575px) {
  .nft-card {
    border-radius: var(--okk-radius-md);
  }
}

.nft-card:hover {
  transform: translateY(-5px);
  border-color: rgba(166, 108, 255, 0.5);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(124, 60, 255, 0.2);
}

.nft-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0d091a;
  position: relative;
}

.nft-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.nft-card:hover .nft-image-wrap img {
  transform: scale(1.06);
}

.nft-badge-rarity {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(8, 5, 18, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.nft-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

@media (max-width: 575px) {
  .nft-body {
    padding: 12px;
  }
}

.nft-title {
  font-size: clamp(13px, 3vw, 15px);
  font-weight: 700;
  color: var(--okk-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nft-collection {
  font-size: 11px;
  color: var(--okk-text-muted);
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nft-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nft-price-label {
  font-size: 10px;
  color: var(--okk-text-secondary);
  text-transform: uppercase;
}

.nft-price-val {
  font-size: clamp(14px, 3vw, 16px);
  font-weight: 800;
  color: var(--okk-text);
}

.nft-change {
  font-size: 11px;
  font-weight: 700;
}

.nft-change.pos { color: var(--okk-success); }
.nft-change.neg { color: var(--okk-danger); }

/* Trading Room Layout */
.trading-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .trading-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 991px) {
  .trading-layout {
    padding-bottom: 85px; /* Clearance for fixed mobile bottom nav */
  }
}

/* Trading Header Controls & Responsiveness */
.trading-header-wrap {
  margin-bottom: 24px;
}

.trading-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.trading-title-group {
  flex: 1 1 300px;
  min-width: 0;
  align-content: center;
  text-align: center;
}

.trading-page-title {
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 800;
  line-height: 1.25;
  margin: 4px 0;
}

.trading-page-desc {
  color: var(--okk-text-muted);
  font-size: clamp(12px, 2.5vw, 13px);
  margin-top: 4px;
}

.trading-ticker-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.trading-price-box {
  text-align: right;
}

.trading-price-label {
  font-size: 11px;
  color: var(--okk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trading-price-val {
  font-size: clamp(20px, 3.5vw, 24px);
  font-weight: 800;
  color: var(--okk-success);
  transition: color 0.4s ease;
  line-height: 1.1;
  font-feature-settings: "tnum";
}

.trading-action-btns {
  display: flex;
  gap: 8px;
}

.btn-trade-buy {
  background: linear-gradient(135deg, #37DC97, #2B53FF) !important;
  color: #fff !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 15px rgba(55, 220, 151, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-trade-sell {
  background: linear-gradient(135deg, #FF5A73, #D63DFF) !important;
  color: #fff !important;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 15px rgba(255, 90, 115, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-trade-buy:hover, .btn-trade-sell:hover {
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .trading-ticker-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--okk-surface);
    border: 1px solid var(--okk-border);
    border-radius: var(--okk-radius-md);
    padding: 12px 14px;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  .trading-price-box {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
  }

  .trading-action-btns {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .trading-action-btns button {
    width: 100%;
    justify-content: center;
    padding: 9px 12px;
    font-size: 13px;
  }
}

/* Trading Chart Card */
.trading-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.trading-pair-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.trading-pair-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--okk-border);
  flex-shrink: 0;
}

.trading-pair-title {
  font-size: clamp(14px, 3.5vw, 16px);
  font-weight: 800;
  line-height: 1.2;
}

.trading-pair-subtitle {
  font-size: 11px;
  color: var(--okk-text-muted);
}

.trading-timeframes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tf-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--okk-text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.tf-pill:hover {
  color: var(--okk-text);
  background: rgba(255, 255, 255, 0.1);
}

.tf-pill.active {
  background: rgba(55, 220, 151, 0.18);
  color: var(--okk-success);
  border-color: rgba(55, 220, 151, 0.4);
}

.trading-chart-canvas-wrap {
  height: 320px;
  width: 100%;
  position: relative;
}

@media (max-width: 575px) {
  .trading-chart-canvas-wrap {
    height: 240px;
  }
}

/* Simulated Live Order Book */
.order-book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 767px) {
  .order-book-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.order-book-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--okk-radius-md);
  padding: 12px;
}

.order-book-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-book-section-title.ask { color: var(--okk-danger); }
.order-book-section-title.bid { color: var(--okk-success); }

.order-book-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.order-book-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.order-book-table th {
  color: var(--okk-text-muted);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--okk-border);
}

.order-book-table th:first-child,
.order-book-table td:first-child {
  text-align: left;
}

.order-book-table th:nth-child(2),
.order-book-table td:nth-child(2) {
  text-align: center;
}

.order-book-table th:last-child,
.order-book-table td:last-child {
  text-align: right;
}

.order-book-table td {
  padding: 6px 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  font-weight: 600;
}

.order-book-row.ask td:first-child { color: var(--okk-danger); font-weight: 700; }
.order-book-row.bid td:first-child { color: var(--okk-success); font-weight: 700; }

/* Real-Time Live Activity Feed */
.trading-feed-card {
  position: sticky;
  top: 85px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1024px) {
  .trading-feed-card {
    position: static;
  }
}

.trade-feed-container {
  display: flex;
  flex-direction: column;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Sleek Scrollbar for Live Feed */
.trade-feed-container::-webkit-scrollbar {
  width: 4px;
}
.trade-feed-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.trade-feed-container::-webkit-scrollbar-thumb {
  background: rgba(124, 60, 255, 0.3);
  border-radius: 4px;
}
.trade-feed-container::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 60, 255, 0.6);
}

.trade-feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.trade-feed-item:last-child {
  border-bottom: none;
}

.trade-feed-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.trade-feed-item-title {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--okk-text);
}

.trade-feed-item-right {
  text-align: right;
  flex: 0 0 auto;
  white-space: nowrap;
}

.trade-type-pill {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trade-type-buy { background: rgba(55, 220, 151, 0.15); color: var(--okk-success); border: 1px solid rgba(55, 220, 151, 0.3); }
.trade-type-sell { background: rgba(255, 90, 115, 0.15); color: var(--okk-danger); border: 1px solid rgba(255, 90, 115, 0.3); }

/* Live Ticker Bar */
.okk-ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: rgba(14, 10, 26, 0.85);
  border-top: 1px solid var(--okk-border);
  border-bottom: 1px solid var(--okk-border);
  padding: 8px 0;
  white-space: nowrap;
}

.okk-ticker-move {
  display: inline-block;
  animation: ticker 35s linear infinite;
}

.okk-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 600;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   NFT Trade Execution Modal & 5-Second Shuffle Animation
   ============================================================ */
.trade-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 12, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.trade-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.trade-modal-card {
  background: linear-gradient(180deg, rgba(24, 16, 46, 0.98) 0%, rgba(12, 8, 24, 0.99) 100%);
  border: 1px solid rgba(166, 108, 255, 0.4);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 24px 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85), 0 0 45px rgba(124, 60, 255, 0.25);
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  overflow: hidden;
}

.trade-modal-overlay.open .trade-modal-card {
  transform: scale(1) translateY(0);
}

.trade-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trade-modal-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--okk-text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
}

.trade-modal-close-btn:hover {
  background: rgba(255, 90, 115, 0.2);
  color: var(--okk-danger);
  border-color: var(--okk-danger);
}

/* NFT Image Box & Animated States */
.trade-nft-box {
  width: 190px;
  height: 190px;
  margin: 0 auto 16px;
  border-radius: 20px;
  border: 2px dashed rgba(166, 108, 255, 0.45);
  background: radial-gradient(circle, rgba(124, 60, 255, 0.15) 0%, rgba(9, 6, 18, 0.85) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 25px rgba(124, 60, 255, 0.18);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.trade-nft-qmark {
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #FF5A73, #D63DFF, #37DC97);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 18px rgba(214, 61, 255, 0.7));
  animation: qmarkPulse 2.2s ease-in-out infinite;
  user-select: none;
}

@keyframes qmarkPulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.12) rotate(4deg); opacity: 1; filter: drop-shadow(0 0 28px rgba(55, 220, 151, 0.8)); }
}

.trade-nft-hint {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--okk-text-muted);
  text-transform: uppercase;
  margin-top: 6px;
  font-weight: 700;
}

.trade-nft-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  display: none;
}

/* Shuffling state */
.trade-nft-box.shuffling {
  border: 2px solid #37DC97;
  animation: shuffleGlow 0.8s ease-in-out infinite alternate;
}

@keyframes shuffleGlow {
  0% { box-shadow: 0 0 25px rgba(55, 220, 151, 0.5), inset 0 0 20px rgba(55, 220, 151, 0.2); }
  100% { box-shadow: 0 0 35px rgba(214, 61, 255, 0.6), inset 0 0 25px rgba(214, 61, 255, 0.3); }
}

/* Matched state */
.trade-nft-box.matched {
  border: 2px solid var(--okk-success);
  box-shadow: 0 0 35px rgba(55, 220, 151, 0.5), inset 0 0 20px rgba(55, 220, 151, 0.2);
}

/* Laser scan animation during selling */
.trade-nft-box .trade-laser-bar {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, transparent, #FF5A73, #fff, #37DC97, transparent);
  box-shadow: 0 0 20px #37DC97, 0 0 35px #FF5A73;
  z-index: 10;
}

.trade-nft-box.selling {
  border: 2px solid #37DC97;
  animation: sellingGlow 0.8s ease-in-out infinite alternate;
}

.trade-nft-box.selling .trade-laser-bar {
  display: block;
  animation: laserScan 1s ease-in-out infinite;
}

.trade-nft-box.selling .trade-nft-img {
  animation: sellingHoloPulse 0.5s ease-in-out infinite alternate;
}

.trade-nft-box.selling::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.25) 0px, rgba(0, 0, 0, 0.25) 2px, transparent 2px, transparent 5px);
  pointer-events: none;
  z-index: 8;
  border-radius: 18px;
}

@keyframes sellingGlow {
  0% { box-shadow: 0 0 25px rgba(255, 90, 115, 0.6), inset 0 0 20px rgba(255, 90, 115, 0.3); border-color: #FF5A73; }
  100% { box-shadow: 0 0 40px rgba(55, 220, 151, 0.7), inset 0 0 30px rgba(55, 220, 151, 0.4); border-color: #37DC97; }
}

@keyframes sellingHoloPulse {
  0% { filter: brightness(1.05) contrast(1.1); transform: scale(1); }
  100% { filter: brightness(1.25) contrast(1.2) hue-rotate(15deg); transform: scale(1.03); }
}

@keyframes laserScan {
  0% { top: 0%; opacity: 0.9; }
  50% { top: 96%; opacity: 1; }
  100% { top: 0%; opacity: 0.9; }
}

/* NFT Match Info Banner */
.trade-matched-title {
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px;
  min-height: 20px;
  color: var(--okk-text);
}

/* Meta Data Grid (Principal, Yield Mode, Estimated Range) */
.trade-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.trade-meta-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
}

.trade-meta-label {
  font-size: 10px;
  color: var(--okk-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.trade-meta-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--okk-text);
  line-height: 1.2;
}

.trade-meta-val.green {
  color: var(--okk-success);
}

.trade-meta-val.purple {
  color: var(--okk-purple-bright);
}

/* Progress / Countdown Indicator */
.trade-shuffle-progress {
  display: none;
  margin-bottom: 14px;
  text-align: center;
}

.trade-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.trade-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #37DC97, #2B53FF, #D63DFF);
  transition: width 0.1s linear;
}

/* Success Profit Box */
.trade-success-box {
  display: none;
  background: linear-gradient(135deg, rgba(55, 220, 151, 0.12), rgba(43, 83, 255, 0.12));
  border: 1px solid rgba(55, 220, 151, 0.4);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
  margin-bottom: 16px;
  animation: successPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes successPop {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.trade-success-amt {
  font-size: 26px;
  font-weight: 900;
  color: var(--okk-success);
  text-shadow: 0 0 15px rgba(55, 220, 151, 0.5);
  line-height: 1.1;
}

.trade-success-pct {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

/* Sell button styling */
.btn-sell-nft {
  background: linear-gradient(135deg, #37DC97, #2B53FF) !important;
  box-shadow: 0 0 25px rgba(55, 220, 151, 0.45) !important;
  color: #fff !important;
  font-weight: 800;
}

/* Disabled button state for 24-hr locked trades */
.btn-trade-disabled {
  opacity: 0.65 !important;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
  color: var(--okk-text-muted) !important;
}

