/* Zalgo Glitch Generator Styles */
.statmat-tool.zalgo-glitch {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  color: #00ff00; /* Hacker green */
  background-color: #000;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
  border: 1px solid #333;
  overflow: hidden;
}

.statmat-tool.zalgo-glitch * {
  box-sizing: border-box;
}

.statmat-tool.zalgo-glitch .zg-header {
  background: repeating-linear-gradient(
    45deg,
    #051505,
    #051505 10px,
    #000 10px,
    #000 20px
  );
  color: #00ff00;
  padding: 24px;
  text-align: center;
  border-bottom: 2px solid #00ff00;
}

.statmat-tool.zalgo-glitch .zg-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.statmat-tool.zalgo-glitch .zg-header h2 {
  margin: 0 0 8px 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 2px 0 0 #ff00ff, -2px 0 0 #00ffff;
}

.statmat-tool.zalgo-glitch .zg-header p {
  margin: 0;
  font-size: 14px;
  color: #008800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.statmat-tool.zalgo-glitch .zg-container {
  padding: 24px;
}

.statmat-tool.zalgo-glitch .workspace {
  display: flex;
  gap: 24px;
}

/* Input Panel */
.statmat-tool.zalgo-glitch .input-panel {
  flex: 1;
  background-color: #050505;
  padding: 20px;
  border: 1px solid #00ff00;
}

.statmat-tool.zalgo-glitch label {
  display: block;
  font-weight: 600;
  color: #00cc00;
  margin-bottom: 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.statmat-tool.zalgo-glitch textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #00ff00;
  border-radius: 0;
  font-size: 16px;
  color: #00ff00;
  background-color: #000;
  transition: all 0.2s;
  resize: vertical;
  font-family: monospace;
}

.statmat-tool.zalgo-glitch textarea:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}

.statmat-tool.zalgo-glitch .sliders-container {
  background-color: #0a0a0a;
  padding: 16px;
  border: 1px dashed #008800;
}

.statmat-tool.zalgo-glitch .sliders-container h4 {
  margin: 0 0 16px 0;
  color: #00ff00;
  text-transform: uppercase;
  font-size: 14px;
  border-bottom: 1px solid #004400;
  padding-bottom: 8px;
}

.statmat-tool.zalgo-glitch .control-group {
  margin-bottom: 16px;
}
.statmat-tool.zalgo-glitch .control-group:last-child {
  margin-bottom: 0;
}

.statmat-tool.zalgo-glitch input[type="range"] {
  width: 100%;
  accent-color: #00ff00;
  cursor: pointer;
}

.statmat-tool.zalgo-glitch .checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.statmat-tool.zalgo-glitch .inline-label {
  display: inline;
  margin: 0;
  color: #ff3333; /* warning color for crazy mode */
  cursor: pointer;
}

.statmat-tool.zalgo-glitch input[type="checkbox"] {
  accent-color: #ff3333;
  width: 16px; height: 16px;
}

.statmat-tool.zalgo-glitch .mt-2 { margin-top: 12px; }
.statmat-tool.zalgo-glitch .mt-3 { margin-top: 20px; }

/* Output Panel */
.statmat-tool.zalgo-glitch .output-panel {
  flex: 1.2;
  background-color: #050505;
  padding: 20px;
  border: 1px solid #00ff00;
  display: flex;
  flex-direction: column;
}

.statmat-tool.zalgo-glitch .results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #004400;
}

.statmat-tool.zalgo-glitch .results-header h3 {
  margin: 0;
  font-size: 16px;
  color: #00ff00;
  text-transform: uppercase;
}

.statmat-tool.zalgo-glitch .btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #00ff00;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  background-color: #003300;
  color: #00ff00;
  display: flex;
  align-items: center;
  gap: 6px;
}

.statmat-tool.zalgo-glitch .btn:hover {
  background-color: #00ff00;
  color: #000;
}

.statmat-tool.zalgo-glitch .result-box {
  flex: 1;
  padding: 40px 20px;
  font-size: 20px;
  color: #00ff00;
  background-color: #000;
  border: 1px dashed #008800;
  text-align: center;
  word-break: break-all;
  white-space: pre-wrap;
  overflow: hidden; 
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.5;
  font-family: inherit;
}

/* Toast */
.statmat-tool.zalgo-glitch .toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #00ff00;
  color: #000;
  padding: 12px 28px;
  border-radius: 0;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 255, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 9999;
}

.statmat-tool.zalgo-glitch .toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .statmat-tool.zalgo-glitch .workspace {
    flex-direction: column;
  }
}

/* Global override for mobile scrolling on long results */
.statmat-tool [class*="result"], 
.statmat-tool [class*="output"],
.statmat-tool [class*="preview"],
.statmat-tool [class*="display"] {
  overflow-x: auto;
  max-width: 100%;
}

/* Global safeguard: ensure main wrapper never exceeds mobile viewport */
.statmat-tool {
  width: 100% !important;
  box-sizing: border-box;
}
