/* Professional Dark Mode Variables */
:root {
  /* True blacks for OLED optimization */
  --black: #000000;
  --black-soft: #050505;
  --black-warm: #080808;
  
  /* Clean whites with minimal blue tint */
  --white: #ffffff;
  --white-soft: #f8f8f8;
  --white-dim: #e0e0e0;
  
  /* Professional gray scale - optimized for dark mode readability */
  --gray-50: #fafafa;
  --gray-100: #f0f0f0;
  --gray-200: #d9d9d9;
  --gray-300: #a6a6a6;
  --gray-400: #808080;
  --gray-500: #666666;
  --gray-600: #4d4d4d;
  --gray-700: #333333;
  --gray-800: #1a1a1a;
  --gray-850: #141414;
  --gray-900: #0d0d0d;
  --gray-950: #080808;
  
  /* Accent colors for dark mode */
  --accent-primary: #f0f0f0;
  --accent-hover: rgba(255, 255, 255, 0.08);
  --accent-active: rgba(255, 255, 255, 0.12);
  --accent-glow: rgba(255, 255, 255, 0.02);
  
  /* Typography */
  --mono: 'JetBrains Mono', 'SF Mono', Monaco, Menlo, Consolas, monospace;
  
  /* Enhanced animations */
  --transition: cubic-bezier(0.23, 1, 0.32, 1);
  --fast: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  
  /* Refined borders and shadows */
  --border-radius: 0;
  --border-radius-sm: 0;
  --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px -4px rgba(0, 0, 0, 0.6), 0 4px 10px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(255, 255, 255, 0.03);
  
  /* Consistent spacing system - Balanced for airy layout */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 28px;
}

/* Minimal Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  width: auto;
  height: auto;
  background: none;
  backdrop-filter: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}

.loading-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  margin: 0;
  position: relative;
  background: rgba(0, 0, 0, 0.8);
}

.loading-spinner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0;
  transform: translate(-50%, -50%);
  animation: square-pulse 1.5s ease-in-out infinite;
}

@keyframes square-pulse {
  0%, 100% { 
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% { 
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.loading-text {
  display: none;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--mono);
  background: var(--black);
  color: var(--white);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: fixed;
  width: 100%;
  touch-action: manipulation;
}

/* Main Layout */
.main-container {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
}

/* Canvas Area - True Fullscreen */
.image-preview {
  flex: 1;
  position: relative;
  background: radial-gradient(ellipse at center, rgba(5, 5, 5, 1) 0%, var(--black) 70%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: none; /* Allow all touch gestures including pinch zoom */
}


.image-container canvas {
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  object-fit: contain;
  display: block;
  image-rendering: auto; /* JS sets dynamically in displayResult() */
  touch-action: none;
  user-select: none;
}

.image-container pre {
  color: var(--white);
  font-family: var(--mono);
  font-size: 6px;
  line-height: 1;
  padding: 20px;
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  white-space: pre;
  letter-spacing: 0.2px;
  touch-action: none;
  user-select: none;
}

.placeholder-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--gray-500);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  pointer-events: auto;
  user-select: none;
  opacity: 0.7;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.placeholder-text:hover {
  opacity: 1;
  color: var(--gray-300);
  transform: translate(-50%, -50%) scale(1.02);
}

/* Professional Sidebar */
.controls-panel {
  width: 380px;
  min-width: 380px;
  max-width: 380px;
  height: 100vh;
  height: 100dvh;
  background: var(--gray-950);
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: -1px 0 0 rgba(0, 0, 0, 0.5);
}

.panel-header {
  display: none;
}

/* Tab navigation styles */
.tabs {
  display: flex;
  background: var(--black);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0;
  gap: 0;
  position: relative;
}

.tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.15s ease, background 0.15s ease, border 0.15s ease;
  border: none;
  background: rgba(255, 255, 255, 0.01);
  position: relative;
  border-bottom: 2px solid rgba(255, 255, 255, 0.04);
}

