@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* Deftech Brand Palette */
  --brand-blue-deep: #1e1b4b;
  /* Deep Blue */
  --brand-blue-mid: #3b82f6;
  /* Mid-Blue */
  --brand-green-accent: #39FF14;
  /* Electric Green */

  --primary: var(--brand-blue-mid);
  --primary-hover: #2563eb;
  --accent: var(--brand-green-accent);

  /* Dark Mode Defaults */
  --bg-gradient: radial-gradient(circle at top left, var(--brand-blue-deep), #030712);
  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-bg-heavy: rgba(10, 15, 30, 0.95);
  --glass-border: rgba(59, 130, 246, 0.2);
  /* Tinted with brand blue */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --container-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.light-mode {
  --bg-gradient: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-bg-heavy: #ffffff;
  /* Pure White Canvas */
  --glass-border: rgba(59, 130, 246, 0.15);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --container-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body.light-mode .glass-container {
  background: var(--glass-bg-heavy);
  border-color: rgba(59, 130, 246, 0.1);
}

body.light-mode .selector-container,
body.light-mode .visualizer-container {
  background: #fdfdfd;
  border-color: rgba(59, 130, 246, 0.1);
}

html {
  font-size: 12px;
  /* Scales whole 16px-based UI down by 25% */
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  display: block;
  overflow-x: hidden;
}

body.app-mode {
  height: 100vh;
  overflow: hidden;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.glass-container {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  width: 100%;
  max-width: 1200px;
  max-height: 100%;
  max-height: 100%;
  box-shadow: var(--container-shadow);
  display: flex;
  flex-direction: row;
  /* Horizontal layout for desktop */
  text-align: left;
  /* Reset alignment */
  overflow: hidden;
  /* Ensure content doesn't spill */
  /* Remove padding from container, move to children */
}

#admin-view {
  width: 100%;
}

#admin-view .glass-container {
  flex-direction: column;
  max-height: none;
  height: auto;
  max-width: 100%;
  padding: 2rem;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  /* Reduced padding slightly to match narrower width */
  background: rgba(0, 0, 0, 0.2);
  /* Slightly darker sidebar */
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.5rem 2rem 0.5rem;
  overflow-y: auto;
  min-width: 0;
  min-height: 0;
  /* Prevent flex overflow */
  position: relative;
  /* Anchor for absolute positioned user menu */
}

.main-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  width: 100%;

  /* Unified Panel Styling */
  background-color: rgba(0, 0, 0, 0.2);
  background-image: linear-gradient(to right, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.2));
  /* Match brand green for progress */
  background-repeat: no-repeat;
  background-size: var(--progress, 0%) 100%;
  border-radius: 12px;
  padding: 0 1.5rem;
  min-height: 4.5rem;
  position: relative;
  transition: background-size 0.3s ease;
  border: 1px solid var(--glass-border);
}

body.light-mode .main-top-row {
  background-color: #fdfdfd;
  border-color: rgba(59, 130, 246, 0.1);
  background-image: linear-gradient(to right, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.1));
}

/* User Menu Alignment */

#user-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 50;
  flex-shrink: 0;
  padding: 0.75rem 0;
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
    align-items: flex-start;
  }

  .glass-container {
    flex-direction: column;
    /* Stack vertically on mobile */
    height: auto;
    max-height: none;
    padding: 0;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
    flex-direction: column;
    gap: 1.5rem;
  }

  main {
    padding: 0.5rem 0.5rem 1.5rem 0.5rem;
    overflow: visible;
  }

  .sidebar-controls {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
  }
}

/* Sidebar Components */

.brand {
  margin-bottom: 2rem;
  position: relative;
  width: 100%;
}

#brand-logo {
  width: 50%;
  height: auto;
  display: block;
  margin: 0 auto 1.5rem auto;
}

.sidebar-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  /* Push footer down */
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-block {
  width: 100%;
  justify-content: flex-start;
  padding: 0.75rem 1rem;
}

.playback-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 20px -5px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  min-width: 120px;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Playback buttons override */

.playback-controls .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Equalizer Styles */

.eq-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s ease-in-out;
  max-height: 500px;
  overflow: hidden;
  flex-shrink: 0;
  /* Prevent vertical scaling */
}

