/* ==========================================================================
   1. BASE DEFAULT & THEMING 
   ========================================================================== */
:root {
  --bg-glow: #0b0f17;
  --card-bg: #161b22;
  --input-bg: #0d1117;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-light: rgba(255, 255, 255, 0.1);

  /* Main Site Amber/Orange Branding Accent */
  --accent: #d97706;
  --accent-hover: #f59e0b;

  --btn-bg: var(--accent);
  --btn-text: #ffffff;
  --btn-shadow: rgba(217, 119, 6, 0.25);

  --font-stack: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono-font: 'JetBrains Mono', monospace;
}

/* --- EXPLICIT STATE OVERRIDES --- */
:root[data-theme="dark"] {
  --bg-glow: #0b0f17;
  --card-bg: #161b22;
  --input-bg: #0d1117;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-light: rgba(255, 255, 255, 0.276);
  --accent: #d97706;
  --accent-hover: #f59e0b;
  --btn-bg: var(--accent);
  --btn-text: #ffffff;
  --btn-shadow: rgba(217, 119, 6, 0.3);
}

:root[data-theme="light"] {
  --bg-glow: #f8fafc;
  --card-bg: #ffffff;
  --input-bg: #e4e6e88a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-light: #c9c9c9;
  --accent: #d97706;
  --accent-hover: #b45309;
  --btn-bg: var(--accent);
  --btn-text: #ffffff;
  --btn-shadow: rgba(217, 119, 6, 0.2);
}

/* ==========================================================================
   2. CORE STYLES & LAYOUT
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-glow);
  background-attachment: fixed;
  font-family: var(--font-stack);
  color: var(--text-main);
  margin: 0;
  padding: 30px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.tool-header {
  text-align: center;
  margin-bottom: 6px;
  user-select: none;
  -webkit-user-select: none;
}

.tool-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.tool-header p {
  font-size: 14px;
  color: var(--text-muted);
}


   /* ==========================================================================
   3. UPLOAD DROP ZONE 
   ========================================================================== */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 270px; 
  margin: 0 auto;   
  padding: 20px 24px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: 1.5px dashed var(--border-light);
  background-color:rgba(106, 104, 104, 0.057);
  border-radius: 10px;
  transition: all 0.2s ease;
  text-align: center;
}

.upload-zone svg {
  stroke: var(--text-muted);
  width: 22px;
  height: 22px;
  transition: stroke 0.2s ease, transform 0.2s ease;
}

.upload-zone span {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  transition: color 0.2s ease;
}

.upload-zone:hover {
  border-color: var(--accent);
  color: var(--text-main);
  background-color: rgba(217, 119, 6, 0.04);
}

.upload-zone:hover svg {
  stroke: var(--accent);
  transform: translateY(-2px);
}

.upload-zone:hover span {
  color: var(--text-main);
}

.upload-zone input {
  display: none;
}

.upload-zone, #upload-zone {
  user-select: none;
  -webkit-user-select: none;
}

/* ==========================================================================
   4. OUTPUT MATRIX / TERMINAL
   ========================================================================== */
.output-block {
  background-color: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 18px;
  transition: border-color 0.2s ease, background-color 0.3s ease;
}

.matrix-header {
  border-bottom: 1px dashed var(--border-light);
  padding-bottom: 10px;
  margin-bottom: 12px;
  user-select: none;
  -webkit-user-select: none;
}

.matrix-info {
  font-family: var(--mono-font);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
}

#output {
  font-family: var(--mono-font);
  font-size: 10.5px;
  line-height: 10.5px;
  white-space: pre;
  min-height: 220px;
  max-height: 440px;
  overflow: auto;
  color: var(--text-main);
}

/* ==========================================================================
   5. CONTROL PANEL & SLIDERS
   ========================================================================== */
.card-block {
  background-color: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 540px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-item label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--input-bg);
  border: 1px solid var(--border-light);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
  transition: transform 0.15s ease, background 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-hover);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.4);
}

/* Checkbox */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ==========================================================================
   6. ACTION BUTTONS
   ========================================================================== */
.button-group {
  display: flex;
  gap: 14px;
  width: 100%;
}

.btn-go,
.btn-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Primary Action Button */
.btn-go {
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  box-shadow: 0 4px 12px var(--btn-shadow);
}

.btn-go:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--btn-shadow);
}

/* Secondary Button */
.btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: rgba(217, 119, 6, 0.04);
}

@media (max-width: 540px) {
  .button-group {
    flex-direction: column;
  }
}

/* ==========================================================================
   7. UTILITIES & FLOATING PILL SCROLLBAR
   ========================================================================== */

           /* highlighting*/
::selection {
  background-color: yellowgreen !important;
  color: #000000 !important;
}

::-moz-selection {
  background-color: greenyellow !important;
  color: #000000 !important;
}


button,
.upload-zone,
label {
  user-select: none;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.4);
  background-clip: padding-box;
}

/* Light Theme Scrollbars */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  background-clip: padding-box;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.45);
  background-clip: padding-box;
}

[data-theme="light"] * {
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}