/**
 * SD Directory Map Styles
 *
 * @package    SD_Directory
 * @subpackage SD_Directory/public/css
 */

/* Map Wrapper */
.sd-map-wrapper {
  position: relative;
  width: 100%;
  font-family: 'Karla', sans-serif;
}

.sd-map-container {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.sd-map-container.sd-map-grabbing {
  cursor: grabbing;
}

.sd-map-container.sd-map-grabbing svg {
  cursor: grabbing;
}

.sd-map-container svg {
  display: block;
  width: 100%;
  height: auto;
}

/* State paths */
.sd-map-container svg #features path {
  transition: fill 0.3s ease, opacity 0.2s ease;
  cursor: default;
}

.sd-map-container svg #features path:hover {
  opacity: 0.85;
}

/* Pin styles */
.sd-map-pin {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sd-map-pin:hover {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.sd-map-pin:hover image {
  opacity: 0.85;
}

/* Info Window */
.sd-map-info-window {
  position: absolute;
  z-index: 100;
  width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transform: translate(12px, -50%);
  animation: sdMapInfoFadeIn 0.2s ease;
}

.sd-map-info-window.sd-map-info-left {
  transform: translate(calc(-100% - 12px), -50%);
}

.sd-map-info-window.sd-map-info-top {
  transform: translate(12px, calc(-100% + 20px));
}

.sd-map-info-window.sd-map-info-left.sd-map-info-top {
  transform: translate(calc(-100% - 12px), calc(-100% + 20px));
}

@keyframes sdMapInfoFadeIn {
  from {
    opacity: 0;
    transform: translate(12px, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(12px, -50%) scale(1);
  }
}

/* Close Button */
.sd-map-info-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  transition: background 0.2s ease;
}

.sd-map-info-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Info Content */
.sd-map-info-content {
  display: flex;
  flex-direction: column;
}

.sd-map-info-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  background-color: #f5f5f5;
}

.sd-map-info-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sd-map-info-title {
  margin: 14px 16px 6px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Karla', sans-serif;
  line-height: 1.3;
  color: #1a1a1a;
}

.sd-map-info-desc {
  margin: 0 16px 12px;
  font-size: 13px;
  font-family: 'Karla', sans-serif;
  line-height: 1.5;
  color: #555;
}

.sd-map-info-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 16px 14px;
}

.sd-map-info-watch {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  font-family: 'Karla', sans-serif !important;
  color: #fff !important;
  background: #1a1a1a !important;
  border: none !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: background 0.2s ease !important;
  white-space: nowrap !important;
}

.sd-map-info-watch:hover {
  background: #333 !important;
}

.sd-map-info-link {
  display: inline-flex;
  align-items: center;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Karla', sans-serif;
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.sd-map-info-link:hover {
  color: #FFC002;
}

/* Video Modal / Lightbox */
.sd-video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sd-video-modal.sd-video-modal-open {
  opacity: 1;
}

.sd-video-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
}

.sd-video-modal-container {
  position: relative;
  width: 90%;
  max-width: 960px;
  z-index: 1;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.sd-video-modal-open .sd-video-modal-container {
  transform: scale(1);
}

.sd-video-modal-close {
  position: absolute !important;
  top: -44px !important;
  right: 0 !important;
  width: 36px !important;
  height: 36px !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  border-radius: 50% !important;
  font-size: 22px !important;
  line-height: 36px !important;
  text-align: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: background 0.2s ease !important;
  -webkit-backdrop-filter: blur(4px) !important;
  backdrop-filter: blur(4px) !important;
}

.sd-video-modal-close:hover {
  background: rgba(255, 255, 255, 0.3) !important;
}

.sd-video-modal-player {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.sd-video-modal-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* View Toggle */
.sd-map-view-toggle {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  margin: 16px 0;
  z-index: 50;
}

.sd-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  border: none;
  background: #e8e8e8;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.sd-view-btn:first-child {
  border-radius: 8px 0 0 8px;
}

.sd-view-btn:last-child {
  border-radius: 0 8px 8px 0;
}

.sd-view-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  filter: brightness(0);
  opacity: 0.5;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.sd-view-btn.active {
  background: #1e1e1e;
}

.sd-view-btn.active img {
  filter: brightness(0) saturate(100%) invert(73%) sepia(97%) saturate(491%) hue-rotate(358deg) brightness(103%) contrast(104%);
  opacity: 1;
}

.sd-view-btn:hover:not(.active) {
  background: #d4d4d4;
}

/* List View */
.sd-map-list-view {
  width: 100%;
  margin-top: 20px;
}

.sd-map-list-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sd-map-list-item {
  display: flex;
  gap: 20px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.sd-map-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.sd-map-list-image {
  width: 200px;
  min-height: 160px;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #f5f5f5;
}

.sd-map-list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sd-map-list-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px 16px 0;
  flex: 1;
  min-width: 0;
}

.sd-map-list-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.sd-map-list-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 500;
  font-family: 'Karla', sans-serif;
  line-height: 1.3;
  color: #1a1a1a;
}

