/* Shahr Atieh Projects Map - Clean Layout */

* {
  box-sizing: border-box;
}

/* Main Wrapper */
.shahr-atieh-map-wrapper {
  display: flex;
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  background: #f1f5f9;
}

/* Sidebar */
.shahr-atieh-sidebar {
  width: 320px;
  background: #fff;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e2e8f0;
  z-index: 1000;
  position: relative;
}

/* Filters */
.shahr-atieh-filters {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: #334155;
  direction: rtl;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Project List */
.shahr-atieh-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.project-item {
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.project-item:hover {
  background: #f1f5f9;
}

.project-item.active {
  background: #eff6ff;
  border-color: #3b82f6;
}

.project-item-title {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
  margin-bottom: 6px;
}

.project-item-image {
  width: 100%;
  height: 110px;
  overflow: hidden;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #f1f5f9;
}

.project-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.project-city {
  color: #64748b;
}

.project-status {
  padding: 2px 8px;
  border-radius: 20px;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
  font-size: 14px;
}

/* Map Container */
.shahr-atieh-map-container {
  flex: 1;
  position: relative;
  z-index: 1;
}

#shahr-atieh-map {
  width: 100%;
  height: 100%;
}

/* Detail Panel */
.shahr-atieh-detail {
  position: absolute;
  top: 0;
  left: 0;
  width: 400px;
  height: 100%;
  background: #fff;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 200;
  overflow-y: auto;
}

.shahr-atieh-detail.open {
  transform: translateX(0);
}

.close-detail,
.share-btn {
  position: absolute;
  top: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.close-detail {
  left: 12px;
}

.share-btn {
  right: 12px;
}

.close-detail:hover,
.share-btn:hover {
  background: #fff;
  color: #334155;
}

/* Share Full Button */
.btn-share-full {
  width: 100%;
  padding: 14px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.2s;
}

.btn-share-full:hover {
  background: #059669;
}

/* Share Modal */
.share-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.share-modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  padding: 20px;
  direction: rtl;
}

.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.share-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.share-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: #64748b;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.share-option:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.share-icon {
  font-size: 24px;
}

.share-link-box {
  margin-top: 12px;
}

.share-link-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  direction: ltr;
  text-align: left;
}

/* Featured Image */
.project-featured-image {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
}

.project-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Project Content */
.project-content {
  padding: 20px;
}

.shahr-atieh-detail h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

/* Meta Tags */
.project-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.city-tag {
  background: #f1f5f9;
  color: #475569;
}

.type-tag {
  background: #e0f2fe;
  color: #0369a1;
}

.status-tag {
  color: #fff;
}

/* Description */
.project-description {
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
}

/* Specifications Box */
.project-specs {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0;
}

.specs-title {
  font-size: 14px;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 10px;
}

.specs-content {
  font-size: 13px;
  line-height: 1.8;
  color: #334155;
}

/* Gallery */
.project-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.project-gallery img {
  width: 200px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Project Info */
.project-info {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: #64748b;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.info-value {
  font-size: 13px;
  color: #334155;
  line-height: 1.5;
}

/* Address Box */
.project-info {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.project-info .info-label {
  color: #a16207;
  font-weight: 600;
  font-size: 13px;
}

.status-badge {
  padding: 2px 10px;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
}

/* Route Section */
.route-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.route-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.travel-modes {
  display: flex;
  gap: 6px;
}

.travel-mode {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.travel-mode:hover {
  background: #f1f5f9;
}

.travel-mode.active {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}

.route-info {
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 12px;
  min-height: 60px;
}

.route-placeholder {
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
}

.route-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: #334155;
}

.location-buttons {
  display: flex;
  gap: 8px;
}

.btn-location {
  flex: 1;
  padding: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-location:hover {
  background: #f1f5f9;
}

.btn-location.secondary {
  background: #f8fafc;
}

/* View Project Button */
.btn-view-project {
  display: block;
  width: 100%;
  padding: 14px;
  background: #3b82f6;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.btn-view-project:hover {
  background: #2563eb;
}

/* Leaflet Overrides */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #334155 !important;
  font-size: 18px !important;
}

.leaflet-control-zoom a:hover {
  background: #f1f5f9 !important;
}

.leaflet-routing-container {
  display: none !important;
}

.custom-marker,
.marker-cluster-custom {
  background: transparent !important;
  border: none !important;
}

/* House Marker */
.marker-house {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  border: 2px solid #fff;
}

.marker-house svg {
  transform: rotate(45deg);
}

/* User Marker */
.marker-user {
  width: 28px;
  height: 28px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 3px solid #fff;
}

/* Scrollbar */
.shahr-atieh-list::-webkit-scrollbar,
.shahr-atieh-detail::-webkit-scrollbar {
  width: 6px;
}

.shahr-atieh-list::-webkit-scrollbar-track,
.shahr-atieh-detail::-webkit-scrollbar-track {
  background: transparent;
}

.shahr-atieh-list::-webkit-scrollbar-thumb,
.shahr-atieh-detail::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* Error Message */
.shahr-atieh-error,
.map-error {
  padding: 40px 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  color: #991b1b;
  text-align: center;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .shahr-atieh-map-wrapper {
    flex-direction: column;
    height: 100vh !important;
  }
  
  .shahr-atieh-sidebar {
    width: 100%;
    height: auto;
    max-height: 120px;
    min-height: 120px;
    border-left: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .shahr-atieh-list {
    display: none;
  }
  
  .shahr-atieh-filters {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 8px;
    gap: 6px;
  }
  
  .filter-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .filter-select {
    width: calc(33.33% - 4px);
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .shahr-atieh-map-container {
    flex: 1;
    height: auto !important;
  }
  
  /* Mobile Drawer */
  .shahr-atieh-detail {
    position: fixed;
    width: 100%;
    height: 75vh;
    max-height: 75vh;
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 1100;
  }
  
  .shahr-atieh-detail.open {
    transform: translateY(0);
  }

  .shahr-atieh-detail.minimized {
    transform: translateY(calc(100% - 60px));
  }

  /* Drawer Handle */
  .drawer-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    background: #fff;
    border-radius: 20px 20px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .drawer-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
  }

  .drawer-handle-text {
    position: absolute;
    font-size: 12px;
    color: #64748b;
    right: 16px;
  }

  .project-content {
    padding: 12px 16px;
    max-height: calc(75vh - 60px);
    overflow-y: auto;
  }

  .project-content h2 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .project-meta-tags {
    flex-wrap: wrap;
    gap: 6px;
  }

  .meta-tag {
    font-size: 11px;
    padding: 4px 8px;
  }

  .project-featured-image {
    max-height: 150px;
    margin: -12px -16px 12px -16px;
    border-radius: 20px 20px 0 0;
  }

  .project-featured-image img {
    border-radius: 20px 20px 0 0;
  }

  .project-specs,
  .project-info {
    padding: 10px;
    font-size: 12px;
  }

  .route-section {
    padding: 12px;
  }

  .travel-modes {
    flex-wrap: wrap;
    gap: 6px;
  }

  .travel-mode {
    font-size: 12px;
    padding: 6px 10px;
  }

  .location-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .btn-location {
    width: 100%;
    font-size: 13px;
  }

  .close-detail {
    top: 8px;
    right: 12px;
    width: 30px;
    height: 30px;
  }

  .share-btn {
    top: 8px;
    left: 12px;
    width: 30px;
    height: 30px;
  }
}
