/* ============================================
   CHEMVENTUR v110 - MEGA PERIODIC TABLE CSS
   ⚛️ Beautiful colors for all 118 elements! ⚛️
   ============================================ */

/* ===== PERIODIC TABLE WINDOW ===== */
#periodic-table-full {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96vw;
  max-width: 1500px;
  max-height: 92vh;
  background: linear-gradient(135deg, #000500, #001500, #000500);
  border: 4px solid var(--neon-green);
  border-radius: 15px;
  box-shadow: 0 0 60px var(--neon-green), 0 0 120px rgba(0, 255, 65, 0.3);
  padding: 15px;
  display: none;
  z-index: 700;
  overflow: auto;
}

#periodic-table-full.visible {
  display: block;
  animation: ptSlideIn 0.3s ease-out;
}

@keyframes ptSlideIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#periodic-table-full h2 {
  text-align: center;
  color: var(--neon-green);
  margin-bottom: 10px;
  font-size: 20px;
  text-shadow: 0 0 20px var(--neon-green);
}

#periodic-table-full .close-pt {
  position: absolute;
  top: 10px;
  right: 15px;
  background: transparent;
  border: 2px solid var(--neon-green);
  color: var(--neon-green);
  font-size: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.3s;
  z-index: 10;
}

#periodic-table-full .close-pt:hover {
  background: var(--neon-green);
  color: #000;
}

/* ===== PERIODIC TABLE GRID ===== */
.pt-grid-full {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  gap: 3px;
  margin: 10px 0;
}

/* ===== ELEMENT CELL ===== */
.pt-el {
  aspect-ratio: 1;
  min-width: 40px;
  min-height: 40px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}

.pt-el:hover {
  transform: scale(1.3);
  z-index: 100;
  box-shadow: 0 0 20px currentColor;
}

.pt-el .el-number {
  font-size: 8px;
  opacity: 0.7;
  position: absolute;
  top: 2px;
  left: 3px;
}

.pt-el .el-symbol {
  font-size: 16px;
  font-weight: bold;
  line-height: 1;
}

.pt-el .el-mass {
  font-size: 7px;
  opacity: 0.6;
  position: absolute;
  bottom: 2px;
}

.pt-el.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.pt-el.empty:hover {
  transform: none;
  box-shadow: none;
}

.pt-el.spacer {
  background: transparent;
  border: 1px dashed rgba(255,255,255,0.1);
  cursor: default;
}

.pt-el.spacer:hover {
  transform: none;
  box-shadow: none;
}

.pt-el.spacer::after {
  content: '★';
  font-size: 10px;
  opacity: 0.3;
}

/* ===== CATEGORY COLORS ===== */
.pt-el.alkali-metal {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: #000;
}

.pt-el.alkaline-earth {
  background: linear-gradient(135deg, #feca57, #f9ca24);
  color: #000;
}

.pt-el.transition-metal {
  background: linear-gradient(135deg, #ff9ff3, #f368e0);
  color: #000;
}

.pt-el.post-transition {
  background: linear-gradient(135deg, #54a0ff, #2e86de);
  color: #000;
}

.pt-el.metalloid {
  background: linear-gradient(135deg, #5f27cd, #341f97);
  color: #fff;
}

.pt-el.nonmetal {
  background: linear-gradient(135deg, #00d2d3, #01a3a4);
  color: #000;
}

.pt-el.noble-gas {
  background: linear-gradient(135deg, #ff00ff, #cc00cc);
  color: #000;
}

.pt-el.lanthanide {
  background: linear-gradient(135deg, #ff9f43, #ee8e2f);
  color: #000;
}

.pt-el.actinide {
  background: linear-gradient(135deg, #ee5a24, #d63031);
  color: #fff;
}

.pt-el.unknown {
  background: linear-gradient(135deg, #576574, #636e72);
  color: #fff;
}

/* ===== LEGEND ===== */
.pt-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
}

.pt-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}

.pt-legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

/* ===== ELEMENT DETAIL POPUP ===== */
#element-detail {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-width: 95vw;
  max-height: 85vh;
  background: linear-gradient(135deg, #001500, #002500);
  border: 3px solid var(--neon-green);
  border-radius: 12px;
  padding: 20px;
  display: none;
  z-index: 800;
  box-shadow: 0 0 50px var(--neon-green);
  overflow-y: auto;
}

#element-detail.visible {
  display: block;
  animation: detailPopIn 0.2s ease-out;
}

@keyframes detailPopIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

#element-detail .close-detail {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--neon-green);
  font-size: 22px;
  cursor: pointer;
}

/* Element header */
.el-detail-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(0,255,65,0.3);
}

.el-detail-symbol-box {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
}

.el-detail-symbol-box .big-number {
  font-size: 12px;
  opacity: 0.7;
}

.el-detail-symbol-box .big-symbol {
  font-size: 36px;
  font-weight: bold;
  line-height: 1;
}

.el-detail-symbol-box .big-mass {
  font-size: 10px;
  opacity: 0.6;
}

.el-detail-name {
  flex: 1;
}

.el-detail-name h3 {
  font-size: 24px;
  margin: 0;
  color: var(--neon-green);
}

.el-detail-name .el-category {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 5px;
}

/* Data sections */
.el-detail-section {
  margin: 12px 0;
  padding: 10px;
  background: rgba(0,255,65,0.05);
  border-radius: 6px;
  border-left: 3px solid var(--neon-green);
}

.el-detail-section h4 {
  font-size: 12px;
  color: var(--neon-green);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.el-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.el-detail-row:last-child {
  border-bottom: none;
}

.el-detail-row .label {
  color: #888;
}

.el-detail-row .value {
  color: #fff;
  font-weight: bold;
}

/* Electron shell diagram */
.electron-shells {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  gap: 5px;
}

.shell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0,255,65,0.5);
  border-radius: 50%;
  font-size: 10px;
  color: #0f0;
}

.shell-1 { width: 30px; height: 30px; }
.shell-2 { width: 50px; height: 50px; }
.shell-3 { width: 70px; height: 70px; }
.shell-4 { width: 90px; height: 90px; }
.shell-5 { width: 110px; height: 110px; }
.shell-6 { width: 130px; height: 130px; }
.shell-7 { width: 150px; height: 150px; }

/* Description */
.el-description {
  font-size: 11px;
  line-height: 1.5;
  color: #aaa;
  padding: 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  margin-top: 10px;
}

/* Select button */
.el-select-btn {
  display: block;
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  background: linear-gradient(135deg, #003300, #006600);
  border: 2px solid var(--neon-green);
  color: var(--neon-green);
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
}

.el-select-btn:hover {
  background: var(--neon-green);
  color: #000;
  box-shadow: 0 0 20px var(--neon-green);
}

/* Physical state indicators */
.state-solid { color: #888; }
.state-liquid { color: #00bfff; }
.state-gas { color: #ff69b4; }
.state-unknown { color: #666; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .pt-el {
    min-width: 30px;
    min-height: 30px;
  }
  .pt-el .el-symbol { font-size: 12px; }
  .pt-el .el-number { font-size: 6px; }
  .pt-el .el-mass { display: none; }
}

@media (max-width: 700px) {
  .pt-el {
    min-width: 20px;
    min-height: 20px;
  }
  .pt-el .el-symbol { font-size: 9px; }
  .pt-el .el-number { display: none; }
  .pt-legend { font-size: 8px; }
}