.eq-container.collapsed {
  height: 48px;
  /* Fixed height for title bar */
  max-height: 48px;
  padding-bottom: 0.5rem;
  flex-shrink: 0;
  /* Prevent scaling when viewport is small */
}

.eq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
}

.btn-small {
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a5b4fc;
  padding: 0.15rem 0.5rem;
  /* Tighter padding */
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: white;
}

.btn-small.active {
  background: rgba(99, 102, 241, 0.4);
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

#eq-save {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

#eq-save:hover:not(.hidden) {
  background: rgba(34, 197, 94, 0.3);
  border-color: #22c55e;
  color: white;
}

#eq-delete {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

#eq-delete:hover:not(.hidden) {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: white;
}

#eq-preset-select {
  background: #1e1b4b;
  /* Solid dark background */
  color: #a5b4fc;
  cursor: pointer;
  outline: none;
}

#eq-preset-select option {
  background: #1e1b4b;
  color: #f8fafc;
  padding: 8px;
}

#eq-preset-select:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: white;
}

#eq-sliders {
  display: flex;
  justify-content: space-between;
  height: 120px;
  padding: 0 0.5rem;
  transition: all 0.3s ease-in-out;
  overflow: hidden;
  /* Removed overflow-x: auto */
  gap: 0.5rem;
  width: 100%;
}

.collapsed #eq-sliders {
  height: 0;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

#eq-toggle {
  transition: transform 0.3s ease;
}

.collapsed #eq-toggle {
  transform: rotate(-90deg);
}

.eq-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  /* Allow shrinking below content size for fluid scaling */
}

.eq-slider-container {
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
}

.eq-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transform: rotate(-90deg);
  border-radius: 2px;
}

body.light-mode .eq-slider {
  background: rgba(0, 0, 0, 0.15);
  /* Darker track for visibility on white */
}

.eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  border: 2px solid white;
}

.eq-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.status-panel {
  flex: 1;
  /* Redesigned to fit in unified top row */
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 1rem 0;
}

#status-message {
  color: #fbbf24;
  margin-bottom: 0.25rem;
}

body.light-mode #status-message {
  color: #b45309;
  /* Amber-700 for better contrast on light bg */
}

#cancel-container {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.4);
  color: white;
  border-color: #ef4444;
}

#file-info {
  color: var(--text-muted);
}

.selector-container {
  width: 100%;
  flex: 0 1 20vh;
  min-height: 90px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

#selector-canvas {
  width: 100%;
  height: 100%;
  cursor: col-resize;
}

.visualizer-container {
  width: 100%;
  flex: 0 1 calc(15vh + 56px + 32px);
  /* Added ~32px for header */
  min-height: 178px;
  /* 90px canvas + 56px piano + 32px header */
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease-in-out;
}

.visualizer-container.collapsed {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  flex: 0 0 48px;
  padding-bottom: 0px;
}

.visualizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  height: 48px;
  flex-shrink: 0;
}

.collapsed #visualizer-toggle {
  transform: rotate(-90deg);
}

#visualizer-toggle {
  transition: transform 0.3s ease;
}

#visualizer-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
  transition: all 0.3s ease-in-out;
}

.collapsed #visualizer-content {
  height: 0;
  opacity: 0;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

#visualizer {
  width: 100%;
  flex: 1;
  min-height: 90px;
}

#piano-keyboard {
  height: 56px;
  flex-shrink: 0;
  /* Much taller */
  width: 100%;
  display: flex;
  border-top: 1px solid var(--glass-border);
  position: relative;
}

.key {
  flex: 1;
  height: 100%;
  box-sizing: border-box;
  transition: background-color 0.1s ease;
}

