/* Lab Popup Wireframe Styling */

/* Gene type colors */
:root {
  --gene-hox-color: #B94A4A;    /* Red-ish for body plan genes */
  --gene-ele-color: #358f5a;    /* Teal for elemental genes */
  --gene-cov-color: #2F7A94;    /* Blue for coverage genes */
  --gene-lok-color: #726b9b;     /* Green for look genes */
  --gene-bod-color: #AE7851;   /* Yellow for body genes */
  
  --gene-hox-color-dark: #885656;    /* Darker red */
  --gene-ele-color-dark: #5c836c;    /* Darker teal */
  --gene-cov-color-dark: #566f77;    /* Darker blue */
  --gene-lok-color-dark: #7d7a8d;    /* Darker green */
  --gene-bod-color-dark: #887260;    /* Darker yellow */
}

.lab-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lab-popup-overlay.hidden {
  display: none;
}

.lab-popup-container {
  width: 800px;
  height: 600px;
  background: url('/shared/images/metal-mid-tex.png') repeat;
  background-size: 256px 256px;
  border-radius: 20px;
  border: 3px solid #8C8C8C;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.9),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.3),
    inset 2px 0 0 rgba(255, 255, 255, 0.2),
    inset -2px 0 0 rgba(0, 0, 0, 0.2);
}



/* Upper Controls section */
.upper-controls {
  padding: 10px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Sequencer section */
.sequencer {
  padding: 10px;
  height: 250px;
  display: flex;
  gap: 30px;
}

.gene-list {
  width: 354px;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.2);
  border-radius: 8px;
}

.gene-slot {
  padding: 8px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 6px;
  background: transparent;
  box-sizing: border-box;
}

.gene-slot-label {
  width: 60px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  text-align: right;
  flex-shrink: 0;
}

.gene-slot-container {
  flex: 1;
  height: 40px;
  border-radius: 6px;
  background: url('/shared/images/metal-light-tex.png') repeat;
  background-size: 256px 256px;
  box-sizing: border-box;
  box-shadow: 
    inset 0 0 0 2px rgba(100, 100, 100, 0.3),
    inset 2px 2px 6px rgba(0, 0, 0, 0.4),
    inset -2px -2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  padding: 4px 8px;
}

.egg-chamber {
  padding: 20px;
  width: 200px;
  height: 200px;
  min-width: 200px;
  min-height: 200px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('/shared/images/metal-light-tex.png') repeat;
  background-size: 256px 256px;
  box-sizing: border-box;
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.25),
    inset 0 0 0 2px rgba(100, 100, 100, 0.3),
    inset 2px 2px 6px rgba(0, 0, 0, 0.4),
    inset -2px -2px 6px rgba(0, 0, 0, 0.4);
}

.egg-drop-zone {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: url('/shared/images/metal-light-tex.png') repeat;
  background-size: 256px 256px;
  box-sizing: border-box;
  box-shadow: 
    inset 0 0 0 2px rgba(100, 100, 100, 0.3),
    inset 2px 2px 6px rgba(0, 0, 0, 0.4),
    inset -2px -2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #666;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.egg-chamber-label {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
}

/* Shelves section */
.shelves {
  padding: 10px;
  flex: 1;
  display: flex;
  gap: 18px;
}

.gene-shelf {
  border-radius: 8px;
  padding: 10px;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-start;
  gap: 5px;
  overflow-y: auto;
  max-height: 200px;
  background: url('/shared/images/metal-light-tex.png') repeat;
  background-size: 256px 256px;
  box-sizing: border-box;
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.2),
    inset 0 0 0 2px rgba(100, 100, 100, 0.3),
    inset 2px 2px 6px rgba(0, 0, 0, 0.4),
    inset -2px -2px 6px rgba(0, 0, 0, 0.4);
}

