/* ====================================
   NFT Page Styles (Grid + Responsive)
==================================== */


.gallery-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-item-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1; /* Maintains a 3:4 aspect ratio */
  margin: 0;
}

.nft-main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: flex-start;
  max-width: var(--max-width-md);
  margin: 2rem auto 2rem auto;
}

.nft-gif {
  width: 30rem;
  height: 30rem;
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 3px 16px rgba(0,0,0,0.08);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  position: relative;
}

/* Fullscreen Button */
.fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.60);
  border: none;
  border-radius: 50%;
  padding: 0.4rem;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
}
.fullscreen-btn .material-icons {
  color: #fff;
  font-size: 2rem; /* Standard Material size */
}

.nft-gif:hover .fullscreen-btn,
.fullscreen-btn:focus {
  opacity: 1;
}


.hide-controls {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.2s;
}
.hide-cursor {
  cursor: none !important;
}



.nft-fullscreen-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
}
.nft-fullscreen-overlay[style*="display: flex"] {
  opacity: 1;
}

.nft-fullscreen-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 0.5rem;
  box-shadow: 0 0 32px #000;
}
.close-fullscreen {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2.6rem;
  color: #fff;
  background: none;
  cursor: pointer;
  z-index: 10000;
  opacity: 0.88;
  transition: opacity 0.2s;
}
.close-fullscreen:hover {
  opacity: 1;
}




.nft-gif img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  background: #fff;
  display: block;
  transition: opacity 0.2s;
}

body.dark-mode .nft-gif {
  background-color: var(--color-dark, #333);
  border: 1px solid var(--color-secondary, #666);
}

.nft-details {
  display: flex;
  align-items: flex-start;
  padding: 1rem 0;
  font-size: 1.04rem;
}
.nft-stats strong {
  font-family: var(--font-body);
  font-weight: var(--font-weight-bold);
}
.nft-stats span,
.nft-stats a {
  font-family: var(--font-code);
}

/* ---- Bottom Grid (Sales Info & Holders) ---- */

.history-section {
  max-width: var(--max-width-md);
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.01em;
  margin: 2.3rem 0 0.8rem 0;
  width: 100%;
}



.nft-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: var(--max-width-md);
  margin: 0 auto 2.5rem auto;
}
.sales-info,
.holder-list {
  font-size: 1rem;
}
.sales-info strong,
.holder-list strong {
  display: block;
  font-size: 1.12rem;
  margin-bottom: 0.7rem;
}
.sales-info ul,
.holder-list ul {
  padding-left: 0;
  margin: 0;
  list-style: none;
}
.sales-info li,
.holder-list li {
  margin-bottom: 0.35rem;
}
.sales-info .tz {
  color: var(--color-secondary);
  font-size: 0.95em;
}
#listings {
  margin-top: 0.2rem;
  padding-left: 1.1rem;
}
#listings li {
  font-family: var(--font-code);
  margin-bottom: 0.1rem;
}
#holder-wallets li {
  font-family: var(--font-code) !important;
}



.nft-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: var(--max-width-md);
  margin: 0 auto 2.5rem auto;
}

.nft-chart-card {
  background: var(--color-white, #fff);
  border: 1px solid var(--color-third, #e5e5e5);
  border-radius: var(--border-radius-m, 1rem);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  padding: 1.5rem 1.2rem 1.8rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.nft-chart-card .section-title {
  margin: 0 0 1.2rem 0;
  width: 100%;
  text-align: left;
}

body.dark-mode .nft-chart-card {
  background: var(--color-dark-mode, #17181c);
  border: 1px solid var(--color-secondary, #3a3a3a);
  box-shadow: 0 2px 12px rgba(0,0,0,0.19);
  color: var(--color-white);
}



/* Make all sales data and collector wallets monospace */
.sales-info span,
.sales-info .tz {
  font-family: var(--font-code) !important;
}

#holder-wallets,
#holder-wallets li,
#holder-wallets a {
  font-family: var(--font-code) !important;
}

.sales-list {
  margin: 0;
  padding: 0;
}
.sales-list div {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-bottom: 0.4em;
}
.sales-list dt {
  min-width: 8.7em;
  font-family: var(--font-body);   
  font-weight: bold;
  margin: 0;
}
.sales-list dd {
  margin: 0;
  font-family: var(--font-code);  
}



/* Show ꜩ symbol everywhere .tz is used, fallback to 'tz' if needed */
.tz::before {
  content: "ꜩ";
  font-family: var(--font-code), monospace;
  font-size: 1em;
  margin-left: 0.12em;
}

/* If ꜩ isn't supported, show 'tz' (will show the replacement character if not supported, which is rare)
   If you want an actual fallback, you can use a font stack or JS, but most modern browsers support it */


/* ---- Table Styles ---- */
#transfer-history {
  width: 100%;
  max-width: var(--max-width-md);
  margin: 2rem auto;
  border-collapse: collapse;
  font-family: var(--font-code);
  font-size: var(--font-size-sm);
  text-align: left;
  color: var(--color-dark);
}
#transfer-history th,
#transfer-history td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-third);
  vertical-align: top;
}
#transfer-history th {
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  color: var(--color-secondary);
  border-bottom: 2px solid var(--color-dark);
}
#transfer-history td {
  color: var(--color-dark);
  word-break: break-word;
}

#transfer-history td a {
  text-decoration: none;
}


