/* ============================
   MXBZH - TERRAINS STYLE AIRBNB
   Design premium avec fond bleu nuit
   ============================ */

/* ============================
   SECTION PRINCIPALE
   ============================ */

.terrains-section {
  background: linear-gradient(180deg, #0f0f19 0%, #1a1a2e 50%, #16213e 100%) !important;
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}

/* Override des styles de filters.css */
#dispos.terrains-section {
  background: linear-gradient(180deg, #0f0f19 0%, #1a1a2e 50%, #16213e 100%) !important;
}

#dispos.terrains-section::before,
#dispos.terrains-section::after {
  display: none;
}

.terrains-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.terrains-section::after {
  content: "";
  position: absolute;
  top: 10%;
  right: -10%;
  width: 40%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(15, 74, 163, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.terrains-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ============================
   HEADER DE SECTION
   ============================ */

.terrains-header {
  text-align: center;
  margin-bottom: 3rem;
}

.terrains-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
}

.terrains-badge svg {
  width: 16px;
  height: 16px;
}

.terrains-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.terrains-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  max-width: 500px;
  margin: 0 auto;
}

/* ============================
   BARRE D'ACTIONS
   ============================ */

.terrains-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.terrains-count {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
}

.terrains-count strong {
  color: #ffffff;
  font-weight: 600;
}

.terrains-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.terrains-map-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.terrains-map-btn svg {
  width: 18px;
  height: 18px;
}

/* ============================
   FILTRES COMPACTS
   ============================ */

.terrains-filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.terrain-filter-chip {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terrain-filter-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.terrain-filter-chip.active {
  background: #ffffff;
  color: #0f0f19;
  border-color: #ffffff;
}

.terrain-filter-select {
  padding: 10px 36px 10px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all 0.2s ease;
}

.terrain-filter-select:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.terrain-filter-select option {
  background: #1a1a2e;
  color: #ffffff;
}

/* ============================
   GRILLE DE CARDS
   ============================ */

.terrains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* ============================
   CARD TERRAIN AIRBNB - Bleu nuit inversé
   ============================ */

.terrain-airbnb-card {
  background: linear-gradient(145deg, 
    rgba(15, 23, 42, 0.98) 0%, 
    rgba(25, 35, 55, 0.97) 50%,
    rgba(15, 23, 42, 0.98) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.terrain-airbnb-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Carrousel d'images */
.terrain-airbnb-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: linear-gradient(135deg, #e5edf7, #cfd8e6);
}

.terrain-airbnb-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.terrain-airbnb-slide {
  min-width: 100%;
  height: 100%;
}

.terrain-airbnb-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.terrain-airbnb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
  color: white;
  font-size: 4rem;
}

/* Bouton favori */
.terrain-airbnb-fav {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.terrain-airbnb-fav:hover {
  background: #ffffff;
  transform: scale(1.1);
}

.terrain-airbnb-fav svg {
  width: 18px;
  height: 18px;
  color: #374151;
  transition: all 0.2s ease;
}

.terrain-airbnb-fav.liked svg {
  color: #ef4444;
  fill: #ef4444;
}

/* Indicateurs du carrousel */
.terrain-airbnb-indicators {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 4;
}

.terrain-airbnb-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
}

.terrain-airbnb-dot.active {
  background: #ffffff;
  transform: scale(1.3);
}

/* Flèches du carrousel */
.terrain-airbnb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.terrain-airbnb-card:hover .terrain-airbnb-arrow {
  opacity: 1;
}

.terrain-airbnb-arrow:hover {
  background: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.terrain-airbnb-arrow.prev { left: 12px; }
.terrain-airbnb-arrow.next { right: 12px; }

.terrain-airbnb-arrow svg {
  width: 16px;
  height: 16px;
  color: #1f2937;
}

/* Corps de la card */
.terrain-airbnb-body {
  padding: 1.25rem;
  background: transparent;
}

.terrain-airbnb-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.terrain-airbnb-name {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
}

.terrain-airbnb-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.terrain-airbnb-status.open {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.terrain-airbnb-status.closed {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.terrain-airbnb-status.option {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.terrain-airbnb-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.terrain-airbnb-location svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.terrain-airbnb-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.terrain-airbnb-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #60a5fa;
}

.terrain-airbnb-hours {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.terrain-airbnb-hours svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* Footer de la card */
.terrain-airbnb-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.terrain-airbnb-owner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.terrain-airbnb-owner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
}

.terrain-airbnb-owner-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.terrain-airbnb-owner-name {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 500;
}

.terrain-airbnb-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.95) 0%, 
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0.90) 100%);
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 
    0 4px 12px rgba(255, 255, 255, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  position: relative;
  overflow: hidden;
}

.terrain-airbnb-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.terrain-airbnb-btn:hover::before {
  left: 100%;
}

.terrain-airbnb-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 1) 0%, 
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 255, 255, 1) 100%);
  box-shadow: 
    0 8px 20px rgba(255, 255, 255, 0.25),
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* ============================
   ÉTAT VIDE
   ============================ */

.terrains-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
}