.egg-shelf {
  border-radius: 8px;
  padding: 15px;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  align-content: start;
  justify-items: center;
  overflow-x: hidden;
  max-height: 200px;
  background: url('/shared/images/metal-light-tex.png') repeat;
  background-size: 256px 256px;
  box-sizing: border-box;
  box-shadow: 
    0 0 0 3px rgba(0,0,0,0.2),
    inset 0 0 0 2px rgba(100, 100, 100, 0.3),
    inset 2px 2px 6px rgba(0, 0, 0, 0.4),
    inset -2px -2px 6px rgba(0, 0, 0, 0.4);
}

/* Egg item styling */
.egg-item {
  width: 80px;
  height: 80px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  transition: transform 0.2s ease;
}

.egg-item:hover {
  transform: scale(1.05);
}

.egg-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  transition: filter 0.2s ease;
}

.egg-item:hover img {
  filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.4));
}

/* Gene tag styling */
.gene-tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  color: #f7f7f7;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  text-shadow: none;
  box-sizing: border-box;
  margin: 2px;
}

.gene-tag:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Gene type colors for tags */
.gene-tag[data-gene-type="hox"] {
  background-color: var(--gene-hox-color);
}

.gene-tag[data-gene-type="ele"] {
  background-color: var(--gene-ele-color);
}

.gene-tag[data-gene-type="cov"] {
  background-color: var(--gene-cov-color);
}

.gene-tag[data-gene-type="bod"] {
  background-color: var(--gene-bod-color);
}

.gene-tag[data-gene-type="lok"] {
  background-color: var(--gene-lok-color);
}

/* Sequencer gene styling */
.sequencer-gene {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  color: #f7f7f7;
  margin: 2px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0px 0px 12px rgba(255, 255, 255, 0.75);
}

/* Existing genes (darker styling, not clickable) */
.sequencer-gene.existing-gene {
  cursor: default;
  box-shadow: none;
}

/* Added genes (brighter styling, clickable) */
.sequencer-gene.added-gene {
  cursor: pointer;
}

.sequencer-gene.added-gene:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Gene type colors for sequencer genes (bright versions) */
.sequencer-gene[data-gene-type="hox"] {
  background-color: var(--gene-hox-color);
}

.sequencer-gene[data-gene-type="ele"] {
  background-color: var(--gene-ele-color);
}

.sequencer-gene[data-gene-type="cov"] {
  background-color: var(--gene-cov-color);
}

.sequencer-gene[data-gene-type="bod"] {
  background-color: var(--gene-bod-color);
}

.sequencer-gene[data-gene-type="lok"] {
  background-color: var(--gene-lok-color);
}

/* Gene type colors for existing sequencer genes (dark versions) */
.sequencer-gene.existing-gene[data-gene-type="hox"] {
  background-color: var(--gene-hox-color-dark);
}

.sequencer-gene.existing-gene[data-gene-type="ele"] {
  background-color: var(--gene-ele-color-dark);
}

.sequencer-gene.existing-gene[data-gene-type="cov"] {
  background-color: var(--gene-cov-color-dark);
}

.sequencer-gene.existing-gene[data-gene-type="bod"] {
  background-color: var(--gene-bod-color-dark);
}

.sequencer-gene.existing-gene[data-gene-type="lok"] {
  background-color: var(--gene-lok-color-dark);
}

/* Slot highlighting when hovering over compatible genes */
.gene-slot-container.slot-highlighted {
  background: 
    linear-gradient(135deg, rgba(76, 175, 80, 0.4), rgba(69, 160, 73, 0.4)),
    url('/shared/images/metal-light-tex.png') repeat !important;
  background-size: auto, 256px 256px !important;
  border-color: #4CAF50 !important;
}

/* Popup header */
.popup-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding-left: 30px;
  padding-top: 10px;
  padding-bottom: 10px;
  padding-right: 20px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.popup-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 28px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
  text-shadow: none;
  letter-spacing: 4px;
  line-height: normal;
  text-align: left;
}

