/* ==========================================
   Golf House - Unit Detail Page
   ========================================== */

.unit-detail-page {
  padding-top: 100px;
  min-height: 100vh;
  background: var(--dark-900);
  padding-bottom: 4rem;
}

.unit-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Back Button */
.back-to-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark-300);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  transition: all 0.3s;
}

.back-to-buy:hover {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.back-to-buy svg {
  width: 18px;
  height: 18px;
}

/* Gallery Section */
.unit-gallery {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  margin-bottom: 2rem;
  border-radius: 24px;
  overflow: hidden;
  max-height: 500px;
}

.gallery-main {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  min-height: 400px;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-main:hover img {
  transform: scale(1.03);
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  z-index: 5;
}

.gallery-nav-btn:hover {
  background: var(--gold);
  color: var(--dark-900) !important;
}

.gallery-nav-btn svg {
  width: 20px;
  height: 20px;
}

.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }

.gallery-thumbnails {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dark-500) transparent;
}

.gallery-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s;
  aspect-ratio: 4/3;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  border-color: var(--gold);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumb-more {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-700);
  border-radius: 12px;
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.gallery-thumb-more::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
}

.gallery-thumb-more span {
  position: relative;
  z-index: 2;
}

/* Unit Info Section */
.unit-info-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
}

.unit-main-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.unit-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.unit-title-row h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1.4;
}

.unit-price {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold);
  white-space: nowrap;
}

.unit-price .currency {
  font-size: 1rem;
  font-weight: 600;
  margin-right: 4px;
}

.unit-location-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark-300);
  font-size: 0.95rem;
}

.unit-location-row svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

/* Feature Cards */
.unit-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.unit-feature-card {
  background: var(--dark-700);
  border: 1px solid var(--dark-500);
  border-radius: 16px;
  padding: 1.2rem;
  text-align: center;
  transition: all 0.3s;
}

.unit-feature-card:hover {
  border-color: rgba(212, 175, 55, 0.3);
}

.unit-feature-card svg {
  width: 28px;
  height: 28px;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.unit-feature-card .value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.2rem;
}

.unit-feature-card .label {
  font-size: 0.75rem;
  color: var(--dark-300);
}

/* Description */
.unit-description {
  background: var(--dark-800);
  border: 1px solid var(--dark-600);
  border-radius: 20px;
  padding: 1.5rem;
}

.unit-description h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.unit-description-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.desc-feature {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--dark-200);
  padding: 0.4rem 0.8rem;
  background: var(--dark-700);
  border-radius: 10px;
}

.desc-feature svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

/* Contact Card (Sidebar) */
.unit-contact-card {
  background: var(--dark-800);
  border: 1px solid var(--dark-600);
  border-radius: 24px;
  padding: 1.5rem;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-card-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--white);
}

/* Broker Info */
.broker-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  background: var(--dark-700);
  border-radius: 14px;
  border: 1px solid var(--dark-500);
}

.broker-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
}

.broker-card-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dark-500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-300);
  flex-shrink: 0;
}

.broker-card-placeholder svg {
  width: 24px;
  height: 24px;
}

.broker-card-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
}

.broker-card-info p {
  font-size: 0.75rem;
  color: var(--gold);
}

/* Contact Buttons */
.contact-btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  color: var(--dark-900);
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Tajawal', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.contact-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.contact-btn-whatsapp {
  width: 100%;
  padding: 0.85rem;
  background: #25d366;
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Tajawal', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.contact-btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.contact-btn-outline {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: var(--white);
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid var(--dark-500);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Tajawal', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.contact-btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--dark-200);
  padding: 0.3rem 0;
}

.contact-info-item svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
  flex-shrink: 0;
}

/* Custom Video Player integrated into Gallery */
.custom-video-wrapper {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.custom-video-wrapper:fullscreen {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}
.custom-video-wrapper:-webkit-full-screen {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

.custom-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.custom-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 30px 20px 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 10;
  box-sizing: border-box;
}

/* Ensure controls stay full-width in fullscreen */
.custom-video-wrapper:fullscreen .custom-video-controls,
.custom-video-wrapper:-webkit-full-screen .custom-video-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100vw;
  padding: 40px 30px 20px;
  z-index: 9999;
}

.custom-video-wrapper:hover .custom-video-controls,
.custom-video-wrapper.is-paused .custom-video-controls {
  opacity: 1;
}

.control-btn {
  background: none;
  border: none;
  color: #ffffff !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s;
  padding: 0;
}

.control-btn:hover {
  color: var(--gold);
}

.control-btn svg {
  width: 24px;
  height: 24px;
}

.progress-bar-container {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: height 0.2s;
}

.progress-bar-container:hover {
  height: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
  width: 0%;
  pointer-events: none;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #e0e0e0;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
  transition: transform 0.2s;
}

.progress-bar-container:hover .progress-bar-fill::after {
  transform: translateY(-50%) scale(1.3);
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  transition: all 0.2s;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
}

.video-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: white;
  border-radius: 12px;
}
.video-thumb-overlay svg {
  width: 32px;
  height: 32px;
  color: #ffffff !important;
  opacity: 0.8;
  transition: all 0.3s;
}

.gallery-thumb:hover .video-thumb-overlay svg {
  color: var(--gold);
  transform: scale(1.1);
  opacity: 1;
}

.thumb-video-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #ffffff !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.lightbox-nav:hover {
  background: var(--gold);
  color: var(--dark-900);
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
}

.lightbox-prev { right: 20px; }
.lightbox-next { left: 20px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 0.9rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.3rem 1rem;
  border-radius: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
  .unit-info-grid {
    grid-template-columns: 1fr;
  }

  .unit-contact-card {
    position: static;
  }
}

@media (max-width: 768px) {
  .unit-gallery {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(4, 1fr);
    max-height: 200px;
  }

  .unit-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .unit-title-row {
    flex-direction: column;
  }

  .unit-detail-container {
    padding: 0 1rem;
  }
}


/* Special Boosts Badges for Unit Detail */
.prop-boost-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
}
.prop-boost-badge.boost-حرق-سعر {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.prop-boost-badge.boost-وحده-لقطه {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.prop-boost-badge.boost-خصم-مطور, .prop-boost-badge.boost-خصم-شركه {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}
.prop-boost-badge.boost-من-تنفيذ-الشركه {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
