/* ===== PI System Explorer — EVE UI Design ===== */

/* ── PI chain table base styles ── */
#pi-container {
  font-family: inherit;
  position: relative;
  padding-bottom: 300px;
}

ul { list-style: none; margin: 0; padding: 0; display: block; }
a, a:link { text-decoration: none; }

td {
  padding: 4px;
  text-align: center;
  border: 1px solid #111;
  border-width: 1px 0;
  color: var(--eve-text);
}

tr:last-child td { border-bottom-width: 0; }

tr.header td {
  padding: 10px 4px;
  font-size: 1.5em;
  font-weight: 200;
  color: var(--eve-text-dim);
}

tr.header td i {
  font-size: .4em;
  font-weight: 200;
  font-style: normal;
}

.items li { margin: 5px 0; color: var(--eve-text); }
.items li.current span { text-shadow: 0 0 8px #79cef4; }
.arrows li { margin: 5px 0; color: #2a3c40; }

.items li span {
  white-space: nowrap;
  cursor: pointer;
  padding: 1px 4px;
  color: var(--eve-text);
}

.items li span.dim { color: var(--eve-text); }

tr.footer { display: none; }

#canvas {
  z-index: 1;
  display: block;
  position: absolute;
  left: 0; top: 0;
  background-color: transparent;
}

#pi {
  z-index: 2;
  border-collapse: collapse;
  position: relative;
  left: 0; top: 0;
}

#planets li img {
  width: 80px;
  height: 80px;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 4px;
}

#planets li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}

@media screen and (max-width: 768px) {
  #pi-container {
    padding-bottom: 100px;
    overflow-x: auto;
  }
  table#pi {
    display: block;
    width: 100%;
    font-size: 0.8rem;
  }
  #planets li img {
    width: 40px;
    height: 40px;
  }
  .items li span { white-space: normal; }
  tr.header td { font-size: 1em; }
}

/* ── Search bar heading ── */
#pi-container > h2 {
  color: var(--eve-accent);
  font-weight: 300;
  font-size: 1.2em;
  margin-bottom: 10px;
  text-align: center;
  position: relative;
  font-family: inherit;
  letter-spacing: 0.08em;
}

/* ── Search input ── */
#pi-search-bar {
  margin-top: 20px;
  text-align: center;
  position: relative;
}

#search-input {
  padding: 9px 14px;
  width: 300px;
  background: var(--eve-bg);
  border: 1px solid #2a4a50;
  color: var(--eve-text);
  font-size: 13px;
  letter-spacing: 0.04em;
  outline: none;
  border-radius: 0;
  font-family: inherit;
  transition: border-color 0.2s;
}

#search-input:focus {
  border-color: var(--eve-accent);
}

#search-input::placeholder { color: #4e6b70; }

/* ── Search dropdown ── */
.eve-search-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--eve-panel-alt);
  border: 1px solid var(--eve-border);
  border-top: 2px solid var(--eve-accent-dim);
  width: 300px;
  margin-top: 4px;
  z-index: 999;
  font-family: inherit;
  text-align: left;
  color: var(--eve-text-dim);
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  letter-spacing: 0.03em;
}

.eve-search-dropdown div {
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid #141f22;
  transition: background 0.15s, color 0.15s;
}

.eve-search-dropdown div:hover {
  background: #162024;
  color: var(--eve-accent);
}

.eve-search-dropdown div:last-child { border-bottom: none; }

/* ── System card (inline search result) ── */
.system-card {
  background: var(--eve-panel);
  border: 1px solid var(--eve-border);
  border-top: 2px solid var(--eve-accent-dim);
  padding: 22px 24px;
  color: var(--eve-text-dim);
  margin: 20px auto;
  text-align: left;
  max-width: 600px;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.03em;
}

.system-card h2 {
  margin: 0 0 4px;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.1em;
  color: var(--eve-accent);
  text-transform: uppercase;
}

.system-card .region-name {
  font-size: 12px;
  color: var(--eve-accent-dim);
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

/* ── Planet summary (system card) ── */
.planet-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.planet-type {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--eve-panel-alt);
  border: 1px solid var(--eve-border);
  padding: 5px 11px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.planet-type img {
  width: 26px;
  height: 26px;
  border-radius: 2px;
}

/* ── Planet list (system card) ── */
.planet-list .planet-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--eve-border);
  font-size: 14px;
  letter-spacing: 0.03em;
}

.planet-list .planet-entry img {
  width: 44px;
  height: 44px;
  border-radius: 2px;
}

.planet-entry .radius {
  margin-left: auto;
  color: var(--eve-accent-dim);
  font-size: 12px;
}

/* ── Region view ── */
.region-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
  text-align: center;
}

.region-header h2 {
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--eve-accent);
  font-weight: 300;
  text-transform: uppercase;
}

.region-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  justify-content: center;
}

.system-tile {
  background: var(--eve-panel);
  border: 1px solid var(--eve-border);
  border-radius: 0;
  padding: 10px 14px;
  width: 400px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}

.system-tile:hover {
  background: #162024;
  border-color: var(--eve-accent-dim);
}

.system-tile h4 {
  margin: 0 0 8px;
  color: var(--eve-accent);
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.system-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.system-header-row h4 { margin: 0; }

.planet-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.planet-type-region {
  display: flex;
  align-items: center;
  gap: 3px;
}

.planet-type-region img {
  width: 22px;
  height: 22px;
  border-radius: 2px;
}

/* ── System modal (region-view click) ── */
.eve-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(4px);
}

.eve-modal-content {
  max-width: 640px;
  max-height: 90vh;
  margin: 60px auto;
  padding: 0;
  color: var(--eve-text-body);
  overflow-y: auto;
  transform: scale(0.95);
  opacity: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.eve-modal-content::-webkit-scrollbar { display: none; }

.eve-modal.show { display: block; opacity: 1; }

.eve-modal.show .eve-modal-content {
  transform: scale(1);
  opacity: 1;
}