.tab:hover {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.tab.active {
  color: #FAFAFA;
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: #e0e0e0;
  font-weight: 600;
}

/* Tab Content */
.tab-content {
  flex: 1;
  padding: 20px var(--space-md) 80px var(--space-md);  /* Consistent top padding for all tabs */
  overflow-y: auto;
  display: none;
  background: var(--black);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
}

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

/* CRITICAL: Ensure all first control groups start at exactly same position */
.tab-content > .control-group:first-child {
  margin-top: 0;  /* No top margin for first element */
  padding-top: 12px;  /* Consistent padding for all first elements */
}

/* Control group layout */
.control-group {
  margin-bottom: 12px;
  padding: 12px var(--space-lg);
  background: var(--black);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 0;
  position: relative;
  min-height: auto;
}


.control-group:last-child {
  margin-bottom: 0;
}

/* Consistent spacing for all adjust controls */
#adjust .control-group {
  margin-bottom: 12px;  /* Same spacing as other tabs */
  padding: 12px var(--space-lg);  /* Match other tabs padding */
  border-top: none;
  background: transparent;
}

/* Ensure first element in adjust tab matches others */
#adjust > .control-group:first-child {
  padding-top: 12px;
}

/* No special spacing - all controls equal */
#adjust .control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  display: block;
  font-family: var(--mono) !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin-bottom: 8px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  position: relative;
  line-height: 1.2 !important;
  font-style: normal !important;
  text-decoration: none !important;
}

/* Ensure ABSOLUTE consistency across ALL tabs and labels */
#control .control-group label,
#adjust .control-group label,
#effects .control-group label,
.control-group > label,
div[class*="control"] label {
  font-family: var(--mono) !important;
  font-size: 10px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.5) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  line-height: 1.2 !important;
  margin-bottom: 8px !important;
  display: block !important;
}

/* Form input styling */
select {
  width: 100%;
  padding: 10px 28px 10px 12px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.04);
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.8) 50%),
                    linear-gradient(135deg, rgba(255, 255, 255, 0.8) 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px),
                       calc(100% - 12px) calc(50% + 1px);
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 16px;
  cursor: pointer;
  transition: all 0.15s var(--fast);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-transform: uppercase;
}

select:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.9) 50%),
                    linear-gradient(135deg, rgba(255, 255, 255, 0.9) 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px),
                       calc(100% - 12px) calc(50% + 1px);
  background-size: 4px 4px, 4px 4px;
}

select:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  background-image: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 1.0) 50%),
                    linear-gradient(135deg, rgba(255, 255, 255, 1.0) 50%, transparent 50%);
  background-position: calc(100% - 15px) calc(50% + 1px),
                       calc(100% - 12px) calc(50% + 1px);
  background-size: 4px 4px, 4px 4px;
}

select option {
  background: rgba(0, 0, 0, 0.9);
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  padding: 8px 12px;
  border: none;
}

select optgroup {
  background: var(--gray-950);
  color: var(--gray-400);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px;
}

/* Refined Button Grid */
.pixel-size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.pixel-btn {
  padding: 12px;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: 0;
  color: var(--gray-400);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--fast);
  text-align: center;
}

.pixel-btn:hover {
  border-color: var(--gray-700);
  color: var(--gray-300);
  background: var(--gray-800);
}

/* FIXED: Selected buttons - subtle, not primary */
.pixel-btn.active {
  background: linear-gradient(145deg, var(--gray-800), rgba(36, 36, 36, 0.95));
  border-color: var(--gray-600);
  color: var(--white);
  position: relative;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}


/* Refined Sliders */
.slider-container {
  position: relative;
  margin-top: 12px;
  padding: 8px 0;
}

.slider-value {
  position: absolute;
  right: 0;
  top: -12px;  /* Align with label top */
  background: var(--gray-800);
  color: var(--white);
  padding: 4px 8px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
  border: 1px solid var(--gray-700);
}

input[type="range"] {
  width: 100%;
  height: 20px; /* Bigger touch area for desktop */
  background: var(--gray-800);
  background-size: 100% 3px;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 0;
  outline: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
}

/* Track styling for desktop — background gradient on input handles fill */
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 3px;
  background: transparent;
  border-radius: 0;
}

/* Range slider thumb styling */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: #E0E0E0;
  border-radius: 0;
  cursor: pointer;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  margin-top: -4.5px; /* Center 12px thumb on 3px track */
  transition: box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--gray-200);
  border-color: var(--gray-600);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #E0E0E0;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

input[type="range"]::-moz-range-track {
  height: 3px;
  background: var(--gray-800);
  border: none;
  border-radius: 0;
}

