/**
 * Marketplaces Section Styles
 * CMS-driven interactive marketplaces section with 3-layer image system
 * Follows the original home.php structure with layered backgrounds
 */

/* ============================================================
 * MAIN SECTION
 * ============================================================ */

.marketplaces {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
}

/* ============================================================
 * IMAGE LAYERS (z-index management)
 * ============================================================ */

.marketplaces__tableau {
  /* z-index: 2 - background tableau in the middle */
}

.marketplaces__overlay {
  /* z-index: 15 - foreground overlay on top */
}

/* imgMarket has z-index: 12 - interactive image */

/* ============================================================
 * CONTENT LAYER (z-index: 1000)
 * ============================================================ */

.marketplaces__container {
  position: relative;
  width: 100%;
}

.marketplaces__wrapper {
  position: relative;
  width: 100%;
  padding: 40px 0;
}

/* ============================================================
 * HEADER WITH NAVIGATION ARROWS
 * ============================================================ */

.marketplaces__header {
  text-align: center;
  margin-bottom: 20px;
}

.marketplaces__arrow {
  color: var(--color-link);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.marketplaces__arrow:hover {
  color: var(--color-link-accent);
  transform: translateY(-5px);
}

/* ============================================================
 * BOX (main content container)
 * ============================================================ */

.marketplaces__box {
  padding: 40px;
  border-radius: 8px;
  background: var(--color-surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
}

.marketplaces__box::after,
.marketplaces__box::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-border-hover);
}

.marketplaces__box::before {
  top: 0;
  left: 0;
  border-bottom: none;
  border-right: none;
  border-radius: 8px 0 0 0;
}

.marketplaces__box::after {
  bottom: 0;
  right: 0;
  border-top: none;
  border-left: none;
  border-radius: 0 0 8px 0;
}

/* ============================================================
 * TYPOGRAPHY
 * ============================================================ */

.marketplaces__title {
  /* Uses centralized .section_title1 from pages.css */
}

.marketplaces__subtitle {
  /* Uses centralized .section_title2 from pages.css */
}

.marketplaces__description {
  /* Uses centralized .section_color_description from pages.css */
  margin-bottom: 20px;
}

.marketplaces__divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

/* ============================================================
 * ACCORDION
 * ============================================================ */

.accordion-item {
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin-bottom: 10px;
}

.accordion-button {
  background-color: transparent;
  color: var(--color-link);
  font-weight: 500;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.accordion-button:hover:not(.collapsed) {
  background-color: rgba(132, 185, 255, 0.1);
}

.accordion-button:not(.collapsed) {
  background-color: rgba(132, 185, 255, 0.1);
  color: var(--color-link);
  box-shadow: none;
}

.accordion-body {
  padding: 15px 20px;
  color: var(--color-text-primary);
  line-height: 1.6;
}

.accordion-body p {
  margin-bottom: 15px;
}

.accordion-body p:last-child {
  margin-bottom: 0;
}

/* ============================================================
 * MARKETPLACE NAVIGATION LINKS
 * ============================================================ */

.marketplaces__links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin: 20px 0;
  padding: 20px 0;
}

.marketplaces__link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-link);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.marketplaces__link:hover {
  color: var(--color-link-accent);
  background-color: rgba(132, 185, 255, 0.1);
}

.marketplaces__logo {
  height: 24px;
  width: auto;
  display: inline-block;
}

/* ============================================================
 * MARKETPLACE CONTAINER SHOW/HIDE
 * ============================================================ */

.sectionBoxMarket {
  padding: 20px 0;
  display: none;
}

/* Show only marketplace that is selected */
.sectionBoxMarket.MarketShow,
.sectionBoxMarket.MarketShow.show {
  display: block !important;
}

/* Hide all other marketplaces */
.sectionBoxMarket.MarketHide {
  display: none !important;
}

.sectionBoxMarket h2 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--color-link);
}

/* ============================================================
 * MARKETPLACE ITEMS LAYOUT
 * ============================================================ */

.marketplaces__marketplace-items {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  justify-content: space-around;
}

.marketplace-item {
  flex: 1;
  min-width: 250px;
  max-width: 300px;
}

