/* Wallet Modal - CORRECTED LAYOUT CSS */
/* Replace /css/wallet-modal-redesigned.css with this */

/* Base modal styles */
.wallet-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.wallet-modal.active {
  display: flex;
  opacity: 1;
}

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

.modal-content {
  position: relative;
  background: linear-gradient(135deg, #1a1a24 0%, #2a2a3a 100%);
  border: 1px solid #3a3a4a;
  border-radius: 16px;
  max-width: 1600px;
  width: 95%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 10001;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a4a;
  color: #888;
  font-size: 32px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10002;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.modal-body {
  overflow-y: auto;
  max-height: 90vh;
  padding: 24px;
}

.modal-loading, .modal-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #aaa;
}

/* Main Layout */
.modal-redesigned-v2 {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-right: 60px;
}

.modal-top-section {
  display: grid;
  grid-template-columns: 450px 1fr;
  gap: 20px;
  align-items: start;
}

/* ===== LEFT COLUMN ===== */
.modal-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Image */
.nft-image-large {
  width: 100%;
  height: 450px;
  background: #0a0a0f;
  border: 1px solid #3a3a4a;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.nft-image-large img,
.nft-image-large video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Play Button - TOP LEFT */
.play-animation-modal-btn {
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  width: 48px !important;
  height: 48px !important;
  padding: 0 !important;
  background: rgba(139, 92, 246, 0.95) !important;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(139, 92, 246, 0.6) !important;
  border-radius: 50% !important;
  color: white !important;
  font-size: 18px !important;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.play-animation-modal-btn:hover {
  background: rgba(124, 58, 237, 1) !important;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.8);
}

/* Contract Info */
.nft-basic-info {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a4a;
  border-radius: 8px;
  padding: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.info-label {
  color: #888;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.info-value {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}

.contract-address-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.contract-address {
  font-family: 'Courier New', monospace;
  font-size: 10px;
}

.copy-address-btn {
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.3);
  color: #4a9eff;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-address-btn:hover {
  background: rgba(74, 158, 255, 0.2);
  border-color: #4a9eff;
}

/* Listing Status - LEFT SIDE (under contract) */
.listing-status-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid;
  border-left-width: 3px;
  background: rgba(0, 0, 0, 0.3);
}

.listing-status-banner.listed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.listing-status-banner.not-listed {
  background: rgba(156, 163, 175, 0.08);
  border-color: rgba(156, 163, 175, 0.3);
}

.status-left {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-icon {
  font-size: 18px;
}

.status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-title {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 700;
}

.status-subtitle {
  color: #888;
  font-size: 9px;
}

.status-price {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-currency-icon {
  font-size: 18px;
}

.price-details {
  display: flex;
  flex-direction: column;
}

.price-value {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.price-label {
  font-size: 9px;
  color: #888;
}

/* Description - LEFT SIDE */
.nft-description-left {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a4a;
  border-radius: 8px;
  padding: 12px;
}

.nft-description-left h4 {
  color: #aaa;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

.nft-description-left p {
  color: #e0e0e0;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  max-height: 80px;
  overflow-y: auto;
}

.nft-description-left p::-webkit-scrollbar {
  width: 4px;
}

.nft-description-left p::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.nft-description-left p::-webkit-scrollbar-thumb {
  background: #3a3a4a;
  border-radius: 2px;
}

/* ===== RIGHT COLUMN ===== */
.modal-right {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid #3a3a4a;
  border-radius: 12px;
  padding: 18px;
  min-height: 450px;
}

/* Split Header - 3 Columns */
.nft-header-split {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid #3a3a4a;
  margin-bottom: 16px;
}

.nft-info-left {
  flex: 1;
  min-width: 0;
}

.nft-status-middle {
  flex-shrink: 0;
}

.nft-actions-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.nft-header-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  align-items: flex-end;
}

/* Listing Status in Header - Middle Column */
.listing-status-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid;
  border-left-width: 3px;
  background: rgba(0, 0, 0, 0.3);
  min-width: 220px;
}

.listing-status-header.listed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.listing-status-header.not-listed {
  background: rgba(156, 163, 175, 0.08);
  border-color: rgba(156, 163, 175, 0.3);
}

.listing-status-header .status-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.listing-status-header .status-icon {
  font-size: 18px;
}

.listing-status-header .status-title {
  color: #e0e0e0;
  font-size: 12px;
  font-weight: 700;
}

.listing-status-header .status-subtitle {
  color: #888;
  font-size: 10px;
}

.listing-status-header .status-price {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 26px; /* Align with status title above */
}

.listing-status-header .price-currency-icon {
  font-size: 20px;
}

.listing-status-header .price-details {
  display: flex;
  flex-direction: column;
}

.listing-status-header .price-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.listing-status-header .price-usd {
  font-size: 13px;
  color: #aaa;
  font-weight: 500;
}

/* Compact Listing Status - IN HEADER */
.listing-status-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid;
  border-left-width: 3px;
  background: rgba(0, 0, 0, 0.3);
}

.listing-status-compact.listed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.listing-status-compact.not-listed {
  background: rgba(156, 163, 175, 0.08);
  border-color: rgba(156, 163, 175, 0.3);
}

.status-icon-small {
  font-size: 14px;
  line-height: 1;
}

.status-text-compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-title-small {
  color: #e0e0e0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-price-small {
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.nft-name {
  color: #e0e0e0;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px 0;
  line-height: 1.2;
}

.nft-collection {
  color: #888;
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 8px 0;
}

.nft-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nft-tags span {
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
}

.tag-game {
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.3);
  color: #4a9eff;
}

.tag-type {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #a855f7;
}

/* Compact Action Buttons - TOP RIGHT */
.nft-actions-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.btn-compact {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  min-width: 100px;
}

.btn-compact.btn-primary {
  background: linear-gradient(135deg, #4a9eff 0%, #3a7edf 100%);
  color: white;
}

.btn-compact.btn-transfer {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.btn-compact.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-compact.btn-secondary {
  background: #3a3a4a;
  color: #e0e0e0;
}

.btn-compact:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-compact:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Attributes Container */
.attributes-main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a4a;
  border-radius: 8px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  min-height: 500px;
}

/* Toggle Button */
.attr-toggle-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  padding: 6px 10px;
  color: #10b981;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.attr-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.attr-toggle-btn.active {
  background: rgba(16, 185, 129, 0.3);
}

/* Attributes Display */
.attributes-display {
  padding-top: 36px;
  display: block;
  flex: 1;
}

.attributes-display.hidden {
  display: none;
}

.attributes-display h4 {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px 0;
}

.attributes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
}

.attribute-compact {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a4a;
  border-radius: 6px;
  padding: 8px;
  transition: all 0.2s ease;
}

.attribute-compact:hover {
  border-color: #4a9eff;
  background: rgba(74, 158, 255, 0.05);
  transform: translateY(-1px);
}

.attr-label {
  color: #888;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}

.attr-value {
  color: #e0e0e0;
  font-size: 11px;
  font-weight: 600;
  word-break: break-word;
}

/* Long text attributes — span full grid width */
.attribute-long {
  grid-column: 1 / -1;
}

.attribute-long .attr-value {
  font-weight: 400;
  font-size: 11px;
  line-height: 1.5;
  color: #bbb;
  max-height: 80px;
  overflow-y: auto;
}

/* Market Data Display (toggleable) */
.market-data-display {
  padding-top: 36px;
  display: none;
}

.market-data-display.active {
  display: block;
}

.market-data-display h4 {
  color: #10b981;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 12px 0;
}

.market-floor-display {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
}

.floor-usd-large {
  color: #10b981;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.floor-currency-large {
  color: #888;
  font-size: 12px;
}

.market-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.market-stat-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a4a;
  border-radius: 6px;
  padding: 10px;
}

.market-stat-label {
  color: #888;
  font-size: 9px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.market-stat-value {
  color: #e0e0e0;
  font-size: 16px;
  font-weight: 700;
}

.market-stat-sub {
  color: #888;
  font-size: 10px;
  margin-top: 2px;
}

.sale-floor-card {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.05);
}

/* Sales Chart */
.sales-chart-section {
  margin-top: 16px;
}

.sales-chart-title {
  color: #10b981;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 10px 0;
}

.sales-chart-container {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #3a3a4a;
  border-radius: 8px;
  padding: 12px;
  height: 140px;
  align-items: stretch;
}

.sales-chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  flex-shrink: 0;
  min-width: 52px;
  padding: 2px 0;
}

.sales-chart-y-axis span {
  color: #888;
  font-size: 9px;
  font-weight: 500;
  font-family: 'Courier New', monospace;
}

.sales-chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  border-left: 1px solid #3a3a4a;
  border-bottom: 1px solid #3a3a4a;
  padding: 0 4px 0 6px;
}