/* Firefox: filled left side of track */
input[type="range"]::-moz-range-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 0;
}

/* Color picker styles */
.color-palette-container {
  margin-top: 12px;
  padding: 12px;
  background: linear-gradient(145deg, var(--gray-950), rgba(12, 12, 12, 0.95));
  border: 1px solid var(--gray-800);
  border-radius: 0;
}

.palette-header {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.color-palette {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  justify-content: center;
  align-items: stretch;
}

/* Ensure consistent spacing for 2 or 3 color mode */
.color-palette .color-swatch-group {
  flex: 1;
  min-width: 0;
}

.color-swatch-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.color-swatch {
  width: 100%;
  height: 24px;
  border-radius: 0;
  border: 0.5px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  background: transparent;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

#asciiColorSettings .color-swatch {
  width: 100%;
  height: 24px;
}

.color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 0;
}

.color-swatch::-moz-color-swatch {
  border: none;
  border-radius: 0;
}

.color-swatch:hover {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  outline: none;
}

.color-swatch:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  outline: none;
}

/* Ensure consistent styling for all color swatches including color3 */
#color1, #color2, #color3 {
  width: 100% !important;
  height: 24px !important;
  border-radius: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: transparent !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: var(--shadow-md) !important;
}

#color1:hover, #color2:hover, #color3:hover {
  transform: translateY(-2px) scale(1.05) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: var(--shadow-lg) !important;
}

#color1:focus, #color2:focus, #color3:focus {
  outline: none !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
}

.color-label {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  width: 100%;
  display: block;
  margin: 0 auto;
}

/* Ensure midtones container and label alignment matches others */
#color3Container {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 72px;
}

/* Force hide midtones in duotone mode */
#color3Container[style*="display: none"] {
  display: none !important;
}

#color3Container .color-label {
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  width: 100%;
  display: block;
  margin: 0 auto;
  line-height: normal;
}

/* Premium ASCII color swatches */
.premium-color-swatch {
  width: 48px;
  height: 24px;
  border-radius: 0;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s var(--spring);
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  background: transparent;
}

.premium-color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

.premium-color-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 0;
}

.premium-color-swatch::-moz-color-swatch {
  border: none;
  border-radius: 0;
}

.premium-color-swatch:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.color-picker-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.color-picker-group label {
  margin-bottom: 0 !important;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  text-align: left;
}

.palette-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.palette-presets .preset-btn {
  width: 100%;
  min-width: 0;
  padding: 8px 6px;
}

/* Pixel Size Pills Layout */
.pixel-size-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-start;
}

.pixel-size-pills .preset-btn {
  width: 36px;
  min-width: 36px;
}

