:root {
  --bg-dark: #0f0f0f;
  --bg-gradient-start: #1a1a1a;
  --bg-gradient-end: #050505;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.1);
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --accent-color: #6366f1; /* Indigo/Violet */
  --accent-glow: rgba(99, 102, 241, 0.4);
  --danger-color: #ef4444;
  --success-color: #10b981;
  --font-main: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --sidebar-width: 320px;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

/* Background Animation */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #000000 100%);
  z-index: -1;
}

.bg-animation::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(99, 102, 241, 0.05),
    transparent 60%
  );
  animation: bg-pulse 15s infinite ease-in-out;
}

@keyframes bg-pulse {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Glass Panel Utility */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 10;
  border-right: 1px solid var(--glass-border);
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -1px;
  background: linear-gradient(to right, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(165, 180, 252, 0.3);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Control Groups */
.control-group {
  margin-bottom: 24px;
}

.group-header h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  font-weight: 600;
}

.control-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  justify-content: space-between;
}

.control-row label {
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 0 0 80px;
}

/* Custom Inputs */
.range-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--accent-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.value-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 32px;
  text-align: center;
}

.glass-select,
.glass-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: 6px;
  font-family: var(--font-main);
  outline: none;
  flex: 1;
}

.glass-select:focus,
.glass-input:focus {
  border-color: var(--accent-color);
}

/* Toggles Row */
.toggles-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-wrapper:hover {
  background: rgba(255, 255, 255, 0.1);
}

.checkbox-wrapper input {
  margin-right: 8px;
  accent-color: var(--accent-color);
}

.checkbox-wrapper label {
  font-size: 0.8rem;
  cursor: pointer;
}

/* Buttons */
.action-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.glass-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  font-family: var(--font-main);
}

.glass-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.glass-button.primary {
  background: var(--accent-color);
  border-color: transparent;
  box-shadow: 0 0 15px var(--accent-glow);
}

.glass-button.primary:hover:not(:disabled) {
  background: #5558e6;
}

.glass-button.danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.glass-button.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.3);
}

.glass-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Main Content */
.main-content {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

/* Hero Drop Zone */
.drop-zone-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none; /* Let clicks pass through when hidden */
}

.drop-zone {
  width: 400px;
  height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
  opacity: 1;
  transform: scale(1);
}

/* When content is loaded, we hide the drop zone or move it */
.main-content.has-content .drop-zone {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}

.drop-content {
  text-align: center;
}

.icon-upload {
  color: var(--accent-color);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

.drop-zone h3 {
  font-size: 1.5rem;
  margin: 0 0 8px 0;
}

.drop-zone p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ASCII Output */
.ascii-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s;
}

.main-content.has-content .ascii-wrapper {
  opacity: 1;
}

#ascii-art {
  font-family: var(--font-mono);
  font-size: 8px; /* Dynamic font size handled by JS usually, but base here */
  line-height: 1;
  color: var(--text-primary);
  white-space: pre;
  text-align: center;
}

/* Floating Controls */
.floating-controls {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
}

.main-content.has-video .floating-controls {
  opacity: 1;
  pointer-events: auto;
  bottom: 40px;
}

.playback-info {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
}

.playback-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.glass-button.icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-wrapper input {
  display: none;
}

.toggle-wrapper label {
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.toggle-wrapper input:checked + label {
  color: var(--accent-color);
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