#transfer-history th:first-child,
#transfer-history td:first-child {
  min-width: 7.5rem;
  width: 7.5rem;
}

#transfer-history th:last-child,
#transfer-history td:last-child {
  min-width: 8rem;
  width: 8rem;
}


body.dark-mode #transfer-history td,
body.dark-mode #transfer-history th {
  color: var(--color-white);
  border-color: var(--color-secondary);
}
#transfer-history tr:last-child td {
  border-bottom: none;
}
#transfer-history td[colspan="6"] {
  text-align: center;
  font-style: italic;
  color: var(--color-secondary);
  padding: 2rem 1rem;
}

/* ---- Table Links ---- */
.nft-details a,
#transfer-history a {
  color: #007BFF;
  text-decoration: none;
  font-family: var(--font-code);
}
.nft-details a:hover,
#transfer-history a:hover {
  text-decoration: underline;
}

/* -- IPFS Loading --*/

.ipfs-loading-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(20,20,20,0.88);
  color: #fff;
  font-family: var(--font-code, monospace);
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  opacity: 1;
  transition: opacity 0.4s;
  pointer-events: none;
}
body.dark-mode .ipfs-loading-badge {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
}
.ipfs-loading-badge.hide {
  opacity: 0;
}



/* ---- Dark Mode ---- */
body.dark-mode .nft-gif {
  background-color: var(--color-dark-mode, #111);
  border: 1px solid var(--color-secondary, #666);
}
body.dark-mode .nft-stats strong,
body.dark-mode .nft-details,
body.dark-mode .sales-info,
body.dark-mode .holder-list {
  color: var(--color-white);
}
body.dark-mode .sales-info .tz {
  color: var(--color-third);
}
body.dark-mode #holder-wallets li,
body.dark-mode #listings li {
  color: var(--color-white);
}

/* Collector Wallet Links - Always visible, with good contrast */
#holder-wallets .wallet-link {
  color: #fff; /* default to white for dark mode */
  text-decoration: underline;
  transition: color 0.18s;
}

body:not(.dark-mode) #holder-wallets .wallet-link {
  color: #191919;  /* near-black for light mode */
}

/* Accent color on hover/focus (optional, matches your button hover) */
#holder-wallets .wallet-link:hover,
#holder-wallets .wallet-link:focus {
  color: var(--accent-color, #00c3ff);
}

#holder-wallets .wallet-link {
  text-decoration: none;
}
#holder-wallets .wallet-link:hover,
#holder-wallets .wallet-link:focus {
  text-decoration: underline;
}


/* ================================
   Responsive Styles
================================ */

/* ≤1024px */
@media (max-width: 1024px) {
  .nft-main-grid,
  .nft-bottom-grid,
  .nft-charts-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 95vw;
  }

  .nft-chart-card {
    width: 100%;
    max-width: 100vw;
    margin-bottom: 1.5rem;
  }

  .nft-gif,
  .nft-details {
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-width: 0;
    min-height: 0;
  }
}

/* ≤768px */
@media (max-width: 768px) {
  .fullscreen-btn {
    opacity: 1;
    top: 2rem;
    right: 2rem;
    padding: 0.2rem;
  }

  .fullscreen-btn .material-icons {
    font-size: 1.6rem;
  }

  .close-fullscreen {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
  }

  .nft-fullscreen-overlay img {
    max-width: 98vw;
    max-height: 80vh;
  }
}

/* ≤767px (Mobile) */
@media (max-width: 767px) {
  html,
  body {
    max-width: 100vw;
    overflow-x: hidden;
  }

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

  .nft-main-grid,
  .nft-bottom-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 100vw;
    margin: 0.5rem;
  }

  .nft-gif,
  .nft-details {
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 0.5rem 0;
  }

  .nft-gif {
    padding: 0.5rem;
  }

  .nft-card {
    background: var(--color-white, #fff);
    border: 1px solid var(--color-third, #e5e5e5);
    border-radius: var(--border-radius-m, 1rem);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    padding: 1.25rem 0.75rem;
    margin-bottom: 1.2rem;
  }

  body.dark-mode .nft-card {
    background: var(--color-dark-mode, #17181c);
    border: 1px solid var(--color-secondary, #3a3a3a);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.23);
  }

#transfer-history {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    table-layout: fixed;
  }

  #transfer-history thead {
    display: table-header-group;
  }

  #transfer-history th,
  #transfer-history td {
    padding: 0.4rem 0.3rem;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    white-space: normal;
  }


  #transfer-history th:nth-child(1),
  #transfer-history td:nth-child(1) {
    width: 16%;
  }

  #transfer-history th:nth-child(2),
  #transfer-history td:nth-child(2),
  #transfer-history th:nth-child(3),
  #transfer-history td:nth-child(3) {
    width: 24%;
  }

  #transfer-history th:nth-child(4),
  #transfer-history td:nth-child(4),
  #transfer-history th:nth-child(5),
  #transfer-history td:nth-child(5),
  #transfer-history th:nth-child(6),
  #transfer-history td:nth-child(6) {
    width: 12%;
    text-align: right;
  }

  .history-section {
    overflow-x: hidden;
  }

  /* Keep link styles looking good */
  #transfer-history td a {
    word-break: break-word;
    text-decoration: none;
  }

  /* Optional: style adjustments for dark mode */
  body.dark-mode #transfer-history td,
  body.dark-mode #transfer-history th {
    color: var(--color-white);
  }
}

