/* styles.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Cairo", sans-serif;
  overflow: hidden;
}

/* ===== الهيدر ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 24px;
  font-weight: 700;
}

.logo-icon {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.logo img {
  width: inherit;
  height: inherit;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* ===== الخريطة ===== */
#map {
  height: 100vh;
  width: 100%;
}

/* ===== الفلاتر (الشريط الأيسر) ===== */
.filters-panel {
  position: fixed;
  left: 20px;
  top: 90px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  width: 200px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.filters-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 8px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: "Cairo", sans-serif;
  font-size: 14px;
  text-align: right;
  transition: all 0.3s;
  background: #f5f5f5;
  color: #555;
}

.filter-btn:hover {
  background: #e8e8e8;
}

.filter-btn.active {
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  color: #000;
  font-weight: 600;
}

.filter-icon {
  font-size: 18px;
}

/* ===== معلومات الطقس ===== */
.weather-widget {
  position: fixed;
  top: 90px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 20px;
  min-width: 150px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  text-align: center;
}

.weather-temp {
  font-size: 42px;
  font-weight: 700;
  color: #333;
  line-height: 1;
}

.weather-condition {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}

.weather-time {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  margin-top: 10px;
}

.weather-date {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

/* ===== علامات المشاريع المخصصة ===== */
.custom-marker {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s;
}

.custom-marker:hover {
  transform: scale(1.1);

}

.marker-label {
  background: white;
  padding: 8px 15px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.3s;
  z-index: 1000 !important;
}

.marker-label.project {
  background: linear-gradient(135deg, #fff 0%, #f8f8f8 100%);
  border: 2px solid #d4af37;
  width: fit-content;
  z-index: 99999999 !important;
}

.marker-label.landmark {
  background: rgba(50, 50, 50, 0.9);
  color: white;
  width: fit-content;
}

.marker-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.marker-icon.project {
  background: #d4af37;
}

.marker-icon.landmark {
  background: #666;
}

.marker-line {
  position: absolute;
  width: 2px;
  height: 30px;
  background: #d4af37;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
}

.marker-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #d4af37;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
}

/* ===== Popup المشاريع ===== */
.project-popup {
  min-width: 280px;
  font-family: "Cairo", sans-serif;
}

.popup-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

.popup-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.popup-type {
  display: inline-block;
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  color: #000;
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.popup-description {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.popup-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.feature-tag {
  background: #f5f5f5;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  color: #555;
}

.popup-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  border: none;
  border-radius: 10px;
  color: #000;
  font-family: "Cairo", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.popup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

/* ===== صفحة تفاصيل المشروع (Modal) ===== */
.project-details-modal {
  position: fixed;
  
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  z-index: 3000;
  overflow-y: auto;
}

.project-details-modal.active {
  display: block;
}

.project-details-header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-details-title {
  color: white;
  font-size: 28px;
  font-weight: 700;
}

.project-details-close {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s;
}

.project-details-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.project-details-content {
  padding: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.building-viewer {
  position: relative;
  width: 100%;
  max-width: 1200px;
  background: url(./img/2.jpg);
  object-fit:cover;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.building-image-container {
  position: relative;
  width: 100%;
  object-fit: fill;
  padding-bottom: 60%; /* نسبة العرض للارتفاع */
  overflow: hidden;
}

.building-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(135deg, #87ceeb 0%, #e0f6ff 100%);
}

/* ===== Hotspots على المبنى ===== */
.building-hotspot {
  position: absolute;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.building-hotspot:hover {
  transform: scale(1.2);
  z-index: 20;
}

.hotspot-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.6);
  animation: hotspotPulse 2s infinite;
}

@keyframes hotspotPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.hotspot-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hotspot-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
}

/* ===== معلومات Hotspot ===== */
.hotspot-tooltip {
  position: absolute;
  background: white;
  padding: 15px 20px;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.9);
  transition: all 0.3s;
  z-index: 30;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
}

.hotspot-tooltip.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.hotspot-tooltip::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid white;
}

.hotspot-tooltip-title {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.hotspot-tooltip-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 10px;
}

.hotspot-tooltip-btn {
  width: 100%;
  padding: 8px 15px;
  background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: "Cairo", sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
/* Overlay فوق كل حاجة */
.hotspot-screen{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999; /* أعلى من Leaflet */
  padding: 24px;
}

.hotspot-screen.active{ display:flex; }

.hotspot-screen-content{
  width: min(80vw, 1200px);
  max-height: 90vh;
  overflow: auto;
  border-radius: 18px;
  background: rgba(20,20,30,.95);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px rgba(0,0,0,.7);
}

.hotspot-screen-header{
  position: sticky;
  top: 0;
  display:flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  background: rgba(0,0,0,.85);
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.hotspot-screen-title{ color:#fff; font-size:22px; font-weight:700; }
.hotspot-screen-close{
  width:44px;height:44px;border-radius:50%;
  border:none; cursor:pointer;
  background: rgba(255,255,255,.12);
  color:#fff; font-size:24px;
}

.hotspot-screen-body{ padding: 20px 22px 26px; }

/* ===== Image Viewer ===== */
.hotspot-screen-hero {
  position: relative;
  width: 100%;
  height: 75vh;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  cursor: grab;
  user-select: none;
}

.hotspot-screen-hero:active { cursor: grabbing; }

.hotspot-screen-hero img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: fill;
  transform-origin: 0 0;
  transition: none; /* تعطيل transition أثناء الـ drag */
  will-change: transform;
}

/* Controls bar */
.img-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.img-ctrl-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  backdrop-filter: blur(6px);
}

.img-ctrl-btn:hover { background: rgba(212,175,55,0.8); }


.hotspot-screen-desc{
  margin-top: 14px;
  color: #d6d6d6;
  line-height: 1.7;
  font-size: 14px;
}

.hotspot-cards{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.hotspot-card{
  border-radius: 14px;
  padding: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  transition: .25s;
}
.hotspot-card:hover{
  transform: translateY(-6px);
  background: rgba(255,255,255,.10);
}

.hotspot-card .icon{ font-size: 34px; margin-bottom: 10px; }
.hotspot-card .title{ color:#d4af37; font-weight:700; margin-bottom: 6px; }
.hotspot-card .text{ color:#cfcfcf; font-size: 13px; line-height: 1.6; }

/* ===== معلومات المشروع ===== */
.project-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.project-info-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-info-card h3 {
  color: #d4af37;
  font-size: 14px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.project-info-card p {
  color: white;
  font-size: 18px;
  font-weight: 600;
}

/* ===== مميزات المشروع ===== */
.project-features-section {
  margin-bottom: 40px;
}

.section-title {
  color: white;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 25px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.feature-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 40px;
  margin-bottom: 15px;
}

.feature-name {
  color: white;
  font-size: 16px;
  font-weight: 600;
}

/* ===== أزرار التحكم في الصورة ===== */
.viewer-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}

.viewer-control-btn {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-control-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* ===== أزرار التحكم في الخريطة ===== */
.map-controls {
  position: fixed;
  right: 20px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.map-control-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.map-control-btn:hover {
  background: #f5f5f5;
  transform: scale(1.1);
}

/* ===== زر WhatsApp ===== */
.whatsapp-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  cursor: pointer;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s;
  z-index: 1000;
}

.whatsapp-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header {
    padding: 0 15px;
    height: 60px;
  }

  .logo {
    font-size: 18px;
  }

  .logo-icon {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  .filters-panel {
    left: 10px;
    top: 75px;
    width: 160px;
    padding: 15px;
  }

  .weather-widget {
    right: 10px;
    top: 75px;
    padding: 15px;
    min-width: 120px;
  }

  .weather-temp {
    font-size: 32px;
  }
}
/* Wrapper للزوم */
.building-image-wrapper {
    display: inline-block; /* عشان الزوم يشتغل صح */
}

/* Floor Plan Modal */
.floorplan-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    padding: 20px;
}

.floorplan-modal.active {
    display: flex;
}

.floorplan-content {
    background: white;
    border-radius: 20px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    position: relative;
    padding: 30px;
    text-align: center;
}

.floorplan-close {
    position: absolute;
    top: 15px; right: 15px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.floorplan-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.floorplan-image {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.floorplan-desc {
    margin-top: 20px;
    font-size: 16px;
    color: #666;
}

/* ===== Project Gallery ===== */
.project-gallery-section {
  margin-top: 30px;
}

/* الحاوية الرئيسية للصور */
.gallery {
  max-width: 85%;
  margin-top: 2rem;
  margin-left:20px ;
  display: grid;
  grid-template-columns: repeat(4, minmax(auto, 1fr));
  grid-gap: 2rem;
  padding: 0 2rem 2rem;
  align-items: start;
}

/* توزيع مختلف لكل صورة لتكوين شكل جميل */
.gallery > :nth-child(6n + 1) {
  grid-column: 1 / -1;
}

.gallery > :nth-child(6n + 2),
.gallery > :nth-child(6n + 3) {
  grid-column: span 2;
}

.gallery > :nth-child(6n + 4) {
  grid-column: span 3;
  grid-row: span 2;
}

.gallery > :nth-child(6n + 5),
.gallery > :nth-child(6n + 6) {
  margin-top: 2rem;
  margin-left: -4rem;
}

/* ===== العنصر الفردي للصور ===== */
.gallery-image {
  margin: 0;
  padding: 0;
  color: #000;
  overflow: hidden;
  opacity: 0;
  --duration: 1s;
  --ease: cubic-bezier(0.7, 0, 0.3, 1);
  transition: opacity var(--duration) linear;
  position: relative;
}

/* الخلفية الورقية الخفيفة خلف الصورة */
.gallery-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #daeaf2;
  transform: scaleX(0);
  transform-origin: top left;
  transition: transform var(--duration) var(--ease);
}

/* الصورة نفسها */
.gallery-image img {
  display: block;
  width: 100%;
  transition: clip-path var(--duration) var(--ease);
  transition-delay: var(--duration);
  clip-path: polygon(
    0 0,
    0% 0,
    0% 100%,
    0 100%
  );
}

/* الكابشن يظهر عند hover بعد ما الصورة تبقى مرئية */
.gallery-image figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  padding: 1rem;
  text-align: center;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s, transform 0.3s;
  text-shadow: 0 1px 0 #fff;
}



/* الصور الفردية (odd) تبدأ من الجهة الأخرى للـ clip-path */
.gallery-image:nth-child(odd) {
  transition-delay: 0.2s;
}

.gallery-image:nth-child(odd)::before {
  transform-origin: top right;
}

.gallery-image:nth-child(odd) img {
  clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%);
}

/* لما العنصر يكون داخل الـ viewport (IntersectionObserver يحط data-viewport-position="0") */
.gallery-image[data-viewport-position="0"] {
  opacity: 1;
}

.gallery-image[data-viewport-position="0"]::before {
  transform: scaleX(1);
}

.gallery-image[data-viewport-position="0"] img {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Responsive */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    padding: 0 1rem 1.5rem;
    grid-gap: 1.2rem;
  }

  .gallery > * {
    grid-column: span 1 !important;
    margin-left: 0 !important;
  }
}


@media (max-width:400px){
  .filters-panel{
    width: 125px;
  }
   .project-popup{
    z-index: 100000 !important;
  }
}

@media (max-width:380px){
  .filters-panel{
    display: none !important;
  }
   .project-popup{
    z-index: 100000 !important;
  }
  .building-viewer{
     display: none !important;
  }
}