.sales-bar-wrapper {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  min-width: 4px;
  cursor: pointer;
}

.sales-bar {
  width: 100%;
  max-width: 14px;
  border-radius: 2px 2px 0 0;
  transition: opacity 0.2s ease;
  opacity: 0.75;
}

.sales-bar-wrapper:hover .sales-bar {
  opacity: 1;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.sales-chart-x-axis {
  display: flex;
  justify-content: space-between;
  padding: 6px 60px 0 60px;
}

.sales-chart-x-axis span {
  color: #888;
  font-size: 9px;
  font-weight: 500;
}

/* Scrollbars */
.modal-body::-webkit-scrollbar,
.attributes-grid::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track,
.attributes-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.modal-body::-webkit-scrollbar-thumb,
.attributes-grid::-webkit-scrollbar-thumb {
  background: #3a3a4a;
  border-radius: 3px;
}

/* Responsive */
@media (max-width: 1400px) {
  .modal-top-section {
    grid-template-columns: 400px 1fr;
  }
  
  .nft-image-large {
    height: 400px;
  }
}

@media (max-width: 1024px) {
  .modal-top-section {
    grid-template-columns: 1fr;
  }
  
  .nft-image-large {
    height: auto;
    aspect-ratio: 1;
  }
  
  .attributes-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

/* ==================== LISTINGS TABLE (ERC-1155 Bulk Modal) ==================== */
.listings-table-section {
  margin: 12px 0;
  padding: 16px;
  background: rgba(30, 30, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.listings-table-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #e0e0e0;
}

.listings-table-wrapper {
  overflow-x: auto;
  max-height: 200px;
  overflow-y: auto;
}

.listings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.listings-table thead th {
  background: rgba(255, 255, 255, 0.05);
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.listings-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s;
}

.listings-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.listings-table tfoot tr {
  background: rgba(255, 255, 255, 0.03);
}

.btn-danger.btn-small {
  padding: 4px 12px;
  font-size: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger.btn-small:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
}

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

  .nft-header-split {
    flex-direction: column;
  }
  
  .nft-actions-right {
    flex-direction: row;
    width: 100%;
  }
  
  .btn-compact {
    flex: 1;
  }
}
