/* PoE2 Atziri Temple Planner CSS */

/* Planner Section - Override any conflicting styles */
#planner {
  font-family: sans-serif;
  background: #222;
  color: #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  min-height: 100vh;
  margin: 0;
}

#editor-title {
  text-align: center;
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  margin-top: 30px;
  font-family: 'Arial', sans-serif;
}

#editor-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  margin-top: 20px;
  width: 100%;
  max-width: 1400px;
}

/* Grid */
#grid-container { 
  display: flex; 
  justify-content: center;
  position: relative;
}

#grid {
  display: grid;
  grid-template-columns: repeat(9, 50px);
  grid-template-rows: repeat(9, 50px);
  gap: 12px;
  transform: rotate(45deg);
  margin-top: 120px;
  margin-right: 120px;
}

/* Grid Cells */
.cell {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  border: 1px solid #333;
  align-items: center;
  line-height: 1em;
  position: relative;
}

.cell span {
  transform: rotate(-45deg);
  display: block;
}

.cell-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #000;
  font-weight: bold;
  line-height: 1em;
}

/* Hover Effect for Grid Cells */
.cell:hover {
  transform: scale(1.05);
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
  transition: transform 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.cell span { 
  transform: rotate(-45deg); 
}

/* Sidebar */
#sidebar {
  width: 420px;
  padding: 20px;
  background: #181818;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Current Room Display */
#current-room-display {
  text-align: center;
  font-weight: bold;
  font-size: 16px;
}

/* Palette */
#palette-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Palette Buttons */
.room-palette-item {
  width: 100px;
  height: 60px;
  border: 1px solid #555;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.1;
  color: #fff;
  padding: 2px;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.room-palette-item:hover {
  border: 2px solid #00ff00; 
  box-shadow: 0 0 12px #00ff00;
  transform: scale(1.08);
}

/* Effects Display */
#effects-display {
  border: 1px solid #888;
  padding: 10px;
  min-height: 200px;
  background-color: #222;
  color: #fff;
  font-size: 12px;
  overflow-y: auto;
}

#big-a {
  position: absolute;
  font-size: 60px;
  font-weight: bold;
  color: red;
  pointer-events: none;
  z-index: 10;
}

.no-power {
  filter: grayscale(100%);
  opacity: 0.5;
}

.generator-edge {
  position: relative;
  z-index: 1;
}

.generator-edge::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(143, 202, 242, 0.0) 20%,
    rgba(143, 202, 242, 1.2) 50%,
    rgba(143, 202, 242, 0.0) 80%,
    transparent 100%
  );
  background-size: 300% 300%;
  animation: energyRun 2.2s linear infinite;
  pointer-events: none;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 3px;
}

@keyframes energyRun {
  from { background-position: 0% 50%; }
  to   { background-position: 300% 50%; }
}

/* Palette and Buttons Layout */
#palette-and-buttons {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

/* Button Column */
#palette-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Button Styling */
#palette-buttons button {
  padding: 10px 14px;
  background: #2b2b2b;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

#palette-buttons button:hover {
  background: #3a3a3a;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

#palette-buttons button:active {
  transform: translateY(1px);
}

#palette-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-palette-item.active {
  border: 2px solid #00ff00;
  box-shadow: 0 0 8px #00ff00;
  transform: scale(1.05);
}

/* Upgrade Tooltip States */
.upgrade-ok {
  color: #4caf50;
  font-weight: 600;
}

.upgrade-missing {
  color: #aaa;
}

.upgrade-title {
  margin-top: 6px;
  font-weight: bold;
  font-size: 12px;
}

.cell::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  background: #111;
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 100;
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.cell:hover::after {
  opacity: 0;
}

#room-tooltip {
  position: fixed;
  background: #111;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #fff;
  pointer-events: none;
  z-index: 1000;
  max-width: 260px;
  box-shadow: 0 0 14px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 0.12s ease;
}

#room-tooltip strong {
  font-size: 13px;
}

#room-tooltip .upgrade-ok {
  color: #4caf50;
  font-weight: 600;
}

#room-tooltip .upgrade-missing {
  color: #aaa;
}

#room-tooltip .upgrade-title {
  margin-top: 6px;
  font-weight: bold;
  font-size: 12px;
  color: #fff;
}

.room-palette-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center; 
  padding: 4px;
  text-align: center;
  position: relative;
}

/* Bridges */
.bridge {
  position: absolute;
  background-color: #00ff00;
  display: none;
  z-index: 1;
  border-radius: 2px;
  opacity: 0;
}

/* Active Bridges */
.bridge.active {
  opacity: 1;
  display: block;
}

/* Direction Up */
.bridge.up {
  width: 6px;
  height: 12px;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
}

/* Direction Down */
.bridge.down {
  width: 6px;
  height: 12px;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
}

/* Direction Left */
.bridge.left {
  width: 12px;
  height: 6px;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
}

/* Direction Right */
.bridge.right {
  width: 12px;
  height: 6px;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
}

/* Mode Switch */
.mode-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
  margin-right: 10px;
}

.mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Info Box Styling */
#info-box-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#toggle-info-btn {
  background: #2b2b2b;
  color: #fff;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 4px;
}

#toggle-info-btn:hover {
  background: #3a3a3a;
}

#info-box {
  background: #181818;
  color: #eee;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  opacity: 0;
}

#info-box.expanded {
  max-height: 800px;
  max-width: 400px;
  overflow-wrap: break-word;
  opacity: 1;
}

.room-palette-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.room-palette-item > div {
  color: white;
  font-size: 14px;
  text-align: center;
  padding-bottom: 1px;
  pointer-events: none;
}
