/* ============================================================
   APP DETAIL — pages /apps/{id}.html
   ============================================================ */

.apps-page { background: #FFF9F0; }

/* ============ HERO ============ */
.app-detail-hero {
  background: linear-gradient(135deg, #0B1F1C 0%, #0F3330 55%, #1A4A42 100%);
  color: #FFF9F0;
  padding: clamp(32px, 5vw, 56px) 0 clamp(56px, 8vw, 88px);
  position: relative;
  overflow: hidden;
}
.app-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 25%, color-mix(in srgb, var(--app-color, #009688) 35%, transparent), transparent 55%);
  pointer-events: none;
}
.app-detail-hero .container { position: relative; z-index: 1; max-width: 900px; }

.app-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(126, 224, 208, 0.3);
  border-radius: 999px;
  background: rgba(126, 224, 208, 0.08);
  color: #7EE0D0;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
  margin-bottom: 32px;
}
.app-detail-back:hover {
  background: rgba(126, 224, 208, 0.18);
  border-color: rgba(126, 224, 208, 0.6);
  color: #FFF9F0;
  transform: translateX(-3px);
}
.app-detail-back svg { width: 14px; height: 14px; }

.app-detail-hero-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.app-detail-icon {
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--app-color, #009688) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--app-color, #009688) 40%, transparent);
  display: grid;
  place-items: center;
  color: var(--app-color, #009688);
  flex-shrink: 0;
}
.app-detail-icon svg { width: 44px; height: 44px; stroke-width: 2; }

.app-detail-head { flex: 1; }

.app-detail-title {
  font-family: var(--heading, "Montserrat", sans-serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 8px 0 4px;
  color: #FFF9F0;
}

.app-detail-subtitle {
  font-size: 1rem;
  color: rgba(255, 249, 240, 0.7);
  margin: 0 0 12px;
}

.app-detail-tagline {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: #7EE0D0;
  font-weight: 600;
  margin: 0 0 16px;
}

.app-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.app-detail-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 249, 240, 0.08);
  border: 1px solid rgba(255, 249, 240, 0.15);
  color: rgba(255, 249, 240, 0.85);
}

.app-detail-long {
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(255, 249, 240, 0.75);
  margin: 0 0 32px;
  max-width: 780px;
}

.app-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.app-detail-platforms {
  font-size: 0.85rem;
  color: rgba(255, 249, 240, 0.55);
  margin: 0;
}

/* ============ SECTIONS ============ */
.app-detail-section {
  padding: clamp(56px, 8vw, 96px) 0;
}
.app-detail-section-alt {
  background: #FFFFFF;
}

.app-detail-section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(32px, 4vw, 56px);
}
.app-detail-kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #009688;
  margin-bottom: 12px;
}
.app-detail-section-head h2 {
  font-family: var(--heading, "Montserrat", sans-serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #001A17;
  margin: 0;
  line-height: 1.2;
}

/* ============ FEATURES ============ */
.app-detail-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 900px;
  margin-inline: auto;
}
.app-detail-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid rgba(0, 26, 23, 0.08);
  border-radius: 14px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.app-detail-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(0, 26, 23, 0.15);
  border-color: color-mix(in srgb, var(--app-color, #009688) 40%, transparent);
}
.app-detail-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--app-color, #009688) 12%, transparent);
  color: var(--app-color, #009688);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-detail-feature-icon svg { width: 20px; height: 20px; stroke-width: 2; }
.app-detail-feature-text {
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(0, 26, 23, 0.8);
  padding-top: 8px;
}

/* ============ SCREENSHOTS ============ */
.app-detail-shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin-inline: auto;
}
.app-detail-shot {
  aspect-ratio: 9 / 19.5;
  border-radius: 20px;
  overflow: hidden;
  background: #F0F2F0;
  border: 1px solid rgba(0, 26, 23, 0.08);
  margin: 0;
}
.app-detail-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.app-detail-shot-empty {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--app-color, #009688) 10%, #FFF9F0) 0%,
    color-mix(in srgb, var(--app-color, #009688) 30%, #FFF9F0) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--app-color, #009688);
  position: relative;
}
.app-detail-shot-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,0.4), transparent 65%);
  pointer-events: none;
}
.app-detail-shot-empty svg { width: 48px; height: 48px; opacity: 0.8; }
.app-detail-shot-empty span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #001A17;
  opacity: 0.6;
}