.key.white {
  background: rgba(255, 255, 255, 0.9);
  border-right: 0.1px solid rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.key.black {
  background: #1a1a1a;
  height: 60%;
  width: 0.8%;
  /* Narrower relative width */
  margin-left: -0.4%;
  margin-right: -0.4%;
  z-index: 2;
  border-radius: 0 0 2px 2px;
}

.key.white.active {
  background-color: var(--brand-green-accent) !important;
  opacity: var(--active-opacity, 1);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
  z-index: 10;
}

.key.black.active {
  background-color: #16a34a !important;
  /* Slightly darker green for black keys */
  box-shadow: 0 0 15px rgba(22, 163, 74, 0.8);
}

.key.chord-mark::after {
  content: '';
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  z-index: 20;
  pointer-events: none;
}

.key.black.chord-mark::after {
  bottom: 8px; /* Slightly lower on black keys to fit well */
  width: 6px;
  height: 6px;
}

.key {
  position: relative;
}

.key-label {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  font-size: 0.65rem;
  font-weight: 500;
  color: #94a3b8;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sensitivity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  border-radius: 2px;
  cursor: pointer;
}

body.light-mode .sensitivity-slider {
  background: rgba(0, 0, 0, 0.15);
}

.sensitivity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* Ascending Pixels branding decoration */

.ascending-pixels {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.pixel {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--brand-green-accent);
  bottom: -4px;
  border-radius: 1px;
  animation: ascend linear infinite;
}

@keyframes ascend {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  20% {
    opacity: 0.6;
  }

  80% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-60px);
    opacity: 0;
  }
}

.p1 {
  left: 10%;
  animation-duration: 3s;
  animation-delay: 0s;
}

.p2 {
  left: 30%;
  animation-duration: 4s;
  animation-delay: 1.5s;
}

.p3 {
  left: 50%;
  animation-duration: 2.5s;
  animation-delay: 0.5s;
}

.p4 {
  left: 70%;
  animation-duration: 5s;
  animation-delay: 2s;
}

.p5 {
  left: 90%;
  animation-duration: 3.5s;
  animation-delay: 1s;
}

.loading {
  animation: pulse 1.5s infinite ease-in-out;
}

/* Speed Controls */

.speed-controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
  /* Rely on parent flex gap of 1rem */
  gap: 0.3rem;
  /* Reduced from 0.6rem */
}

.control-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 700;
  opacity: 0.9;
}

/* Vertical Speed Slider */

.controls-wrapper {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.speed-controls-container.vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.12);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.speed-slider-wrapper.vertical {
  position: relative;
  height: 200px;
  /* Tall vertical slider */
  width: 60px;
  /* Reduced to bring ticks closer */
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}

.slider-tooltip {
  position: absolute;
  right: 120%;
  /* Float to the left of the slider (wrapper is centered) */
  background: var(--primary);
  /* Use primary color for tooltips to match thumb and labels */
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  border: 1px solid var(--glass-border);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 10;
  white-space: nowrap;
}

.speed-slider-wrapper:hover .slider-tooltip,
.speed-slider:active~.slider-tooltip,
.slider-tooltip.visible {
  opacity: 1;
}

#speed-tooltip,
#pitch-tooltip {
  background-color: var(--primary) !important;
}

.speed-ticks.vertical {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 30px;
  /* Ticks container */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  height: 180px;
}

.tick-group {
  position: absolute;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  /* Minimal gap */
  transform: translateY(50%);
  right: -8px;
  /* Push even closer/overlap slightly if needed to look right */
}

.tick-val {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.tick-mark {
  width: 6px;
  /* Slightly shorter mark */
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

body.light-mode .tick-val {
  color: #64748b;
}

body.light-mode .tick-mark {
  background: rgba(0, 0, 0, 0.3);
}

.speed-slider.vertical {
  transform: translate(-50%, -50%) rotate(-90deg);
  width: 180px;
  /* Length of the slider */
  height: 6px;
  /* Visual width (thickness) of the track - normal width */
  position: absolute;
  top: 50%;
  /* Centered visually */
  left: 75%;
  /* Shifted right to avoid text overlap */
  margin: 0;
}

.speed-slider-wrapper {
  width: 100%;
  max-width: 300px;
  padding: 0 10px;
}

.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  transition: all 0.2s;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  /* Half size (was roughly 20-24px visually) */
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
  transition: all 0.2s;
}

.speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: var(--primary-hover);
}

#pitch-slider {
  top: calc(50% + 4px);
  /* Nudge down to alignment perception */
}

#speed-label {
  color: #fff;
  margin-left: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

#speed-ticks,
.speed-ticks {
  display: flex;
  position: relative;
  width: 100%;
  height: 8px;
  margin-top: 4px;
}

