/**
 * @file
 * Styles for Know Your MP map.
 */

.know-your-mp-block {
  max-width: 1400px;
}

/* Custom width utilities for 70/30 split */
@media (min-width: 768px) {
  .md\:w-7\/10 {
    width: 70%;
  }

  .md\:w-3\/10 {
    width: 30%;
  }
}

.know-your-mp-block .know-your-mp-map-shell {
  width: 100%;
}

.know-your-mp-help-mobile {
  display: inline;
}

.know-your-mp-help-desktop {
  display: none;
}

@media (min-width: 1024px) {
  .know-your-mp-help-mobile {
    display: none;
  }

  .know-your-mp-help-desktop {
    display: inline;
  }
}

.know-your-mp-block .map-container {
  min-height: 400px;
}

.know-your-mp-block .map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.know-your-mp-block #bangladesh-map-svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.know-your-mp-block #bangladesh-map-svg svg {
  width: 100% !important;
  height: auto !important;
}

@media (max-width: 767px) {
  .know-your-mp-block {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .know-your-mp-block .know-your-mp-map-card {
    padding: 0.5rem;
    border-radius: 0;
  }

  .know-your-mp-block .map-container {
    min-height: 0;
  }
}

.know-your-mp-block svg .constituency-label,
.know-your-mp-block svg text.constituency-label {
  display: none !important;
}

.know-your-mp-block svg polygon:not([data-name])[fill="#1f3f3f"],
.know-your-mp-block svg path:not([data-name])[fill="#1f3f3f"] {
  display: none !important;
}

.know-your-mp-block svg [data-name]:not([data-name^="layer_"]) {
  fill: #e2e8f0;
  stroke: #334155 !important;
  stroke-width: 1 !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

.know-your-mp-block svg [data-name]:not([data-name^="layer_"]):hover,
.know-your-mp-block svg [data-name]:not([data-name^="layer_"]):focus {
  fill: #bfdbfe !important;
  stroke: #0284c7 !important;
  stroke-width: 1.5 !important;
  outline: none;
}

.know-your-mp-block svg [data-name].is-selected {
  fill: #93c5fd !important;
  stroke: #1d4ed8 !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 0 4px rgba(29, 78, 216, 0.6)) !important;
}

[data-mp-seat-name] {
  display: inline-block;
  background-color: #dbeafe !important;
  border-left: 4px solid #1d4ed8 !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 0.25rem !important;
  color: #1d4ed8 !important;
  font-weight: 600 !important;
  margin: 0.5rem 0 !important;
}

@keyframes pulse {
  0% {
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 4px rgba(29, 78, 216, 0.6));
  }
  50% {
    stroke-width: 3.5px;
    filter: drop-shadow(0 0 8px rgba(29, 78, 216, 0.9));
  }
  100% {
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 4px rgba(29, 78, 216, 0.6));
  }
}

.know-your-mp-block svg [data-name].party-bnp,
.know-your-mp-block svg [data-name].party-jamat {
  /* stroke removed */
}

.know-your-mp-tooltip {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.know-your-mp-tooltip.hidden {
  display: none;
}

/* Desktop Side Panel Styles */
.know-your-mp-panel {
  border: 1px solid #e5e7eb;
  border-radius: 0.125rem;
  background-color: #ffffff;
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* Mobile Slide-in Panel Styles */
.know-your-mp-panel-mobile {
  border-radius: 0;
  background-color: #ffffff;
  will-change: transform;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
}

.know-your-mp-panel-mobile.hidden {
  display: none !important;
}

.know-your-mp-panel-mobile.translate-x-0 {
  transform: translateX(0);
}

.know-your-mp-panel-mobile.translate-x-full {
  transform: translateX(100%);
}

.know-your-mp-panel-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 40;
  transition: opacity 0.3s ease;
}

.know-your-mp-panel-overlay.hidden {
  display: none !important;
}

@media (max-width: 767px) {
  .know-your-mp-panel {
    display: none !important;
  }
}

.know-your-mp-panel-body {
  overflow: visible;
}

/* Desktop panel - show all content */
@media (min-width: 768px) {
  .know-your-mp-panel {
    overflow: visible;
    max-height: none;
  }

  .know-your-mp-panel-body {
    overflow: visible;
    max-height: none;
    flex-wrap: wrap;
  }
}
/* Ministers Section Styles */
.know-your-ministers-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (min-width: 640px) {
  .know-your-ministers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 768px) {
  .know-your-ministers-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

.know-your-minister-card {
  transition: all 0.3s ease;
}

.know-your-minister-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.know-your-minister-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(15, 23, 42, 0.35);
  animation: fadeIn 0.3s ease;
}

.know-your-minister-modal.hidden {
  display: none !important;
}

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

.know-your-minister-modal-content {
  width: min(92vw, 900px);
  max-height: 88vh;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  animation: slideUp 0.3s ease;
}

.know-your-minister-modal-close {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #ffffff;
  color: #0f172a;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.know-your-minister-modal-close:hover {
  background: #f8fafc;
}

[data-minister-photo] {
  min-height: 12rem;
  display: block;
  background-color: #f3f4f6;
}

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

.line-clamp-2 {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.aspect-square {
  aspect-ratio: 1;
}

/* Marker animations */
@keyframes markerPulse {
  0% {
    r: 28px;
    opacity: 1;
    stroke-width: 3px;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.8));
  }
  50% {
    r: 45px;
    opacity: 0.5;
    stroke-width: 2px;
    filter: drop-shadow(0 0 15px rgba(14, 165, 233, 0.95));
  }
  100% {
    r: 28px;
    opacity: 1;
    stroke-width: 3px;
    filter: drop-shadow(0 0 8px rgba(14, 165, 233, 0.8));
  }
}

/* Panel content animation */
.panel-content-animate {
  animation: panelSlideIn 0.4s ease-out;
}

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

/* Individual panel elements animation */
[data-mp-details] {
  animation: detailsFadeIn 0.5s ease-out 0.1s both;
}

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