/* ============ AUTRES APPS ============ */
.app-detail-others {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 720px;
  margin-inline: auto;
}
.app-detail-other {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid rgba(0, 26, 23, 0.08);
  border-radius: 14px;
  text-decoration: none;
  color: #001A17;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.app-detail-other:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(0, 26, 23, 0.15);
  border-color: color-mix(in srgb, var(--app-color, #009688) 40%, transparent);
}
.app-detail-other-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--app-color, #009688) 12%, transparent);
  color: var(--app-color, #009688);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.app-detail-other-icon svg { width: 20px; height: 20px; }
.app-detail-other-name {
  flex: 1;
  font-weight: 700;
  font-size: 0.95rem;
}
.app-detail-other-arrow {
  color: var(--app-color, #009688);
  display: inline-flex;
}
.app-detail-other-arrow svg { width: 18px; height: 18px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .app-detail-hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .app-detail-icon { width: 72px; height: 72px; border-radius: 18px; }
  .app-detail-icon svg { width: 36px; height: 36px; }
  .app-detail-title { font-size: 1.8rem; }
  .app-detail-actions .btn { width: 100%; justify-content: center; }
  .app-detail-shots { grid-template-columns: 1fr 1fr; }
  .app-detail-shots > :nth-child(3) { display: none; }
  .app-detail-features { grid-template-columns: 1fr; }
  .app-detail-others { grid-template-columns: 1fr; }
}

/* ============ BOUTONS STORES ============ */
.app-detail-stores {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: #000;
  color: #FFF9F0;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid rgba(255, 249, 240, 0.2);
  transition: transform .2s ease, box-shadow .2s ease;
  min-width: 170px;
}
.store-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 249, 240, 0.4);
}
.store-btn svg { width: 24px; height: 24px; flex-shrink: 0; fill: currentColor; }
.store-btn-text { display: flex; flex-direction: column; line-height: 1.15; }
.store-btn-text small { font-size: 0.62rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.05em; }
.store-btn-text strong { font-family: var(--heading, "Montserrat", sans-serif); font-size: 0.95rem; font-weight: 700; }
.store-btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 249, 240, 0.1);
}
@media (max-width: 640px) {
  .app-detail-stores { flex-direction: column; }
  .store-btn { width: 100%; justify-content: center; }
}

/* ============ COVER HERO ============ */
.app-detail-cover {
  margin: 32px 0 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 249, 240, 0.05);
  border: 1px solid rgba(255, 249, 240, 0.1);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.4);
}
.app-detail-cover img { width: 100%; height: auto; display: block; }

/* ============ SVG officiels stores ============ */
.store-svg {
  width: 26px !important;
  height: 26px !important;
  flex-shrink: 0;
  display: block;
}

/* ============ Palette LNK — ajustements contraste ============ */

/* Pour les icônes sur fond jaune clair : forcer un fond suffisamment contrasté */
.app-detail-hero {
  --app-color-contrast: #FFFFFF;
}

/* Si l'app est "jaune" (--app-color: #FFC107), on force des textes dark sur les zones jaunes */
.app-detail-hero-inner .app-badge {
  color: #001A17;
}

/* Icône de l'app : ajuster pour les couleurs très claires */
.app-detail-icon {
  position: relative;
}
.app-detail-icon::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--app-color, #009688) 50%, transparent);
}

/* Features : icône sur fond teinté, garder contraste */
.app-detail-feature-icon {
  background: color-mix(in srgb, var(--app-color, #009688) 15%, transparent);
  color: var(--app-color, #009688);
}

/* Pour les couleurs très claires (yellow), assombrir l'icône et ajuster */
.app-detail-feature-icon svg {
  filter: drop-shadow(0 0 0 transparent);
}

/* Badge du hub : couleurs alignées palette */
.app-badge.status-beta {
  /* LushiMarket en beta → jaune actuel OK */
}

/* Focus visible : cohérent avec la palette */
.app-card-overlay:focus-visible {
  outline: 2px solid var(--app-color, #009688) !important;
}

/* Bouton primaire du détail : prend la couleur de l'app */
.app-detail-actions .btn-primary {
  background: var(--app-color, #009688) !important;
  border-color: var(--app-color, #009688) !important;
}
.app-detail-actions .btn-primary:hover {
  filter: brightness(0.9);
}

/* Bouton "Voir les détails" du hub au hover : couleur de l'app */
.app-card:hover .app-card-link {
  color: var(--app-color, #009688);
}

/* ============================================================
   CONTRASTE AUTOMATIQUE — zones avec --app-color jaune
   ============================================================ */

/* Icône de l'app : si couleur = yellow, forcer le SVG en dark */
.app-detail-icon[style*="#FFC107"],
.app-detail-icon[style*="#ffc107"] {
  color: #001A17;
}

/* Feature icon jaune → dark */
.app-detail-feature-icon[style*="#FFC107"],
.app-detail-feature-icon[style*="#ffc107"] {
  color: #001A17;
}

/* Badge status sur jaune : forcer dark */
.app-detail-hero .app-badge.status-live,
.app-detail-hero .app-badge.status-beta,
.app-detail-hero .app-badge.status-soon {
  color: #001A17 !important;
}
