﻿/* =====================================================
   PROJET SHOWCASE - Page unique projets
   =====================================================
   Grille de banniÃ¨res cliquables + popup dÃ©taillÃ©e
   ===================================================== */

/* ==================== GRILLE DE PROJETS SIMPLES ==================== */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.showcase-card {
  background: var(--bg-card, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

body.dark-theme .showcase-card {
  background: rgba(26, 26, 46, 0.4);
  border-color: rgba(138, 138, 255, 0.15);
}

.showcase-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .showcase-card:hover {
  border-color: rgba(138, 138, 255, 0.4);
}

.showcase-card-media {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.showcase-card-media iframe,
.showcase-card-media video,
.showcase-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* iframe is automatically styled by youtube, but for vertical it will add black bars intrinsically */
}

/* Specific inner media that doesn't crop */
.showcase-card-media iframe {
  border: none;
}

.showcase-card-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.showcase-card-title {
  font-family: var(--font-family-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary, #fff);
  margin: 0 0 8px 0;
}

body.dark-theme .showcase-card-title {
  color: #B8B8FF;
}

.showcase-card-meta {
  font-family: var(--font-family-secondary);
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.dark-theme .showcase-card-meta {
  color: #8A8AFF;
}

.showcase-card-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 20px 0;
  flex: 1;
}

body.dark-theme .showcase-card-desc {
  color: rgba(255, 255, 255, 0.85);
}

.showcase-card-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}

.showcase-card-actions button {
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #fff;
}

.showcase-card-actions button:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
}

body.dark-theme .showcase-card-actions button {
  border-color: rgba(138,138,255,0.4);
  color: #B8B8FF;
}

body.dark-theme .showcase-card-actions button:hover {
  background: rgba(138,138,255,0.15);
  border-color: #B8B8FF;
}

/* ==================== POPUP / MODAL ==================== */
.showcase-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.showcase-popup-overlay.active {
  display: flex;
  opacity: 1;
}

.showcase-popup {
  background: var(--bg-popup, #181824);
  border-radius: 20px;
  max-width: 1400px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: popupSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Bouton fermer */
.showcase-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
  line-height: 1;
}

.showcase-popup-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
  transform: rotate(90deg);
}

/* Partie gauche - VidÃ©o / 3D / 360 */
.showcase-popup-media {
  flex: none;
  min-height: 420px;
  height: 68vh;
  max-height: 74vh;
  background: #000;
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.showcase-popup-media video,
.showcase-popup-media model-viewer {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.popup-media-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.popup-media-item {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.showcase-popup-media .video-thumbnail-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.showcase-popup-media .video-thumbnail-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-popup-media .custom-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease;
}

.showcase-popup-media .custom-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Partie droite - Texte + Boutons */
.showcase-popup-info {
  flex: none;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #e0e0e8;
}

.showcase-popup-title {
  font-family: var(--font-family-heading, 'Rufina', serif);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 12px 0;
  color: #fff;
}

.showcase-popup-desc {
  font-family: var(--font-family-primary, 'Raleway', sans-serif);
  font-size: 0.92rem;
  line-height: 1.7;
  color: #111 !important;
  margin: 0 0 10px 0;
  text-align: justify;
  opacity: 1;
}

.showcase-popup-meta {
  font-size: 0.82rem;
  color: #222 !important;
  margin: 0 0 24px 0;
}

.showcase-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.showcase-popup-actions .btn {
  font-size: 0.9rem;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.showcase-popup-actions .btn-primary {
  background: var(--color-primary, #26267b);
  color: #fff;
}

.showcase-popup-actions .btn-primary:hover {
  background: var(--color-primary-dark, #1a1a5a);
  transform: translateY(-1px);
}

.showcase-popup-actions .btn-primary.active-media-btn {
  background: var(--color-primary, #26267b);
  color: #fff;
  box-shadow: 0 2px 12px rgba(38, 38, 123, 0.28);
}

.showcase-popup-actions .btn-outline {
  background: transparent;
  color: var(--color-primary, #26267b);
  border: 2px solid var(--color-primary, #26267b);
  opacity: 1;
}

.showcase-popup-actions .btn-outline:hover {
  background: rgba(38,38,123,0.1);
  color: #fff;
  border-color: var(--color-primary, #26267b);
  transform: translateY(-1px);
}

.showcase-popup-actions .btn-outline.active-media-btn {
  background: var(--color-primary, #26267b);
  color: #fff;
  border-color: var(--color-primary, #26267b);
  opacity: 1;
}

/* Accessible focus styles for keyboard users */
.showcase-popup-actions .btn:focus-visible {
  outline: 3px solid rgba(38,38,123,0.18);
  outline-offset: 3px;
}

/* Media container inside popup */
.popup-media-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.popup-media-item {
  display: none;
  width: 100%;
  height: 100%;
}

.popup-media-item.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== SECTION HEADER ==================== */
.showcase-section-header {
  text-align: center;
  padding: 40px 20px 40px;
  max-width: 700px;
  margin: 0 auto;
}

.showcase-section-title {
  font-family: var(--font-family-heading, 'Rufina', serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 12px 0;
  color: var(--text-color);
}

.showcase-section-subtitle {
  font-family: var(--font-family-primary, 'Raleway', sans-serif);
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ==================== SCROLL TO TOP (si utilisÃ©) ==================== */
.showcase-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
}

/* SÃ©quence 360Â° container */
.popup-360-container {
  width: 100%;
  height: 100%;
  min-height: 350px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  overflow: hidden;
}

.popup-360-container .viewer-loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 1.1rem;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 8px;
  pointer-events: none;
}

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

/* Tablette */
@media (max-width: 1024px) {
  .showcase-popup {
    flex-direction: column;
    max-height: 92vh;
  }

  .showcase-popup-media {
    border-radius: 20px 20px 0 0;
    min-height: 280px;
    max-height: 45vh;
  }

  .showcase-popup-info {
    padding: 28px 24px;
  }

  .showcase-popup-title {
    font-size: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  #projets {
    padding-top: 140px !important;
  }

  .showcase-section-header {
    padding-top: 10px;
  }

  .showcase-grid { padding: 0 16px 14px; gap: 14px; }

  .showcase-card { flex-basis: 86vw; }

  .showcase-card-title {
    font-size: 1.2rem;
  }

  .showcase-card-subtitle {
    font-size: 0.8rem;
  }

  .showcase-popup-overlay {
    padding: 10px;
    align-items: center;
    justify-content: center;
  }

  .showcase-popup {
    flex-direction: column;
    max-height: 92vh;
    border-radius: 14px;
  }

  .showcase-popup-media {
    border-radius: 14px 14px 0 0;
    min-height: 200px;
    max-height: 35vh;
  }

  .showcase-popup-info {
    padding: 20px 18px;
  }

  .showcase-popup-title {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .showcase-popup-desc {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  .showcase-popup-meta {
    font-size: 0.78rem;
    margin-bottom: 16px;
  }

  .showcase-popup-actions {
    gap: 8px;
  }

  .showcase-popup-actions .btn {
    font-size: 0.8rem;
    padding: 7px 14px;
  }

  .showcase-popup-close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .showcase-card-overlay {
    padding: 16px;
  }
}

/* Petit mobile */
@media (max-width: 480px) {
  .showcase-popup-media {
    min-height: 180px;
    max-height: 30vh;
  }

  .showcase-popup-media.popup-media-vertical {
    min-height: 55vh;
    max-height: 62vh !important;
  }

  .showcase-popup-info {
    padding: 16px 14px;
  }

  .showcase-popup-title {
    font-size: 1.15rem;
  }

  .showcase-popup-actions .btn {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
}

/* ==================== BOUTON ACTIVER LE SON ==================== */
.unmute-btn {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 30px;
  color: #fff;
  font-family: var(--font-family-primary, 'Raleway', sans-serif);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.25s ease, background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
  animation: unmutePulse 2s ease-in-out infinite;
  opacity: 1;
}

.unmute-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}

.unmute-btn svg {
  flex-shrink: 0;
}

.unmute-btn.hidden {
  opacity: 0;
  pointer-events: none;
  animation: none;
}

@keyframes unmutePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
}

@media (max-width: 768px) {
  .unmute-btn {
    bottom: 12px;
    left: 12px;
    padding: 8px 14px;
    font-size: 0.78rem;
    gap: 6px;
    display: flex !important;
  }
}

/* Vertical video popup (Gentle Mates) - mobile */
@media (max-width: 768px) {
  .popup-media-vertical {
    min-height: 60vh;
    max-height: 65vh !important;
    flex: 1.5;
  }

  .popup-media-vertical video {
    object-fit: contain !important;
    width: 100% !important;
    height: 100% !important;
  }

  .popup-media-vertical .popup-media-container,
  .popup-media-vertical .popup-media-item {
    height: 100%;
  }

  /* RÃ©duire la partie info pour laisser plus de place Ã  la vidÃ©o verticale */
  .popup-media-vertical ~ .showcase-popup-info {
    padding: 14px 18px;
    flex: 0;
  }

  .popup-media-vertical ~ .showcase-popup-info .showcase-popup-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.82rem;
  }
}

/* 360 centering fix mobile */
@media (max-width: 768px) {
  .popup-360-container {
    min-height: auto !important;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .popup-360-container canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
  }

  #bb-media-360 .popup-360-container {
    min-height: auto !important;
  }

  #bb-product-viewer {
    min-height: auto !important;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ==================== VERTICAL VIDEO (Gentle Mates) ==================== */
.popup-media-vertical {
  min-height: 400px;
}

.popup-media-vertical video {
  object-fit: contain !important;
}

/* ==================== 360 MOBILE FIX ==================== */
.popup-360-container canvas {
  display: block;
  margin: 0 auto;
}

/* ==================== LIGHT THEME OVERRIDES ==================== */
/* Popup reste toujours en dark, cohÃ©rent avec la DA */
body:not(.dark-theme) .showcase-popup-close {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

body:not(.dark-theme) .showcase-popup-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.5);
}


/* NOUVELLE GRILLE DE PROJETS */
.inline-projects-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.project-inline-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

body.dark-theme .project-inline-card {
  background: rgba(26, 26, 46, 0.4);
  border-color: rgba(138, 138, 255, 0.15);
}

.inline-media-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#popup-rawdev .inline-media-container {
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  background: transparent;
  border-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#popup-rawdev .popup-media-container,
#popup-rawdev .popup-media-item {
  background: transparent;
}

#popup-rawdev iframe {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 9 / 16;
  background: transparent;
}

/* Fix media items inside */
.popup-media-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.popup-media-item {
  display: none;
  width: 100%;
  height: 100%;
}

.popup-media-item.active {
  display: block;
}

/* Info container */
.inline-info-container {
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showcase-popup-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

body.dark-theme .showcase-popup-desc {
  color: #E0E0FF;
}

.showcase-popup-meta {
  font-family: var(--font-family-secondary);
  font-size: 0.9rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.showcase-popup-site-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-family: var(--font-family-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  color: #26267B;
  text-decoration: none;
  padding: 8px 0 2px;
}

.showcase-popup-site-link:hover,
.showcase-popup-site-link:focus-visible {
  color: #4a4ab8;
  text-decoration: underline;
}

/* Project title variants: separate tag and client name */
.project-tag {
  display: inline-block;
  font-size: 1.08rem;
  color: #222;
  font-weight: 600;
  line-height: 1.1;
  margin: 0 6px 0 0;
}

.project-client {
  display: inline-block;
  font-size: 1rem;
  color: #444;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin: 0;
}

.project-with {
  font-size: 1.08rem;
  color: #222;
  font-weight: 600;
  margin-right: 6px;
}

.project-name {
  font-size: 1.18rem;
  color: #222;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Prevent line breaks for the Ventilo title */
#popup-ventilo .timeline-title {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Accessibility override: force readable, high-contrast text for project descriptions */
.showcase-popup-desc {
  color: #111 !important;
  opacity: 1 !important;
}
.showcase-popup-meta {
  color: #222 !important;
}

body.dark-theme .showcase-popup-meta {
  color: #8A8AFF;
}

body.dark-theme .showcase-popup-site-link {
  color: #fff;
}

body.dark-theme .showcase-popup-site-link:hover,
body.dark-theme .showcase-popup-site-link:focus-visible {
  color: #fff;
}

.showcase-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

body.dark-theme .showcase-popup-actions {
  border-top-color: rgba(138, 138, 255, 0.2);
}

.showcase-popup-actions .btn {
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
}

body.dark-theme .showcase-popup-desc,
body.dark-theme .showcase-popup-meta,
body.dark-theme .project-tag,
body.dark-theme .project-client,
body.dark-theme .project-with,
body.dark-theme .project-name,
body.dark-theme .timeline-title {
  color: #fff !important;
}

body.dark-theme .showcase-popup-meta {
  opacity: 0.9;
}

/* NOUVELLE GRILLE DE PROJETS */
.inline-projects-list {
  display: flex;
  flex-direction: column;
  gap: 60px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

.project-inline-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}

body.dark-theme .project-inline-card {
  background: rgba(26, 26, 46, 0.4);
  border-color: rgba(138, 138, 255, 0.15);
}

.inline-media-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Fix media items inside */
.popup-media-container {
  width: 100%;
  height: 100%;
  position: relative;
}

.popup-media-item {
  display: none;
  width: 100%;
  height: 100%;
}

.popup-media-item.active {
  display: block;
}

/* Info container */
.inline-info-container {
  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showcase-popup-desc {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

body.dark-theme .showcase-popup-desc {
  color: #E0E0FF;
}

.showcase-popup-meta {
  font-family: var(--font-family-secondary);
  font-size: 0.9rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

body.dark-theme .showcase-popup-meta {
  color: #8A8AFF;
}

.showcase-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

body.dark-theme .showcase-popup-actions {
  border-top-color: rgba(138, 138, 255, 0.2);
}

.showcase-popup-actions .btn {
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
}
