/* styles.css - Interactive Map */

/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f4f4f4;
  color: #333;
}

#app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/***************************
 * Map Area
 ***************************/
#map-container {
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  background: #222;
}

#map-svg {
  width: 100%;
  height: 100%;
  transform-origin: 0 0; /* top-left, matches translate math */
  transition: transform 0.6s ease;
}

/* Polygon styles */
.faction {
  fill: rgba(255, 255, 255, 0); /* Invisible fill */
  stroke: rgba(255, 255, 255, 0); /* Invisible border */
  cursor: pointer;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.faction:hover,
.faction:focus {
  stroke: #ffd900;
  stroke-width: 2;
  fill: rgba(255, 217, 0, 0.15);
}

/* Reset Button */
#reset-btn {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 8px 10px;
  font-size: 20px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  color: #222;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 10;
}

#reset-btn:hover {
  background: #ffd900;
}

/***************************
 * Info Panel
 ***************************/
#info-panel {
  width: 0;
  max-width: none;
  background: #fff;
  padding: 0 0; /* no padding while closed */
  overflow-y: auto;
  transition: width 0.5s ease, padding 0.5s ease;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.1);
  pointer-events: none; /* ignore clicks when closed */
}

#info-panel.open {
  width: 50%;
  padding: 25px 30px;
  pointer-events: auto;
}

@media (max-width: 900px) {
  #info-panel.open {
    width: 70%;
  }
}

@media (max-width: 600px) {
  #info-panel.open {
    width: 100%;
  }
}

#info-panel h2 {
  margin-bottom: 10px;
  font-size: 26px;
  color: #222;
}

#info-panel p {
  margin-bottom: 15px;
  line-height: 1.4em;
}

#info-panel ul {
  list-style: none;
  padding-left: 0;
}

#info-panel li {
  margin-bottom: 8px;
}

#info-panel li strong {
  color: #555;
}

#draw-btn,
#finish-draw {
  position: absolute;
  top: 15px;
  left: 60px; /* will adjust for finish later */
  padding: 6px 8px;
  font-size: 18px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.3s;
  z-index: 10;
}

#draw-btn:hover,
#finish-draw:hover {
  background: #90ee90;
}

#finish-draw {
  left: 105px;
  display: none;
}

#faction-select {
  position: absolute;
  top: 15px;
  left: 150px;
  padding: 5px 8px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

#toggle-page {
  display: block;
  margin: 20px auto 0 auto;
  padding: 6px 14px;
  font-size: 22px;
  border: none;
  background: #ffd900;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}
#toggle-page:hover {
  background: #e0c000;
}

/* Development tools visibility */
.dev-tool {
  display: none;
}
body.dev .dev-tool {
  display: inline-block;
} 