.sd-map-list-desc {
  margin: 0 0 12px;
  font-size: 14px;
  font-family: 'Karla', sans-serif;
  line-height: 1.6;
  color: #555;
}

.sd-map-list-item .sd-content-link {
  margin-top: auto;
}

.sd-map-list-item:hover .sd-content-link {
  color: #FFC002;
}

.sd-map-list-item:hover .sd-content-link::after {
  transform: translateX(3px);
}

/* Grid View */
.sd-map-grid-view {
  width: 100%;
}

.sd-map-grid-view .sd-content-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* No Results */
.sd-map-no-results {
  text-align: center;
  padding: 60px 20px;
  font-size: 16px;
  font-family: 'Karla', sans-serif;
  color: #666;
  margin: 0;
}

/* List/Grid Pagination */
.sd-map-list-pagination,
.sd-map-grid-pagination {
  margin-top: 30px;
  margin-bottom: 10px;
}

/* Zoom Controls */
.sd-map-zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
}

.sd-map-zoom-controls button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  background: rgba(30, 30, 30, 0.85);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, opacity 0.2s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.sd-map-zoom-controls button:hover:not(:disabled) {
  background: rgba(30, 30, 30, 1);
}

.sd-map-zoom-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Search & Filter Bar (base styles inherited from sd-dropdown-search-container / sd-destination-select / sd-search-button) */
.sd-map-search-container {
  margin-bottom: 20px;
}

.sd-map-search-input {
  border: none !important;
  border-radius: 10px !important;
  height: 48px;
  background-image: url('../images/search-icon.svg');
  background-repeat: no-repeat;
  background-position: 16px center;
  background-size: 16px 16px;
  padding-left: 42px !important;
  box-sizing: border-box;
  background-color: #F5F5F5;
}

.sd-map-filter-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background-color: #ffcac3 !important;
  border-bottom: 4px solid #d4a49e !important;
  padding: 12px 24px !important;
}

.sd-map-filter-button:hover {
  background-color: #f0b5ad !important;
}

.sd-map-filter-button.active {
  background-color: #ff9e93 !important;
}

.sd-map-filter-icon {
  width: 16px;
  height: auto;
  display: block;
}

/* Filter Panel */
.sd-map-filter-panel {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.sd-map-filter-group h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Karla', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #333;
}

.sd-map-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sd-map-filter-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 14px;
  font-family: 'Karla', sans-serif;
  color: #333;
  background-color: #f5f5f5;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

.sd-map-filter-options label:hover {
  background-color: #ebebeb;
}

.sd-map-filter-options input[type="checkbox"] {
  display: none;
}

.sd-map-filter-options input[type="checkbox"]:checked + span {
  color: #000;
  font-weight: 600;
}

.sd-map-filter-options label:has(input:checked) {
  background-color: #ffc002;
  color: #000;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .sd-map-filter-panel {
    flex-direction: column;
    gap: 20px;
    padding: 16px 18px;
  }

  .sd-map-search-container {
    flex-wrap: wrap;
    flex-direction: row !important;
    padding: 0 20px;
  }

  .sd-map-search-container .sd-map-search-input {
    width: 100%;
    flex: 1 1 100%;
  }

  .sd-map-filter-button {
    width: auto !important;
    flex: 1;
    box-sizing: border-box;
  }

  .sd-map-search-container .sd-map-search-button {
    width: auto !important;
    flex: 1;
  }

  .sd-map-view-toggle {
    margin: 0 20px;
  }

  .sd-map-list-view {
    padding: 0 20px;
  }

  .sd-map-grid-view {
    padding: 0 20px;
  }

  .sd-map-list-item {
    flex-direction: column;
    gap: 0;
  }

  .sd-map-list-image {
    width: 100%;
    height: 180px;
    min-height: auto;
  }

  .sd-map-list-details {
    padding: 16px;
  }

  .sd-map-list-title {
    font-size: 18px;
  }

  .sd-map-grid-view .sd-content-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .sd-map-info-window {
    width: 240px;
  }

  .sd-map-info-image {
    height: 130px;
  }

  .sd-map-info-title {
    font-size: 14px;
    margin: 10px 12px 4px;
  }

  .sd-map-info-desc {
    font-size: 12px;
    margin: 0 12px 10px;
  }

  .sd-map-info-actions {
    margin: 0 12px 10px;
    gap: 10px;
  }

  .sd-map-info-watch {
    font-size: 12px;
    padding: 6px 12px;
  }

  .sd-map-info-link {
    font-size: 13px;
  }
}

@media screen and (max-width: 480px) {
  .sd-map-info-window {
    width: 200px;
  }

  .sd-map-info-image {
    height: 110px;
  }

  .sd-map-info-close {
    width: 24px;
    height: 24px;
    font-size: 15px;
    line-height: 24px;
  }

  .sd-map-grid-view .sd-content-grid {
    grid-template-columns: 1fr;
  }

  .sd-map-list-image {
    height: 150px;
  }

  .sd-view-btn[data-view="grid"] {
    display: none;
  }

  .sd-view-btn[data-view="list"] {
    border-radius: 0 8px 8px 0;
  }
}