.marketplace-link {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  padding: 15px;
  border-radius: 8px;
  background: rgba(20, 20, 30, 0.3);
  border: 1px solid var(--color-border);
}

.marketplace-link:hover {
  background: rgba(132, 185, 255, 0.1);
  border-color: var(--color-link);
  transform: translateY(-5px);
}

.marketplace-logo {
  width: 100%;
  max-width: 150px;
  height: auto;
  margin-bottom: 15px;
  display: block;
}

.marketplace-title {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--color-link);
}

.marketplace-desc {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ============================================================
 * CHAIN SECTIONS (Tezos, Solana, etc.)
 * ============================================================ */

.marketplaces__chain-section {
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid var(--color-border);
}

.marketplaces__chain-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.marketplaces__chain-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--color-link);
}

/* ============================================================
 * GRID LAYOUT
 * ============================================================ */

.marketplaces__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* ============================================================
 * MARKETPLACE ITEMS (card layout)
 * ============================================================ */

.marketplaces__item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(20, 20, 30, 0.5);
  border: 1px solid var(--color-border);
  transition: all 0.3s ease;
}

.marketplaces__item:hover {
  border-color: var(--color-link);
  box-shadow: 0 0 15px rgba(132, 185, 255, 0.2);
  transform: translateY(-5px);
}

.marketplaces__item-link {
  display: block;
  padding: 15px;
  color: inherit;
  text-decoration: none;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.marketplaces__figure {
  margin: 0 0 15px 0;
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
}

.marketplaces__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.marketplaces__item:hover .marketplaces__image {
  transform: scale(1.05);
}

.marketplaces__item-title {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--color-link);
}

.marketplaces__item-desc {
  /* Uses centralized .section_color_description from pages.css */
  font-size: 0.9rem;
  line-height: 1.5;
  flex-grow: 1;
}

/* ============================================================
 * FOOTER WITH NAVIGATION ARROWS
 * ============================================================ */

.marketplaces__footer {
  text-align: center;
  margin-top: 40px;
}

.marketplaces__footer-arrow {
  color: var(--color-link);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.marketplaces__footer-arrow:hover {
  color: var(--color-link-accent);
  transform: translateY(5px);
}

/* ============================================================
 * BLOCKCHAIN-SPECIFIC GRADIENTS
 * ============================================================ */

.fondBoxDegradeTez {
  /* Tezos gradient background */
  background: linear-gradient(135deg, rgba(132, 185, 255, 0.1) 0%, rgba(132, 185, 255, 0.05) 100%);
}

.fondBoxDegradeSol {
  /* Solana gradient background */
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 255, 136, 0.05) 100%);
}

.fondBoxDegradeEth {
  /* Ethereum gradient background */
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.fondBoxDegradeAvx {
  /* Avalanche gradient background */
  background: linear-gradient(135deg, rgba(229, 61, 61, 0.1) 0%, rgba(229, 61, 61, 0.05) 100%);
}

/* ============================================================
 * THEME VARIANTS
 * ============================================================ */

.marketplaces.theme-light {
  /* Light theme styles */
}

.marketplaces.theme-light .marketplaces__box {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(13, 13, 26, 0.2);
}

.marketplaces.theme-light .marketplaces__item {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(13, 13, 26, 0.15);
}

/* ============================================================
 * RESPONSIVE DESIGN
 * ============================================================ */

@media (max-width: 768px) {
  .marketplaces__box {
    padding: 30px;
  }

  .marketplaces__wrapper {
    padding: 30px 0;
  }

  .marketplaces__grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }

  .marketplaces__links {
    flex-direction: column;
    gap: 10px;
  }

  .marketplaces__link {
    width: 100%;
    justify-content: center;
  }

  .marketplaces__figure {
    height: 150px;
  }

  .marketplaces__marketplace-items {
    flex-direction: column;
    gap: 15px;
  }

  .marketplace-item {
    min-width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .marketplaces__box {
    padding: 20px;
  }

  .marketplaces__wrapper {
    padding: 20px 0;
  }

  .marketplaces__grid {
    grid-template-columns: 1fr;
  }

  .marketplaces__figure {
    height: 120px;
  }

  .marketplaces__item-title {
    font-size: 0.95rem;
  }

  .marketplaces__item-desc {
    font-size: 0.85rem;
  }
}
