/* Scope everything to the wrapper to avoid conflicts */
.rd-muskat-wrapper {
  font-family: "Inter Tight upravene", sans-serif !important;
  background-color: #f2f2f2;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #1c1d21;
  width: 100%;
  box-sizing: border-box;
}

.rd-muskat-wrapper * {
  box-sizing: border-box;
}

.rd-muskat-wrapper .main-heading {
  /* font-family: "Inter", sans-serif; */
  font-weight: 600;
  font-size: 70px;
  color: #7d9e4e;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 40px;
  line-height: 1.2;
}

.rd-muskat-wrapper .map-container {
  position: relative;
  width: 100%;
  max-width: 1600px;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  margin-bottom: 120px;
}

.rd-muskat-wrapper .map-bg {
  width: 100%;
  height: auto;
  display: block;
}

.rd-muskat-wrapper .map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.rd-muskat-wrapper .map-overlay polygon,
.rd-muskat-wrapper .map-overlay polyline {
  fill: transparent;
  stroke-width: 3px;
  transition: all 0.3s ease;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
}

/* Status Styles */
.rd-muskat-wrapper .status-free {
  stroke: #7D9E4E;
}
.rd-muskat-wrapper .status-reserved {
  stroke: #FF9627;
}
.rd-muskat-wrapper .status-unavailable {
  stroke: #545765; /* Changed to grey */
}
.rd-muskat-wrapper .status-sold {
  stroke: #F22B19; /* New sold status - red */
}

/* Hover & Active Effects */
.rd-muskat-wrapper .status-free:hover,
.rd-muskat-wrapper .status-free.active {
  fill: rgb(125, 158, 78, 0.6);
}
.rd-muskat-wrapper .status-reserved:hover,
.rd-muskat-wrapper .status-reserved.active {
  fill: rgb(255, 150, 39, 0.6);
}
.rd-muskat-wrapper .status-unavailable:hover,
.rd-muskat-wrapper .status-unavailable.active {
  fill: rgba(84, 87, 101, 0.6); /* Changed to grey */
}
.rd-muskat-wrapper .status-sold:hover,
.rd-muskat-wrapper .status-sold.active {
  fill: rgb(242, 43, 25, 0.6); /* New sold status - red */
}

/* Tooltip */
.rd-muskat-wrapper .map-tooltip {
  position: absolute;
  background: #1c1d21;
  color: #fff;
  padding: 40px;
  border-radius: 20px;
  pointer-events: none;
  display: none;
  z-index: 100;
  font-size: 20px;
  line-height: 1.5;
  box-shadow: none;
  width: 325px;
  text-align: left;
}

.rd-muskat-wrapper .map-tooltip h3 {
  margin: 0 0 30px 0;
  font-size: 20px;
  border-bottom: none;
  padding-bottom: 0;
  font-weight: 400;
  line-height: 1.5;
  color: #fff;
}

.rd-muskat-wrapper .map-tooltip p {
  margin: 0;
  color: #fff;
}

/* Table Styles */
.rd-muskat-wrapper .table-container {
  width: 100%;
  max-width: 1250px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  margin-bottom: 40px;
}

.rd-muskat-wrapper table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  border: none;
  margin: 0;
}

.rd-muskat-wrapper th,
.rd-muskat-wrapper td {
  padding: 15px 10px;
  border: 1px solid #e6e6e8;
  font-size: 14px;
  vertical-align: middle;
  width: 140px;
}

.rd-muskat-wrapper th {
  background-color: #7D9E4E;
  font-weight: 450;
  color: #f2f2f2;
  text-transform: uppercase;
  border-block-start: 1px solid #e6e6e8 !important;
  
  
}

.rd-muskat-wrapper tr {
  cursor: pointer;
  transition: background-color 0.2s;
  background: transparent;
}

.rd-muskat-wrapper tr:hover {
  background-color: rgba(125, 158, 78, 0.6);
}

.rd-muskat-wrapper tr.active-row {
  background-color: rgba(125, 158, 78, 0.8);
  border-left: none;
}

/* Detail View Styles */
.rd-muskat-wrapper .btn-main {
  background-color: #7D9E4E;
  color: #f2f2f2;
  border: none;
  border-radius: 80px;
  padding: 15px 40px;
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-bottom: 120px;
  display: inline-block;
  text-decoration: none;
  line-height: normal;
}

.rd-muskat-wrapper .btn-main:hover {
  background-color: #6a8b40;
  color: #f2f2f2;
}

.rd-muskat-wrapper .detail-view {
  width: 100%;
  background: #e6e6e8;
  border-radius: 0;
  padding-left: 20px;
  padding-right: 20px;
  position: relative;
  display: none;
  margin-bottom: 40px;
}

/* Close button reset */
.rd-muskat-wrapper .close-icon-button {
  position: absolute;
  top: 21px;
  right: 16px;
  width: auto;
  height: auto;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  min-width: 0 !important;
  border-radius: 0 !important;
}

.rd-muskat-wrapper .close-icon {
  width: 10px;
  height: 10px;
  display: block;
}