.terrains-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.terrains-empty h4 {
  font-size: 1.3rem;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.terrains-empty p {
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* ============================
   MODAL CARTE
   ============================ */

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.map-modal.active {
  display: flex;
}

.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.map-modal-content {
  position: relative;
  width: 95%;
  max-width: 1200px;
  height: 85vh;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.map-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.map-modal-close:hover {
  transform: scale(1.1);
}

.map-modal-close svg {
  width: 20px;
  height: 20px;
  color: #374151;
}

.map-modal-map {
  width: 100%;
  height: 100%;
}



/* ============================
   RESPONSIVE MOBILE
   ============================ */

/* Override responsive.css */
@media (max-width: 768px) {
  #dispos.terrains-section {
    padding: 3.5rem 0 4rem !important;
    background: linear-gradient(180deg, #0f0f19 0%, #1a1a2e 50%, #16213e 100%) !important;
  }
}

@media (max-width: 768px) {
  .terrains-section {
    padding: 3.5rem 0 4rem;
  }

  .terrains-container {
    padding: 0 1rem;
  }

  .terrains-header {
    margin-bottom: 1.5rem;
  }

  .terrains-title {
    font-size: 1.6rem;
  }

  .terrains-subtitle {
    font-size: 0.95rem;
  }

  .terrains-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .terrains-count {
    font-size: 0.85rem;
  }

  .terrains-map-btn {
    padding: 10px 18px;
    font-size: 0.8rem;
  }

  .terrains-filters {
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .terrains-filters::-webkit-scrollbar {
    display: none;
  }

  .terrain-filter-chip,
  .terrain-filter-select {
    padding: 8px 14px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  /* Grille mobile : cartes compactes */
  .terrains-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 100%;
  }

  /* Card mobile HORIZONTALE COMPACTE */
  .terrain-airbnb-card {
    display: flex;
    flex-direction: row;
    border-radius: 14px;
    min-height: auto;
    overflow: hidden;
  }

  .terrain-airbnb-card:hover {
    transform: none;
  }

  /* Carousel compact à gauche */
  .terrain-airbnb-carousel {
    width: 130px;
    min-width: 130px;
    flex-shrink: 0;
    aspect-ratio: auto;
    height: auto;
    min-height: 140px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
  }

  .terrain-airbnb-slides {
    position: absolute;
    inset: 0;
    display: flex;
  }

  .terrain-airbnb-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
  }

  .terrain-airbnb-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  .terrain-airbnb-placeholder {
    position: absolute;
    inset: 0;
    font-size: 2.5rem;
  }

  .terrain-airbnb-fav {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
  }

  .terrain-airbnb-fav svg {
    width: 14px;
    height: 14px;
  }

  .terrain-airbnb-indicators {
    bottom: 8px;
  }

  .terrain-airbnb-dot {
    width: 5px;
    height: 5px;
  }

  .terrain-airbnb-arrow {
    display: none;
  }

  /* Body compact à droite */
  .terrain-airbnb-body {
    flex: 1;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
  }

  .terrain-airbnb-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.25rem;
  }

  .terrain-airbnb-name {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .terrain-airbnb-status {
    padding: 3px 8px;
    font-size: 0.65rem;
    flex-shrink: 0;
  }

  .terrain-airbnb-location {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  .terrain-airbnb-location svg {
    width: 12px;
    height: 12px;
  }

  .terrain-airbnb-meta {
    margin-bottom: 0.5rem;
    gap: 0.5rem;
  }

  .terrain-airbnb-type {
    padding: 2px 8px;
    font-size: 0.7rem;
  }

  .terrain-airbnb-hours {
    display: none;
  }

  .terrain-airbnb-footer {
    flex-direction: row;
    padding-top: 0.5rem;
    gap: 0.5rem;
    align-items: center;
  }

  .terrain-airbnb-owner {
    flex: 1;
    min-width: 0;
  }

  .terrain-airbnb-owner-avatar {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }

  .terrain-airbnb-owner-name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .terrain-airbnb-btn {
    padding: 8px 14px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  /* Modal carte mobile - Plein écran */
  .map-modal {
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  
  .map-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  .map-modal-map {
    width: 100% !important;
    height: 100% !important;
  }
  
  /* Cacher le bouton de fermeture sur mobile */
  .map-modal-close {
    display: none !important;
  }
}

@media (max-width: 400px) {
  .terrain-airbnb-carousel {
    width: 110px;
    min-width: 110px;
    min-height: 130px;
  }

  .terrain-airbnb-body {
    padding: 0.6rem;
  }

  .terrain-airbnb-name {
    font-size: 0.9rem;
  }

  .terrain-airbnb-btn {
    padding: 7px 12px;
    font-size: 0.7rem;
  }
}

/* ============================
   ANIMATIONS
   ============================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terrain-airbnb-card {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.terrain-airbnb-card:nth-child(1) { animation-delay: 0.1s; }
.terrain-airbnb-card:nth-child(2) { animation-delay: 0.15s; }
.terrain-airbnb-card:nth-child(3) { animation-delay: 0.2s; }
.terrain-airbnb-card:nth-child(4) { animation-delay: 0.25s; }
.terrain-airbnb-card:nth-child(5) { animation-delay: 0.3s; }
.terrain-airbnb-card:nth-child(6) { animation-delay: 0.35s; }

/* ============================
   LOADING STATE
   ============================ */

.terrains-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.7);
}

.terrains-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