body.light-mode #speed-label {
  color: #334155;
  /* Dark grey for visibility */
}

body.light-mode .speed-ticks .tick {
  background: rgba(0, 0, 0, 0.6);
}

body.light-mode #speed-reset {
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.speed-ticks .tick {
  position: absolute;
  width: 1px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-50%);
}

.selector-controls {
  display: flex;
  align-items: center;
  gap: 13px;
  /* Slightly increased distance */
  margin-bottom: 0.75rem;
  justify-content: flex-start;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

/* Header & Branding */

header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.brand {
  display: flex;
  flex-direction: column;
}

.brand h1 {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--brand-blue-mid) 0%, var(--brand-blue-deep) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.brand p {
  color: var(--text-base);
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Custom Dropdown Styling */

.custom-dropdown {
  position: relative;
  margin-top: 0.5rem;
  width: 100%;
  /* Fill sidebar width */
  min-width: 0;
  z-index: 10;
  margin-bottom: 1.5rem;
  /* Add spacing below the dropdown container */
}

.dropdown-trigger {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #a5b4fc;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
  /* Matches .brand p */
  gap: 0.5rem;
}

.dropdown-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(99, 102, 241, 0.4);
  color: white;
}

.dropdown-trigger .arrow {
  font-size: 0.7rem;
  opacity: 0.7;
}

.dropdown-options {
  position: relative;
  /* Push content down instead of overlay */
  top: 0;
  left: 0;
  width: 100%;
  background: var(--glass-bg-heavy);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.dropdown-option {
  padding: 0.5rem 0.8rem;
  color: #e2e8f0;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background: rgba(99, 102, 241, 0.2);
  color: white;
}

/* Light Mode Overrides for Custom Dropdown */

body.light-mode .dropdown-trigger {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

body.light-mode .dropdown-trigger:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: #0ea5e9;
  color: #0f172a;
}

body.light-mode .dropdown-options {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.light-mode .dropdown-option {
  color: #334155;
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .dropdown-option:hover {
  background: rgba(14, 165, 233, 0.1);
  color: #0f172a;
}

/* Light Mode Buttons */

body.light-mode .btn-secondary {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
  /* Slate 700 */
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .btn-secondary:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.1);
  color: #0f172a;
  /* Slate 900 */
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .btn-secondary:disabled {
  color: #94a3b8;
  /* Slate 400 */
  background: rgba(0, 0, 0, 0.03);
}

/* User Profile */

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
}

.credits-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: 0.5rem;
  padding-right: 1rem;
  border-right: 1px solid var(--glass-border);
}

.credits-text {
  font-weight: 600;
  color: #2ef075;
  /* Success/Green color for credits */
  font-family: 'JetBrains Mono', monospace;
}

body.light-mode .credits-text {
  color: #15803d;
  /* Darker green for readability on light bg */
}

.btn-icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  transition: all 0.2s ease;
}

.btn-icon-circle:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Admin Users Tab Styles */

.users-layout {
  display: flex;
  gap: 1.5rem;
  height: 500px;
}

.users-master {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  height: 100%;
}

.users-table-container {
  flex: 1;
  overflow-y: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  table-layout: fixed;
  font-family: 'Courier New', Courier, monospace;
}

.users-table th,
.users-table td {
  width: 16ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  /* We handle ellipsis in JS */
}

.users-table th {
  position: sticky;
  top: 0;
  background: rgba(60, 60, 110, 0.95);
  /* Lightened but still mostly opaque for scrolling */
  z-index: 10;
  padding: 1rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-color);
  border-bottom: 1px solid var(--glass-border);
}

.users-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.users-table th.sortable:hover {
  background: rgba(255, 255, 255, 0.1);
}

.users-table td {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.users-table tr:hover td {
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.users-table tr.selected td {
  background: rgba(64, 224, 208, 0.15);
  border-left: 3px solid var(--primary-color);
}

.users-detail {
  flex: 1.2;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.user-list-header,
.user-detail-header {
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--primary-color);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px 8px 0 0;
}

.user-list-header h3,
.user-detail-header h3 {
  font-size: 1.2rem;
  color: white;
  margin: 0;
  font-family: inherit;
}

.detail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
}

/* Beta Badge */

.beta-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff00cc, #333399);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(255, 0, 204, 0.5);
  vertical-align: middle;
}

