/* EXTENSIVE SYSTEM MULTI-THEME AND ACCESSIBLE CONFIGURATION MATRIX */
* {
  font-family: 'Helvetica', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 1. MUDAR A COR DA BARRA EM COMPUTADORES (Ecrãs grandes) */
@media (min-width: 769px) {
  
  /* Firefox, Safari, Chrome */
  html {
    scrollbar-color: var (--shadow) var (--primary); /* cursor | background */
    scrollbar-width: auto; /* or'thin' */
  }

  /* Old Chrome antigo, Edge, Opera */
  ::-webkit-scrollbar {
    width: 12px; 
    height: 12px; 
  }

  ::-webkit-scrollbar-track {
    background: var (--primary); /* background */
  }

  ::-webkit-scrollbar-thumb {
    background: var (--primary); /* cursor */
    border-radius: 6px; 
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var (--primary); 
  }
}

@media (max-width: 768px) {
  html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Old Internet Explorer/Edge */
  }

  /* EHide Chrome, Safari, Opera & Android Browser */
  ::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
  }
}

body[data-theme="black-and-white"] { --bg-main: #000000; --bg-surface: #111111; --border-color: #333333; --text-main: #ffffff; --text-muted: #888888; --primary: #ffffff; --primary-hover: #cccccc; --danger: #ff1f5a; --shadow: rgba(0,0,0,1); }
body[data-theme="white-and-black"] { --bg-main: #ffffff; --bg-surface: #f8fafc; --border-color: #cbd5e1; --text-main: #0f172a; --text-muted: #64748b; --primary: #0f172a; --primary-hover: #334155; --danger: #cf003c; --shadow: rgba(0,0,0,0.08); }
body[data-theme="solar-dark"] { --bg-main: #131200; --bg-surface: #1e1c01; --border-color: #3e3a02; --text-main: #fffdf0; --text-muted: #8e8822; --primary: #ffea00; --primary-hover: #ccbc00; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.5); }
body[data-theme="solar-light"] { --bg-main: #fffde6; --bg-surface: #fffa99; --border-color: #eedd66; --text-main: #332d00; --text-muted: #776600; --primary: #aa8800; --primary-hover: #775500; --danger: #cf003c; --shadow: rgba(0,0,0,0.05); }
body[data-theme="rainbow-dark"] { --bg-main: #0b071e; --bg-surface: #130d35; --border-color: #351c75; --text-main: #f3f0ff; --text-muted: #a394f8; --primary: #ff007f; --primary-hover: #e0006c; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.6); }
body[data-theme="rainbow-light"] { --bg-main: #f9f6ff; --bg-surface: #f0e6ff; --border-color: #d4bfff; --text-main: #1a0066; --text-muted: #7a5cff; --primary: #ff007f; --primary-hover: #b30059; --danger: #cf003c; --shadow: rgba(0,0,0,0.05); }
body[data-theme="ocean-dark"] { --bg-main: #02111a; --bg-surface: #051b29; --border-color: #0c3854; --text-main: #e6f4fd; --text-muted: #61afef; --primary: #00b0ff; --primary-hover: #0091ea; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.6); }
body[data-theme="ocean-light"] { --bg-main: #f0f8ff; --bg-surface: #e0f2fe; --border-color: #bae6fd; --text-main: #0369a1; --text-muted: #0284c7; --primary: #0284c7; --primary-hover: #0369a1; --danger: #cf003c; --shadow: rgba(0,0,0,0.04); }
body[data-theme="leaves-dark"] { --bg-main: #05140b; --bg-surface: #0a2414; --border-color: #144828; --text-main: #ecfdf5; --text-muted: #34d399; --primary: #10b981; --primary-hover: #059669; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.6); }
body[data-theme="leaves-light"] { --bg-main: #f0fdf4; --bg-surface: #dcfce7; --border-color: #bbf7d0; --text-main: #166534; --text-muted: #15803d; --primary: #15803d; --primary-hover: #166534; --danger: #cf003c; --shadow: rgba(0,0,0,0.04); }
body[data-theme="passion-dark"] { --bg-main: #140205; --bg-surface: #24050b; --border-color: #4c0b16; --text-main: #fef2f3; --text-muted: #f87171; --primary: #ef4444; --primary-hover: #dc2626; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.6); }
body[data-theme="passion-light"] { --bg-main: #fef2f2; --bg-surface: #fee2e2; --border-color: #fecaca; --text-main: #991b1b; --text-muted: #b91c1c; --primary: #b91c1c; --primary-hover: #991b1b; --danger: #cf003c; --shadow: rgba(0,0,0,0.04); }
body[data-theme="pink-dark"] { --bg-main: #170410; --bg-surface: #2b0b20; --border-color: #521b40; --text-main: #fdf2f8; --text-muted: #f472b6; --primary: #ec4899; --primary-hover: #db2777; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.6); }
body[data-theme="pink-light"] { --bg-main: #fdf2f8; --bg-surface: #fce7f3; --border-color: #fbcfe8; --text-main: #9d174d; --text-muted: #be185d; --primary: #be185d; --primary-hover: #9d174d; --danger: #cf003c; --shadow: rgba(0,0,0,0.04); }
body[data-theme="orange-dark"] { --bg-main: #140702; --bg-surface: #240f05; --border-color: #4c1f0c; --text-main: #fff7ed; --text-muted: #fb923c; --primary: #f97316; --primary-hover: #ea580c; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.6); }
body[data-theme="orange-light"] { --bg-main: #fff7ed; --bg-surface: #ffedd5; --border-color: #fed7aa; --text-main: #9a3412; --text-muted: #c2410c; --primary: #c2410c; --primary-hover: #9a3412; --danger: #cf003c; --shadow: rgba(0,0,0,0.04); }
body[data-theme="wood-dark"] { --bg-main: #120d0a; --bg-surface: #1c1511; --border-color: #382a22; --text-main: #fafaf9; --text-muted: #a8a29e; --primary: #d6d3d1; --primary-hover: #a8a29e; --danger: #ff1f5a; --shadow: rgba(0,0,0,0.6); }
body[data-theme="wood-light"] { --bg-main: #fafaf9; --bg-surface: #f5f5f4; --border-color: #e7e5e4; --text-main: #44403c; --text-muted: #78716c; --primary: #78716c; --primary-hover: #44403c; --danger: #cf003c; --shadow: rgba(0,0,0,0.04); }

/* RESET CORE STYLING MATRIX */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg-main); color: var(--text-main); font-size: 1rem; line-height: 1.5; padding-top: 80px; padding-bottom: 100px; min-height: 100vh; display: flex; flex-direction: column; transition: background 0.2s, color 0.2s; }
body.content-locked > *:not(.modal-overlay) { filter: blur(8px); pointer-events: none; }
*:focus-visible { outline: 3px solid #38bdf8; outline-offset: 3px; }

/* REUSABLE UTILITIES SHORTHANDS */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.loader { padding: 50px; text-align: center; color: var(--primary); font-weight: 700; width: 100%; }

/* STICKY TOP HEADER CONTROL LAYERS */
.fixed-header { position: fixed; top: 0; left: 0; width: 100%; height: 70px; background: var(--bg-surface); border-bottom: 1px solid var(--border-color); z-index: 900; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.header-inner { max-width: 1200px; margin: 0 auto; height: 100%; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.brand-logo { font-weight: 800; font-size: 1.25rem; text-decoration: none; color: var(--primary); letter-spacing: -0.5px; }

/* LANDING PAGE SPECIFIC PRESENTATION STYLES */
.landing-hero { width: 100%; text-align: center; margin-top: 20px; }
.hero-title { font-size: 2.2rem; font-weight: 800; letter-spacing: -1px; margin-bottom: 15px; line-height: 1.2; }
.accent-text { color: var(--primary); }
.hero-subtitle { color: var(--text-muted); font-size: 1.1rem; max-width: 650px; margin: 0 auto 40px auto; }
.use-cases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 50px; text-align: left; }
.use-case-card { background: var(--bg-surface); padding: 25px; border-radius: 10px; border: 1px solid var(--border-color); box-shadow: 0 4px 12px var(--shadow); }
.use-case-card h3 { color: var(--primary); margin-bottom: 8px; font-size: 1.15rem; }

/* DIRECTORY PROFILE DISPLAY CARDS MAP */
.directory-card { background: var(--bg-surface); border-radius: 12px; border: 2px solid var(--border-color); padding: 20px; box-shadow: 0 10px 30px var(--shadow); }
.directory-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.directory-header-row h2 { font-size: 1.3rem; font-weight: 700; }

/* Parent grid: 4 columns desktop, 2 on mobile */
.directory-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  grid-template-columns: repeat(4, 1fr); 
  align-items: start;
}

/* Mobile: 2 columns */
@media (max-width: 767px) {
  .directory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Each card is ONE grid item — make it a columnar flex container */
.directory-grid > .dir-link-card {
  display: flex !important; /* ensure flex, override accidental grid */
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 12px;
  transition: transform .18s ease, border-color .18s ease;
}

/* keep internal pieces' styles as intended */
.dir-avatar { width: 75px; height: 75px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); background: var(--bg-main); flex-shrink: 0; }
.dir-info { flex: 1; text-align: center; }
.dir-info h4 { font-size: 1.1rem; color: var(--primary); margin: 0 0 4px; }
.dir-info p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* INNER IMMERSIVE GALLERY VIEWPORT DESIGN LAYOUT */
.gallery-container { width: 100%; max-width: 1200px; margin: 20px auto 0 auto; padding: 0 20px; }
.gallery-hero-banner { display: flex; flex-direction: column; gap: 20px; background: var(--bg-surface); border: 1px solid var(--border-color); padding: 25px; border-radius: 12px; margin-bottom: 35px; align-items: center; text-align: center; box-shadow: 0 4px 15px var(--shadow); }
#projectLogo { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); background: var(--bg-main); }
.hero-right { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hero-right h1 { font-size: 1.6rem; font-weight: 800; }
.hero-right h2 { font-size: 0.95rem; color: var(--text-muted); font-weight: 400; max-width: 550px; }
.hero-right h3 a { color: var(--primary); text-decoration: none; font-size: 0.9rem; font-weight: 600; }

/* RESPONSIVE SQUARE NFT ASSET FEED MATRICES */
/* language: css */
/* Base: responsive grid (falls back to 1+ columns depending on minmax) */
.gallery-grid {
  display: grid;
  gap: 20px;
  width: 100%;
  /* default: 2 columns on small screens */
  grid-template-columns: repeat(2, 1fr);
}

/* Desktop / larger screens: 4 equal columns */
@media (min-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Optional: medium screens (3 columns) */
@media (min-width: 700px) and (max-width: 899px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card container: fixed height, 3 rows (title, image, actions) centered */
.nft-card {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;     /* center content horizontally */
  justify-content: space-between; /* distribute vertical space */
  gap: 8px;
  height: 300px; /* overall card height */
}

.nft-card:hover { transform: translateY(-4px); border-color: var(--primary); }

.nft-card-img-wrapper { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; background: var(--bg-main); margin-bottom: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.nft-card-img-wrapper img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.35)); transition: filter 0.2s; }
.nft-card:hover .nft-card-img-wrapper img { filter: drop-shadow(0 8px 16px var(--primary)); }
.nft-details { margin-bottom: 12px; cursor: pointer; }
.nft-details h4 { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nft-details p { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
/* COMPACT GLOBAL CONVERSION CONTROLS */
.btn { width: 100%; padding: 12px; border: none; border-radius: 6px; font-weight: 700; font-size: 0.95rem; cursor: pointer; text-align: center; text-decoration: none; display: inline-block; transition: background 0.2s; }
.btn-collect { background: var(--primary); color: #000; }
body[data-theme$="-light"] .btn-collect { color: #fff; }
.btn-curate { width: auto; padding: 8px 16px; font-size: 0.85rem; background: var(--primary); color: var(--bg-main); }
body[data-theme$="-light"] .btn-curate { color: #fff; }
.handles-container { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.x-link { background: var(--bg-main); border: 1px solid var(--border-color); padding: 2px 12px; border-radius: 20px; font-size: 1rem; color: var(--primary); text-decoration: none; font-weight: 700; cursor: pointer; transition: 0.2s; }
.x-link:hover { border-color: var(--primary); transform: scale(1.05); }
.btn-share { background: var(--bg-main); border: 1px solid var(--border-color); padding: 4px 14px; border-radius: 20px; font-size: 1rem; color: var(--primary); text-decoration: none; font-weight: 600; cursor: pointer; transition: 0.2s; margin-top: 6px; }
.btn-share:hover { border-color: var(--primary); transform: scale(1.05); }
.controls-row {
  display: flex;
  align-items: center;
  gap: 8px; /* space between handles and button */
  flex-wrap: wrap; /* keeps responsiveness */
}
.handles-container {
  display: flex;
  gap: 8px;
  align-items: center;
}
.handles-container:hover { border-color: var(--primary); transform: scale(1.05); }

/* FLOATING NAVIGATION ACCESSIBILITY UTILITIES */
.scroll-to-top { position: fixed; bottom: 90px; right: 20px; width: 42px; height: 42px; background: var(--bg-surface); color: var(--primary); border: 2px solid var(--primary); border-radius: 50%; font-size: 1.2rem; font-weight: 700; display: none; align-items: center; justify-content: center; z-index: 950; box-shadow: 0 4px 12px var(--shadow); cursor: pointer; transition: 0.2s; }
.scroll-to-top:hover { background: var(--primary); color: var(--bg-surface); transform: translateY(-3px); }
/* STABILIZED SYSTEM FIXED FOOTER LINK LAYERS */
.modern-footer { position: fixed; bottom: 0; left: 0; width: 100%; height: 75px; background: var(--bg-surface); border-top: 1px solid var(--border-color); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 10px 20px; z-index: 900; font-size: 0.75rem; color: var(--text-muted); gap: 4px; box-shadow: 0 -4px 10px rgba(0,0,0,0.05); }
.footer-link-btn { background: none; border: none; color: var(--primary); cursor: pointer; text-decoration: none; font-size: 0.75rem; }
/* PRIVACY OVERLAY SECURITY CONTROLS DIALOGS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.93); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px; }
.modal-content { background: var(--bg-surface); padding: 25px; border-radius: 12px; border: 2px solid var(--primary); max-width: 400px; width: 100%; position: relative; color: var(--text-main); text-align: center; }
.modal-content img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 6px; margin-bottom: 12px; }
.legal-text-wrapper { max-width: 540px; text-align: left; }
.legal-scroll-box { max-height: 400px; overflow-y: auto; margin: 15px 0; border: 1px solid var(--border-color); padding: 12px; background: var(--bg-main); border-radius: 6px; font-size: 0.8rem; display: flex; flex-direction: column; gap: 10px; }
.btn-close { background: var(--danger); color: white; margin-top: 10px; }
/* ADAPTIVE TABLET MONITOR INSET OVERRIDES (RESPONSIVE WORKSPACE) */
@media (min-width: 600px) {
.dir-link-card { flex-direction: row; text-align: left; padding: 20px 25px; }
.dir-info { text-align: left; }
.dir-link-card .btn { width: auto; padding: 8px 20px; font-size: 0.85rem; }
}
@media (min-width: 768px) {
.gallery-hero-banner { flex-direction: row; text-align: left; align-items: center; gap: 30px; padding: 30px; }
.hero-right { align-items: flex-start; text-align: left; }
.handles-container { justify-content: flex-start; }
.hero-title { font-size: 2.8rem; }
.modern-footer { flex-direction: row; justify-content: space-between; height: 60px; padding: 0 40px; }
}


/* language: css */
/* Card container: responsive mobile-first */
.nft-card {
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 320px; /* overall card height as requested */
}

/* Image row: middle row — a square centered container */
.nft-card .img-square {
  flex: 1 1 auto;            /* allow image area to grow/shrink inside card */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 220px;          /* the inner square max width on larger screens */
  box-sizing: border-box;
}

@media (min-width: 480px) {
  .nft-card .img-square { height: 200px; max-width: 200px; }
}
@media (max-width: 479px) {
  .nft-card .img-square { height: 160px; max-width: 160px; }
}

/* The image itself fills the square but preserves aspect ratio and shows entire image */
.nft-card .img-square img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  max-height: 100%;
  background: var(--img-bg, #f6f6f6);
}

/* Title: top row */
.nft-title {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-color, #111);
  white-space: normal;
  overflow: hidden;
  display: block;
  margin: 0;
  padding: 0 6px;
  max-height: 2.4em; /* allow up to ~2 lines; adjust as needed */
}

/* Actions: bottom row — keep button centered and single line */
.nft-actions {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0;
}

/* View button */
.btn-view {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-main);
  color: var(--primary);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Ensure the image area does not push the button outside the card; avoid collapsing */
.nft-card img { max-width: 100%; max-height: 100%; }

/* If your layout uses font-size:0 on parent to remove gaps, ensure titles/buttons restore font-size */
.nft-card, .nft-card * { font-size: inherit; }

/* Modal action buttons */
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.modal-actions .btn {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* language: css */
/* Basic modal layout — hidden by default */
#nftModal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index:10000; align-items:center; justify-content:center; }
#nftModal.open { display: flex; }
#nftModal .modal-content { width:95%; max-width:920px; background:#fff; border-radius:10px; padding:18px; max-height:95vh; overflow:auto; position:relative; }
#nftModal .modal-close { position:absolute; right:12px; top:12px; background:transparent; border:none; font-size:24px; cursor:pointer; }

/* ensure modal content is accessible on small screens */
@media (max-width: 520px) {
  #nftModal .modal-content { padding: 12px; border-radius: 8px; }
}