.rd-muskat-wrapper .detail-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 60px;
}

.rd-muskat-wrapper .detail-view h2 {
  font-size: 30px;
  font-weight: 600;
  color: #1c1d21;
  margin-bottom: 30px;
  margin-top: 32px;
  text-align: center;
}

.rd-muskat-wrapper .detail-body {
  display: flex;
  gap: 40px;
  width: 100%;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 50px;
}

.rd-muskat-wrapper .detail-images {
  display: flex;
  gap: 40px;
}

.rd-muskat-wrapper .detail-placeholder {
  width: 350px;
  height: 304px;
  background-color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  /* border: 2px dashed #bbb; */
  border-radius: 8px;
}

.rd-muskat-wrapper .detail-info {
  color: #545765;
  font-feature-settings: "cv11" on;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: 30px;
  text-align: left;
}

.rd-muskat-wrapper .detail-info p {
  margin: 0;
}

.rd-muskat-wrapper .detail-info p.mb-space {
  margin-bottom: 12px;
}

.rd-muskat-wrapper .btn-download {
  display: inline-block;
  padding: 15px 40px;
  background-color: transparent;
  border: 1px solid #7d9e4e;
  color: #7d9e4e;
  border-radius: 80px;
  text-decoration: none;
  font-weight: 400;
  font-size: 20px;
  transition: all 0.3s;
}

.rd-muskat-wrapper .btn-download:hover {
  background-color: #7d9e4e;
  color: #f2f2f2;
}

/* Detail Modal Styles */
.rd-muskat-wrapper .detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.rd-muskat-wrapper .detail-view {
  width: auto;
  max-width: 95vw;
  background: #e6e6e8;
  border-radius: 12px;
  padding: 20px;
  padding-left: 40px;
  padding-right: 40px;
  position: relative;
  margin-bottom: 0;
  display: block;
  max-height: 90vh;
  overflow-y: auto;
}

.rd-muskat-wrapper .close-icon-button {
  position: absolute;
  top: 21px;
  right: 16px;
  width: auto;
  height: auto;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  min-width: 0 !important;
  border-radius: 0 !important;
}

@media (max-width: 1240px) {
  .rd-muskat-wrapper .main-heading {
    font-size: 32px;
    margin-top: 24px;
    margin-bottom: 24px;
  }

  .rd-muskat-wrapper .map-container {
    margin-bottom: 40px;
  }

  /* Disable map interactions on mobile */
  .rd-muskat-wrapper .map-overlay {
    pointer-events: none;
  }

  /* Allow table scrolling */
  .rd-muskat-wrapper .table-container {
    overflow-x: auto;
    margin-bottom: 40px;
    padding: 0 16px;
  }

  .rd-muskat-wrapper table {
    min-width: 800px; /* Ensure table is wide enough to scroll */
    margin-left: 16px;
    margin-right: 16px;
  }

  .rd-muskat-wrapper th,
  .rd-muskat-wrapper td {
    font-size: 14px;
    padding: 10px 8px;
  }

  .rd-muskat-wrapper .btn-main {
    margin-bottom: 40px;
    width: auto;
    padding: 12px 30px;
    font-size: 16px;
  }

  .rd-muskat-wrapper .map-tooltip {
    display: none !important;
  }

  .rd-muskat-wrapper .detail-modal {
      padding: 16px;
      align-items: stretch; /* Allow content to grow */
  }

  .rd-muskat-wrapper .detail-view {
    padding: 20px 16px;
    width: 100%;
    max-width: 100%;
    max-height: none; /* Let it grow */
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .rd-muskat-wrapper .detail-content {
    padding-bottom: 20px; /* Reduced bottom padding */
  }

  .rd-muskat-wrapper .detail-body {
    flex-direction: column;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 20px;
  }

  .rd-muskat-wrapper .detail-images {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Force side-by-side */
    gap: 10px;
    width: 100%;
  }

  .rd-muskat-wrapper .detail-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1; /* Square aspect ratio for mobile */
    min-width: 0;
  }

  .rd-muskat-wrapper .detail-info {
    width: 100%;
    font-size: 15px;
  }

  /* Label left, value right layout */
  .rd-muskat-wrapper .detail-info p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dcdcdc;
    padding: 8px 0;
    margin: 0;
  }

  /* Remove border from the last item and the spacer */
  .rd-muskat-wrapper .detail-info p:last-child,
  .rd-muskat-wrapper .detail-info p.mb-space {
    border-bottom: none;
  }

  .rd-muskat-wrapper .detail-info p.mb-space {
    display: none; /* Hide the spacer on mobile */
  }

  .rd-muskat-wrapper .detail-view h2 {
    font-size: 24px;
    margin-top: 10px;
    margin-bottom: 20px;
    text-align: center;
  }

  .rd-muskat-wrapper .btn-download {
    width: 100%; /* Full width button looks better at bottom */
    box-sizing: border-box;
    text-align: center;
    font-size: 16px;
    padding: 12px 0;
    margin-top: 10px;
  }
}