.beta-badge.hidden {
  display: none;
}

.detail-grid {
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.activity-history {
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.detail-label {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 1rem;
}

.detail-value {
  font-size: 1rem;
}

.license-history {
  margin-top: 2rem;
}

.license-history h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.license-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.license-item:last-child {
  border-bottom: none;
}

.activity-history {
  margin-top: 2rem;
}

.activity-history h4 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.activity-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

.activity-type.creation {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.activity-type.login {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.activity-type.logout {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.activity-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.activity-details {
  font-size: 0.8rem;
  opacity: 0.7;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.sort-icon::after {
  content: ' ↕';
  opacity: 0.3;
}

th[data-dir="asc"] .sort-icon::after {
  content: ' ↑';
  opacity: 1;
}

th[data-dir="desc"] .sort-icon::after {
  content: ' ↓';
  opacity: 1;
}

.user-info {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.user-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

body.light-mode .user-trigger {
  border-color: rgba(0, 0, 0, 0.2);
  /* Make border visible in light mode */
  background: rgba(255, 255, 255, 0.5);
  /* Slightly more opaque background */
}

body.light-mode .user-trigger:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.3);
}

.user-info .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dropdown-arrow {
  font-size: 0.6rem;
  opacity: 0.5;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 200px;
  border-radius: 12px;
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  padding: 8px;
  z-index: 1000;
  text-align: left;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User Edit Mode Styles */

.user-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
}

.detail-grid.edit-mode {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.admin-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
}

.admin-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
}

.user-info {
  display: flex;
  flex-direction: row;
  /* Horizontal layout */
  align-items: center;
  gap: 1rem;
  position: relative;
  width: auto;
  /* Auto width */
}

#feedback-btn {
  margin-right: 0.5rem;
  width: auto;
  /* Reset width */
}

.switch-label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.admin-danger-zone {
  margin: 2rem 1.5rem 1.5rem 1.5rem;
  padding: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.05);
}

.admin-danger-zone h4 {
  color: #ef4444;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.admin-danger-zone p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.dropdown-header {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  font-size: 0.65rem;
  background: var(--primary);
  color: white;
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
}

.badge.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

.dropdown-item {
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 0.85rem;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

#user-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-tiny {
  padding: 2px 8px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.1);
}

.btn-tiny:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Login Modal */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  /* Darker overlay for better focus */
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 400px;
  padding: 30px;
  border-radius: 20px;
  background: var(--glass-bg-heavy);
  /* Near fully opaque to block background content */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-content h2 {
  margin: 0;
  font-size: 1.5rem;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.btn-close:hover {
  color: white;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 8px;
  opacity: 0.8;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.3);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.modal-actions .btn {
  flex: 1;
}

.auth-toggle {
  margin-top: 20px;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

.auth-toggle a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-toggle a:hover {
  text-decoration: underline;
}

/* Social Login */

.social-login-separator {
  margin: 24px 0;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-login-separator::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.social-login-separator span {
  background: #1e1b4b;
  /* Matches modal background */
  padding: 0 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  z-index: 1;
}

.social-login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-social {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
}

.btn-social:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-google .icon {
  color: #ea4335;
}

/* Utilities */

.hidden {
  display: none !important;
}

/* Alert Banners */

.alert-banner {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-banner.warning {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.2);
}

.alert-banner.success {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.2);
}

.btn-tiny {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: none;
  cursor: pointer;
}

.btn-tiny:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Admin Modal Tab UI */

.admin-tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0;
  cursor: pointer;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Admin Tabbed Interface */

.admin-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.admin-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.admin-tab-btn:hover {
  color: var(--text-main);
}

.admin-tab-btn.active {
  color: var(--primary);
}

.admin-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.admin-tab-content {
  display: none;
  animation: tabFadeIn 0.3s ease-out;
}

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

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Feedback Specific Styles */

#feedback-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

#feedback-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: white;
  transform: translateY(-1px);
}

#feedback-body {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all 0.2s;
}

#feedback-body:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

#char-count {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
}

.unverified-mode #feedback-btn {
  opacity: 0.5;
  pointer-events: none;
  filter: grayscale(1);
}