.preset-btn {
  padding: 8px;
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: 0;
  color: var(--gray-400);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s var(--fast);
  text-align: center;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preset-btn:hover {
  border-color: var(--gray-700);
  color: var(--gray-300);
  background: var(--gray-800);
}

.preset-btn.active {
  background: linear-gradient(145deg, var(--gray-800), rgba(36, 36, 36, 0.95));
  border-color: var(--gray-600);
  color: var(--white);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.preset-btn.active:hover {
  background: var(--gray-700);
  color: var(--gray-100);
  border-color: var(--gray-500);
}

/* Format Grid */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.format-btn {
  padding: 8px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  backdrop-filter: blur(8px) saturate(180%);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.format-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* FIXED: Selected format buttons - subtle indicator */
.format-btn.active {
  background: linear-gradient(145deg, var(--gray-800), rgba(36, 36, 36, 0.95));
  border-color: var(--gray-600);
  color: var(--white);
  position: relative;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}


/* Button Row Layout */
.button-row {
  display: flex;
  gap: 8px;
  margin-top: var(--space-md);
}

/* Force copy and upload buttons to be 50% width side by side */
.desktop-only.button-row,
#effects .button-row.desktop-only {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  margin-top: 16px !important;
}

.desktop-only.button-row .action-button,
#effects .button-row.desktop-only .action-button {
  flex: 1 !important;
  width: calc(50% - 4px) !important;
  max-width: calc(50% - 4px) !important;
  min-width: 0 !important;
  margin-top: 0 !important;
}

/* Desktop/Mobile element visibility */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

/* Action button styling */
.action-button {
  width: 100%;
  height: 36px;
  padding: 8px;
  margin-top: var(--space-md);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  position: relative;
  backdrop-filter: blur(8px) saturate(180%);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.action-button:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.action-button:active {
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(0);
  box-shadow: 
    0 1px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Differentiate Primary (Download) Button */
.action-button.primary {
  background: #ffffff;
  color: var(--black);
  border: 1px solid #ffffff;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-button.primary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.action-button.primary:active {
  background: var(--gray-900);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(0);
}


/* Premium Canvas Overlay Controls */
/* Canvas overlay controls - position relative to image preview area */
.canvas-overlay-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1000;
}

/* Hide all overlay groups except zoom on desktop */
.canvas-overlay-controls .overlay-group {
  display: none;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Show zoom controls on desktop */
.canvas-overlay-controls .overlay-zoom {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Show right overlay on desktop (before/after, undo/redo) */
.canvas-overlay-controls .overlay-right {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* On desktop, position overlay-right on the LEFT side (away from panel) */
@media (min-width: 769px) {
  .canvas-overlay-controls .overlay-right {
    right: auto !important;
    left: 16px;
  }
}

/* Hide upload/download overlay on desktop — redundant with panel buttons */
#uploadOverlayButton,
#downloadOverlayButton {
  display: none;
}

.overlay-group {
  position: absolute;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.overlay-left {
  top: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 0;
  gap: 0;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
}


.overlay-right {
  top: 16px;
  right: 16px;
  display: flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
}

.overlay-top-left {
  top: 16px;
  left: 16px;
  display: none; /* Hidden on desktop */
}

.overlay-zoom {
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  position: absolute;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.3),
    inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
}

/* Desktop zoom button styling */
.zoom-btn {
  width: 34px !important;
  height: 34px !important;
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 0 !important;
  color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: none !important;
  transition: color 0.15s ease, background 0.15s ease !important;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.95) !important;
  transform: none;
  box-shadow: none !important;
}

.zoom-btn:active {
  background: rgba(255, 255, 255, 0.05) !important;
  transform: none;
  box-shadow: none !important;
}

.zoom-level {
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  min-width: 36px;
  text-align: center;
  background: transparent;
  padding: 4px 8px;
  border-radius: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.overlay-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: none;
  position: relative;
}

.overlay-btn:last-child {
  border-right: none;
}

.overlay-btn#downloadOverlayButton {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.overlay-btn#downloadOverlayButton:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: none;
}

.overlay-btn.small {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.overlay-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: none;
  transform: none;
}

.overlay-btn:active {
  background: rgba(255, 255, 255, 0.05);
  transform: none;
  box-shadow: none;
}

.overlay-btn-primary {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.overlay-btn-primary:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: none;
}

.overlay-btn-primary:active {
  background: rgba(255, 255, 255, 0.08);
}

.overlay-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}


/* Sticky Download Buttons */
.sticky-download {
  position: sticky;
  bottom: 0;
  background: var(--black);
  border-top: 1px solid var(--gray-900);
  z-index: 10;
}

/* Premium Checkbox */
input[type="checkbox"] {
  width: 12px;
  height: 12px;
  margin: 0 8px 0 0;
  cursor: pointer;
  accent-color: var(--white);
  vertical-align: middle;
  position: relative;
  top: -1px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
}

input[type="checkbox"]:checked {
  background: #E0E0E0;
  border-color: #FAFAFA;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 0;
  width: 5px;
  height: 8px;
  border: solid var(--black);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Notification styling */
@keyframes slideUp {
  0% {
    transform: translate(-50%, 20px);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

/* Hidden Utility */
.hidden {
  display: none !important;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* ASCII Output Styling */
#asciiOutput {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.0;
  color: var(--white);
  background: var(--black);
  padding: 20px;
  overflow: auto;
  white-space: pre;
  letter-spacing: 0.02em;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
  /* Let the parent flex container handle the centering */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Premium Scrollbar */
.tab-content::-webkit-scrollbar {
  width: 8px;
}

.tab-content::-webkit-scrollbar-track {
  background: var(--gray-950);
}

.tab-content::-webkit-scrollbar-thumb {
  background: var(--gray-800);
  border-radius: 0;
  border: 1px solid var(--gray-900);
}

.tab-content::-webkit-scrollbar-thumb:hover {
  background: var(--gray-700);
}

/* Premium Focus States */
*:focus-visible {
  outline: 2px solid var(--gray-600);
  outline-offset: 2px;
  border-radius: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .controls-panel {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 40vh !important;
    border-left: none;
    border-top: 1px solid var(--gray-900);
  }

  .image-preview {
    height: 60vh;
  }

  .image-container canvas {
    max-width: calc(100vw - 16px);
    max-height: calc(60vh - 16px);
    min-height: 200px;
    object-fit: contain;
  }

  .image-container pre {
    max-width: calc(100vw - 16px);
    max-height: calc(60vh - 16px);
    min-height: 200px;
  }

  /* Mobile ASCII output scaling */
  #asciiOutput {
    font-size: 6px !important; /* Smaller base font for mobile */
    line-height: 1.0 !important; /* Tight line height */
    padding: 10px !important; /* Reduced padding */
  }

  /* Canvas overlay controls */
  .canvas-overlay-controls {
    display: block !important; /* Show on mobile phones and tablets */
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
  }

  /* Show overlay groups on mobile/tablet */
  .canvas-overlay-controls .overlay-group {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Hide only control and adjust tab buttons on mobile - keep Export tab buttons visible */
  #control .action-button,
  #adjust .action-button {
    display: none;
  }
  
  /* Hide left overlay group on mobile */
  .overlay-left {
    display: none !important;
  }

  /* Mobile zoom button - top left */
  .overlay-top-left {
    display: flex !important;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 0;
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.3),
      inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
  }

  .mobile-zoom-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    padding: 16px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-zoom-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    display: block;
    color: inherit;
  }

  .mobile-zoom-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
  }

  /* Clean minimal mobile panel - horizontal layout */
  .overlay-right {
    top: 16px;
    right: 16px;
    flex-direction: row;
    gap: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;
    padding: 0;
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.3),
      inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
  }


  /* Hide zoom controls on mobile */
  .overlay-zoom {
    display: none !important;
  }

  /* Buttons inside grouped toolbar */
  .overlay-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
    cursor: pointer;
    font-size: 16px;
    box-shadow: none;
  }

  .overlay-btn:last-child {
    border-right: none;
  }

  .overlay-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: none;
    box-shadow: none;
  }

  .overlay-btn:active {
    background: rgba(255, 255, 255, 0.05);
    transform: none;
    box-shadow: none;
  }
  
  
  /* Hide blocky settings on mobile */
  #blockySettings,
  #circularBlockySettings {
    display: none !important;
  }
  
  /* Hide canvas overlay upload/download buttons on mobile - they look cheap */
  #uploadOverlayButton,
  #downloadOverlayButton {
    display: none !important;
  }

  /* Hide mobile-hide elements on mobile */
  .mobile-hide {
    display: none !important;
  }
  
  /* Mobile sliders - larger touch targets for better UX */
  input[type="range"] {
    width: 100%;
    height: 44px; /* Apple minimum touch target */
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    background: transparent;
    touch-action: manipulation;
    padding: 0;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 3px;
    background: transparent;
    border-radius: 0;
  }

  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #E0E0E0;
    border-radius: 0;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: -6.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #E0E0E0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  input[type="range"]::-moz-range-track {
    width: 100%;
    height: 3px;
    background: var(--gray-800);
    border: none;
    border-radius: 0;
  }
  
  .overlay-btn-primary {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    color: rgba(255, 255, 255, 0.9);
  }
  
}

