/* =======================================================
   CSS BOX-SHADOW & GLOW LAB STYLESHEET
   ======================================================= */

.shadow-generator-tool {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 1.5rem 0 3rem;
}

.shadow-generator-tool .tool-layout {
  display: flex;
  flex-direction: row;
  gap: 2.5rem;
  align-items: flex-start;
}

@media (max-width: 1024px) {
  .shadow-generator-tool .tool-layout {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}

/* Controls Panel */
.shadow-generator-tool .tool-controls {
  background: rgba(10, 15, 30, 0.65);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  flex: 0 0 420px;
  max-width: 100%;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary, #cccccc);
  padding: 0.75rem 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--accent, #00f0ff);
  background: rgba(0, 240, 255, 0.03);
}

.tab-btn.active {
  color: var(--accent, #00f0ff);
  border-bottom-color: var(--accent, #00f0ff);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.tab-content.active {
  display: flex;
}

/* Layers Header */
.layers-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.layers-section-header h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: #ffffff;
  margin: 0;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent, #00f0ff);
  border: 1px solid rgba(0, 240, 255, 0.3);
  font-weight: bold;
}

.btn-small:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent, #00f0ff);
}

/* Layers List Container */
.layers-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
}

.layer-item:hover {
  background: rgba(0, 240, 255, 0.05);
  border-color: rgba(0, 240, 255, 0.2);
}

.layer-item.selected {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent, #00f0ff);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.layer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary, #ffffff);
}

.layer-item.disabled .layer-info {
  opacity: 0.5;
  text-decoration: line-through;
}

.layer-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}

.layer-actions {
  display: flex;
  gap: 0.5rem;
}

.layer-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.2rem;
  border-radius: 4px;
  color: var(--text-secondary, #cccccc);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.layer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.layer-btn.delete-btn:hover {
  background: rgba(255, 50, 50, 0.15);
  color: #ff3333;
}

/* Editor Subpanels */
.editor-subpanel {
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.editor-subpanel h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  color: var(--accent, #00f0ff);
  margin: 0 0 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Control Groups */
.shadow-generator-tool .control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shadow-generator-tool .control-group label {
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--text-primary, #ffffff);
  display: flex;
  justify-content: space-between;
}

.shadow-generator-tool .control-group label span {
  color: var(--accent, #00f0ff);
  font-family: monospace;
  font-weight: bold;
}

.shadow-generator-tool select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--fg, #ffffff);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

.shadow-generator-tool select:focus {
  border-color: var(--accent, #00f0ff);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

.shadow-generator-tool input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--fg, #ffffff);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.shadow-generator-tool input[type="text"]:focus {
  border-color: var(--accent, #00f0ff);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* Color Pickers Layout */
.shadow-generator-tool .color-picker-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.shadow-generator-tool .picker-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.shadow-generator-tool .picker-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #cccccc);
  display: flex;
  justify-content: space-between;
}

.shadow-generator-tool .picker-lbl span {
  font-family: monospace;
  color: var(--accent, #00f0ff);
}

.shadow-generator-tool input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 100%;
  height: 34px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.shadow-generator-tool input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.shadow-generator-tool input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Sliders */
.shadow-generator-tool input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 2.5px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  margin: 8px 0;
}

.shadow-generator-tool input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent, #00f0ff);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  transition: transform 0.1s ease;
}

.shadow-generator-tool input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Dividers & Actions */
.border-top-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.25rem;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary, #cccccc);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.5rem;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(0, 240, 255, 0.05);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--accent, #00f0ff);
}

/* Preview Stage Layout */
.shadow-generator-tool .preview-stage-container {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: stretch;
}

.shadow-generator-tool .preview-stage {
  width: 100%;
  height: 480px;
  min-height: 480px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Background Presets */
.preview-stage.bg-mesh {
  background-color: #05070f;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: center;
}

.preview-stage.bg-mesh::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(5, 7, 15, 0.7) 100%);
  pointer-events: none;
}

.preview-stage.bg-dark {
  background-color: #080c16;
}

.preview-stage.bg-light {
  background-color: #f0f2f8;
  border-color: rgba(0, 0, 0, 0.1);
}

.preview-stage.bg-neon-grad {
  background: radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(157, 78, 221, 0.08) 0%, transparent 40%),
              #070a14;
}

/* BG Switcher Controls */
.stage-bg-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px;
  z-index: 10;
}

.preview-stage.bg-light .stage-bg-switcher {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(0, 0, 0, 0.15);
}

.bg-switch-btn {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.7rem;
  font-family: 'Orbitron', sans-serif;
  color: var(--text-secondary, #cccccc);
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-stage.bg-light .bg-switch-btn {
  color: #333333;
}

.bg-switch-btn:hover {
  color: var(--accent, #00f0ff);
}

.bg-switch-btn.active {
  background: var(--accent, #00f0ff);
  color: #000000;
  font-weight: 600;
  text-shadow: none;
}

.preview-stage.bg-light .bg-switch-btn.active {
  background: #000000;
  color: #ffffff;
}

/* Target Preview Element */
#previewElement {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  transition: box-shadow 0.15s ease, border 0.15s ease, border-radius 0.15s ease, background 0.15s ease, width 0.15s ease, height 0.15s ease;
  z-index: 5;
  padding: 1.5rem;
}

#previewText {
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  letter-spacing: 2px;
  user-select: none;
  transition: text-shadow 0.15s ease, font-size 0.15s ease;
}

/* Exporter Panels Styling */
.exporter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.exp-tab-btn {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary, #cccccc);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.6rem 1.2rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exp-tab-btn:hover {
  color: var(--accent, #00f0ff);
  background: rgba(255, 255, 255, 0.04);
}

.exp-tab-btn.active {
  background: rgba(10, 15, 30, 0.4);
  color: var(--accent, #00f0ff);
  border-color: rgba(0, 240, 255, 0.2);
  border-bottom: 1px solid #00f0ff;
  box-shadow: inset 0 2px 0 var(--accent, #00f0ff);
}

.code-export-panel {
  display: none;
}

.code-export-panel.active {
  display: flex;
}

/* Scrollbar customization for layers panel */
.layers-list::-webkit-scrollbar {
  width: 4px;
}

.layers-list::-webkit-scrollbar-track {
  background: transparent;
}

.layers-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.layers-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent, #00f0ff);
}