/* Feedback History Styles */

.feedback-history-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.feedback-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feedback-item-subject {
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.feedback-item-body {
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* User Filter Modal Styles */

#admin-filter-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
}

#admin-filter-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: white;
}

.switch-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.switch-label {
  font-size: 0.9rem;
  color: var(--text-main);
}

/* Light Mode Feedback Button Override */

body.light-mode #feedback-btn {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.5);
  /* Stronger border */
  color: #0284c7;
  /* Darker blue */
  /* Ensure height matches user trigger visually */
  padding-top: 5px;
  padding-bottom: 5px;
}

body.light-mode #feedback-btn:hover {
  background: rgba(14, 165, 233, 0.2);
  color: #0c4a6e;
}

/* =========================================
   Landing Page Styles
   ========================================= */

.landing-container {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  color: var(--text-main);
  background-image: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.8)), url('/assets/app-screenshot-BNKdDyYk.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 1.5rem;
  margin: 0 auto 4rem auto;
  width: 100%;
  max-width: 1200px;
}

.brand-small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
  font-size: 1rem;
}

.btn-text:hover {
  color: var(--text-main);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 5rem;
  line-height: 1.1;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
}

.text-gradient {
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Enhancing the gradient for the specific Simplified word */

.text-gradient {
  background: linear-gradient(to right, #4ade80, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 3rem;
  max-width: 600px;
}

.cta-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 6rem;
}

.btn-cta {
  background: var(--brand-blue-mid);
  color: white;
  font-size: 1.125rem;
  font-weight: 600;
  padding: 1rem 2.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-cta:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.7);
  background: #2563eb;
}

.btn-cta .arrow {
  transition: transform 0.3s;
}

.btn-cta:hover .arrow {
  transform: translateX(4px);
}

.cta-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  margin-bottom: 4rem;
}

.feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 24px;
  text-align: left;
  transition: transform 0.3s, background 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.feature-card .icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.landing-footer {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile Responsiveness */

@media (max-width: 768px) {
  .hero-title {
    font-size: 3.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .landing-container {
    padding: 0 1.5rem;
  }
}

/* Utilities */

.hidden {
  display: none !important;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   Footer Styles
   ========================================= */

.landing-footer {
  padding: 1rem 0 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: black;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Override existing centered footer text if needed */

.landing-footer {
  text-align: left;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #cbd5e1;
  /* Dimmer than main text but brighter than links */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--text-main);
}

.brand-col p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 200px;
}

.footer-bottom {
  text-align: center;
  padding: 0.5rem 0;
  margin: 0 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.6;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .footer-col {
    align-items: center;
  }

  .landing-footer {
    text-align: center;
  }

  .brand-col p {
    margin: 0 auto;
  }
}

/* Narrower feedback button */

#feedback-btn {
  padding: 0.4rem 0.75rem;
  /* Reduced horizontal padding */
  width: auto;
  min-width: 0;
  /* Allow shrinking */
}

/* Matching footer brand text hierarchy */

.footer-col .brand-small {
  color: #cbd5e1;
}

/* Magic Section Styles */

.magic-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  max-width: 900px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.magic-step {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(57, 255, 20, 0.1);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(57, 255, 20, 0.2);
}

.magic-step h4 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.magic-step p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .magic-section {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 3rem auto;
  }
}

.app-footer {
  margin-top: auto;
  padding: 1rem 0;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.app-footer .footer-links {
  display: flex;
  gap: 1.5rem;
}

.app-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: var(--primary);
}

.app-footer .footer-copyright {
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Responsive adjustment for footer */

@media (max-width: 768px) {
  .app-footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* App Content Container for sticky footer */

.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

/* Adjust main to fit inside app-content */

.glass-container main {
  padding-bottom: 0.5rem;
  /* Reduce bottom padding since footer is separate */
}

/* App Footer Styling Updates */

.app-footer {
  margin-top: 0;
  /* Remove auto margin as it's now flex-static at bottom */
  padding: 0.75rem 1rem;
  /* Add horizontal padding matching main */
  background: rgba(0, 0, 0, 0.1);
  /* Slight background distinction */
  flex-shrink: 0;
}