/* Mobile devices - all phones */
@media
  only screen and (max-width: 480px),
  only screen and (max-device-width: 430px),
  only screen and (hover: none) and (pointer: coarse) {
  .tab-content {
    padding: 16px;
  }

  /* Standardize all button types with consistent padding and size */
  .tab {
    font-size: 11px;
    padding: 12px;
    font-weight: 600;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Make export buttons consistent with all other buttons */
  .format-btn {
    font-size: 11px;
    padding: 8px;
    font-weight: 600;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Make preset buttons consistent with all other buttons */
  .preset-btn {
    font-size: 11px;
    font-weight: 600;
    padding: 8px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile pixel size buttons - 6 per row for even layout (12 buttons total) */
  .pixel-size-pills {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px !important;
  }

  .pixel-size-pills .preset-btn {
    width: 100% !important;
    height: 40px !important;
    min-width: unset !important;
    font-size: 11px !important;
    padding: 8px !important;
  }

  /* Hide desktop elements and show mobile elements on mobile - ENSURE CONSISTENCY */
  .desktop-only,
  #copyButton,
  .button-row,
  #uploadButton,
  div.button-row,
  .button-row.desktop-only,
  #effects .button-row.desktop-only,
  .desktop-only.button-row,
  div.desktop-only.button-row,
  .control-group .button-row.desktop-only,
  .control-group #copyButton,
  .control-group #uploadButton {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }

  .mobile-only {
    display: block !important;
  }

  /* Force mobile upload button to show full width - same size as download */
  #uploadButtonMobile {
    display: block !important;
    width: 100% !important;
    height: 44px !important;
    margin-top: 16px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 12px !important;
  }

  /* Standardize all button sizes and fonts on mobile */
  .action-button {
    height: 44px !important;
    font-size: 11px !important;
    font-weight: 600;
    padding: 12px !important;
  }

  /* Make dropdown proper hierarchy - between buttons and labels */
  select {
    height: 40px !important;
    font-size: 11px !important;
    font-weight: 500;
    padding: 10px 28px 10px 12px !important;
  }

  /* Hide desktop elements and show mobile elements on mobile - MAXIMUM SPECIFICITY */
  .desktop-only,
  #copyButton,
  .button-row,
  #uploadButton,
  div.button-row,
  .button-row.desktop-only,
  #effects .button-row.desktop-only,
  .desktop-only.button-row,
  div.desktop-only.button-row,
  .control-group .button-row.desktop-only,
  .control-group #copyButton,
  .control-group #uploadButton {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }

  .mobile-only {
    display: block !important;
  }

  /* Force mobile upload button to show full width - same size as download */
  #uploadButtonMobile {
    display: block !important;
    width: 100% !important;
    height: 44px !important;
    margin-top: 16px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 12px !important;
  }

  /* HIDE DATA-MOBILE=HIDE ALGORITHMS ON PHONE ONLY */
  @media (max-width: 600px), (hover: none) and (pointer: coarse) {
    option[data-mobile="hide"] {
      display: none !important;
      visibility: hidden !important;
    }
  }

  /* Make mobile upload button full width */
  .mobile-only.action-button {
    width: 100% !important;
    flex: none !important;
  }

  /* REMOVED conflicting mobile upload button rules */

  /* Hide ASCII settings and output on mobile */
  #asciiColorSettings,
  #asciiOutput {
    display: none !important;
  }

  /* Fix tiny fonts for mobile readability */
  .palette-header,
  .color-label,
  #color3Container .color-label,
  .color-picker-group label,
  .tabs .tab {
    font-size: 10px !important;
  }

  /* ASCII output mobile font - make it visible */
  #asciiOutput {
    font-size: 9px !important;
    line-height: 1.0 !important;
    letter-spacing: 0.02em !important;
  }

  .control-group {
    padding: 16px;
    margin-bottom: 16px;
  }
}


/* Notification Animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Full-Screen Image Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.image-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.image-modal-overlay {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-modal-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.image-modal-content {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 80px;
}

.modal-canvas {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
  margin: 0 auto;
  transform-origin: center center;
  transition: transform 0.2s ease;
}

/* Remove grab cursor to prevent confusion about dragging */
.modal-canvas:active {
  cursor: default;
}

.modal-ascii {
  color: white;
  font-family: var(--mono);
  font-size: 6px;
  line-height: 1.0;
  white-space: pre;
  overflow: auto;
  max-width: 100%;
  max-height: 100%;
  text-align: center;
}

.modal-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.modal-zoom-btn {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: normal;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.modal-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.modal-zoom-level {
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  min-width: 40px;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 0;
  backdrop-filter: blur(8px);
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
  .control-group {
    border-width: 0.5px;
  }
}
/* Premium Notification Styles */
.notification {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--gray-900), var(--gray-950));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
  z-index: 10000;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  animation: slideUp 0.4s var(--smooth) forwards;
}

.notification-success {
  border-left: 3px solid #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), var(--gray-950));
}

.notification-error {
  border-left: 3px solid #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), var(--gray-950));
}

.notification-info {
  border-left: 3px solid var(--gray-400);
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

