/* Sri Lanka Map - Frontend Styles */

* { box-sizing: border-box; }

.sl-map-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* SVG district images */
.sl-map-container svg image {
  pointer-events: none;
  transition: transform 0.3s ease;
}

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

/* District paths */
.sl-map-container path {
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Only apply fill colors to paths WITHOUT images */
.sl-map-container path:not([data-has-image]) {
  fill: #2196b6;
}

.sl-map-container path:not([data-has-image]):hover {
  fill: #1565c0;
}

.sl-map-container path:not([data-has-image]).sl-active {
  fill: #e65100;
}

/* Hide circles/points from original SVG */
.sl-map-container circle {
  display: none;
}

/* Hint text */
.sl-hint {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-top: 10px;
  font-style: italic;
}

/* Overlay backdrop */
.sl-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.sl-overlay.sl-open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Popup box */
.sl-popup {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

/* Image area */
.sl-popup-img-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #b3dff5, #64b5d9);
}

.sl-popup-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sl-popup-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

/* Close button */
.sl-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  line-height: 1;
  transition: background 0.2s;
}

.sl-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Popup body */
.sl-popup-body {
  padding: 24px 28px 30px;
}

.sl-popup-body h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.sl-popup-body p {
  font-size: 15px;
  color: #555;
  line-height: 1.7;
  margin: 0 0 20px 0;
}

.sl-popup-btn {
  display: inline-block;
  padding: 12px 28px;
  background: #2196b6;
  color: #fff !important;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.sl-popup-btn:hover {
  background: #1565c0;
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 600px) {
  .sl-popup {
    max-width: 95%;
  }
  
  .sl-popup-img-wrap {
    height: 180px;
  }
  
  .sl-popup-img-placeholder {
    font-size: 60px;
  }
  
  .sl-popup-body {
    padding: 20px 24px 26px;
  }
  
  .sl-popup-body h2 {
    font-size: 20px;
  }
  
  .sl-popup-body p {
    font-size: 14px;
  }
}

/* Background control */
.sl-map-container.sl-no-background {
  background: transparent !important;
}

.sl-map-container.sl-no-background svg {
  background: transparent !important;
}

/* ================================
   NEW FEATURES - Version 1.1.0+
   ================================ */

/* 3D Hover Effect */
.sl-map-container.sl-3d-enabled path {
    transition: all 0.3s ease;
}

.sl-map-container.sl-3d-enabled path:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

/* SVG images - will be handled with JavaScript for 3D effect */
.sl-map-container svg image {
    transition: all 0.3s ease;
}

.sl-map-container svg image.sl-image-hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

/* District Labels */
.sl-district-label {
    position: absolute;
    pointer-events: none;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8),
                 0 0 8px rgba(255, 255, 255, 0.6);
    user-select: none;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    z-index: 10;
}

.sl-labels-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* SVG defs (clipPaths, etc.) */
.sl-map-container defs {
    display: block;
}

/* Responsive Labels */
@media (max-width: 600px) {
    .sl-district-label {
        font-size: 10px !important;
    }
}