.close-button {
  width: 40px;
  height: 40px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 26px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  background: 
    linear-gradient(135deg, rgba(136, 136, 136, 0.6), rgba(102, 102, 102, 0.6)),
    url('/shared/images/metal-mid-tex.png') repeat;
  background-size: auto, 256px 256px;
  color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-button:hover {
  background: 
    linear-gradient(135deg, rgba(170, 170, 170, 0.6), rgba(136, 136, 136, 0.6)),
    url('/shared/images/metal-mid-tex.png') repeat;
  background-size: auto, 256px 256px;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* --- HATCHING POPUP STYLES --- */
.hatch-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.hatch-popup {
  width: 500px;
  background: url('/shared/images/parchment-tex.png') repeat;
  background-size: 256px 256px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border: 3px solid rgba(61, 47, 31, 0.4);
}

.hatch-content {
  display: flex;
  flex-direction: column;
}

.hatch-content h2 {
  margin: 0;
  padding: 20px 20px 20px 20px;
  font-size: 28px;
  font-weight: bold;
  color: rgba(61, 47, 31, 0.8);
  text-align: center;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.hatch-monster-display-area {
  width: 100%;
  height: 300px;
  background-image: url('/shared/images/starburst.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.hatch-monster-image {
  max-width: 250px;
  max-height: 250px;
  object-fit: contain;
  filter: drop-shadow(3px 3px 8px rgba(0, 0, 0, 0.4));
}

.hatch-text-banner {
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  text-align: center;
  border-top: 3px solid rgba(61, 47, 31, 0.2);
}

.hatch-message {
  font-size: 18px;
  margin: 0 0 10px 0;
  color: rgba(61, 47, 31, 0.8);
  font-weight: normal;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.hatch-monster-name {
  font-size: 32px;
  font-weight: bold;
  margin: 0 0 20px 0;
  color: rgba(61, 47, 31, 0.9);
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
  letter-spacing: 1px;
}

.hatch-monster-description {
  margin: 15px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(61, 47, 31, 0.2);
}

.hatch-monster-description-text {
  font-size: 14px;
  color: rgba(61, 47, 31, 0.8);
  line-height: 1.4;
  margin: 0;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
  font-style: italic;
}

.hatch-monster-stats-compact {
  margin: 15px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(61, 47, 31, 0.2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-size: 13px;
  gap: 8px;
}

.stat-label {
  color: rgba(61, 47, 31, 0.8);
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.stat-value {
  color: rgba(61, 47, 31, 0.9);
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.hatch-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.hatch-buttons .button {
  min-width: 200px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 25px;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.hatch-buttons .button-primary {
  background: #4CAF50;
  color: white;
  box-shadow: 0 4px 12px rgba(90, 143, 62, 0.3);
}

.hatch-buttons .button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(90, 143, 62, 0.4);
}

.hatch-buttons .button-secondary {
  background: rgba(61, 47, 31, 0.8);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hatch-buttons .button-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  background: rgba(61, 47, 31, 0.9);
}

/* Lower Controls section */
.lower-controls {
  padding: 10px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  width: 50%;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-label {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 18px;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.status-display {
  width: 25%;
  height: 40px;
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  font-size: 14px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

.status-display.ready {
  color: #00ff00;
  text-shadow: 0 0 16px rgba(0, 255, 0, 0.9);
}

.status-display.busy {
  color: #ff0000;
  text-shadow: 0 0 16px rgba(255, 0, 0, 0.9);
}

.incubate-button {
  flex: 1;
  height: 40px;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.incubate-button.ready {
  background: 
    linear-gradient(135deg, rgba(76, 175, 80, 0.6), rgba(69, 160, 73, 0.6)),
    url('/shared/images/metal-mid-tex.png') repeat;
  background-size: auto, 256px 256px;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.incubate-button.ready:hover {
  background: 
    linear-gradient(135deg, rgba(69, 160, 73, 0.6), rgba(61, 139, 64, 0.6)),
    url('/shared/images/metal-mid-tex.png') repeat;
  background-size: auto, 256px 256px;
  transform: translateY(-1px);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.incubate-button.busy {
  background: 
    linear-gradient(135deg, rgba(136, 136, 136, 0.6), rgba(102, 102, 102, 0.6)),
    url('/shared/images/metal-mid-tex.png') repeat;
  background-size: auto, 256px 256px;
  color: #ccc;
  cursor: not-allowed;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.incubate-button.busy:hover {
  transform: none;
}