/* main.css – Cyberpunk/Neon Theme Layout & Components */

/* CSS VARIABLES - ADD THIS SECTION AT THE TOP */
:root {
  /* Colors */
  --bg-body: #0A0E17;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-on-primary: #000000;
  --primary: #FF5E00;
  --primary-light: #FF8C42;
  --primary-rgb: 255, 94, 0;
  --success: #00FF41;  /* Matrix green */
  --danger: #FF4444;
  
  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #FF5E00, #00F3FF);
  
  /* Backgrounds */
  --panel-bg: #111827;
  --input-bg: #0A0E17;
  --bg-soft: #1E293B;
  
  /* Borders */
  --panel-border: #FF5E00;
  --border-subtle: #2D3748;
  --input-border: #2D3748;
  --input-border-focus: #FF5E00;
  --input-shadow-focus: 0 0 0 3px rgba(255, 94, 0, 0.2);
  
  /* Shadows */
  --shadow-soft: 0 1px 3px rgba(255, 94, 0, 0.2);
  --shadow-card: 0 4px 6px -1px rgba(255, 94, 0, 0.3);
  --shadow-elevated: 0 10px 15px -3px rgba(255, 94, 0, 0.4);
  
  /* Toasts */
  --toast-bg: #1E293B;
  --toast-text: #00F3FF;
  
  /* Transitions */
  --transition-fast: all 0.2s ease;
}

/* CYBERPUNK BACKGROUND GRID */
body {
  background: var(--bg-body);
  position: relative;
  overflow-x: hidden;
  font-family: 'Courier New', 'Inter', monospace, sans-serif;
  background-image: 
    linear-gradient(rgba(30, 41, 59, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 41, 59, 0.3) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
}

/* ANIMATED SCAN LINE */
.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    #00F3FF, 
    transparent);
  animation: scan 3s linear infinite;
  opacity: 0.3;
  pointer-events: none;
  z-index: 9999;
}

@keyframes scan {
  0% { top: 0; }
  100% { top: 100%; }
}

/* RESET & BASE STYLES */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

/* PAGE LAYOUT */
.page {
  min-height: 100vh;
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* HERO SECTION - UPDATED: Compact with CSS logo */
.hero {
  padding: 0 0 12px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* NEW CSS LOGO - UPDATED */






.hero-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.hero-title {
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 4px;
}

.hero-title span {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(255, 94, 0, 0.3);
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.5;
}

/* SETTINGS BUTTON */
.settings-btn {
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  background: rgba(255, 94, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--primary);
  box-shadow: var(--shadow-soft);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.settings-btn i {
  font-size: 14px;
}

.settings-btn:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
  box-shadow: 0 0 20px rgba(255, 94, 0, 0.4);
  transform: translateY(-2px);
}

/* WORKFLOW GRID */
.workflow {
  margin-top: 16px;
  flex: 1;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* STEP CARDS - CYBERPUNK STYLE */
.step-card {
  background: var(--panel-bg);
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  box-shadow: 
    0 0 20px rgba(255, 94, 0, 0.2),
    inset 0 0 20px rgba(0, 243, 255, 0.05);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: auto;
  position: relative;
  overflow: hidden;
}

.step-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  border-radius: inherit;
  background: linear-gradient(45deg, 
    var(--primary) 0%,
    var(--secondary) 50%,
    var(--primary) 100%);
  z-index: -1;
  opacity: 0.1;
}

.step-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.step-pill {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--primary);
  color: #000;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--secondary);
  box-shadow: 0 0 10px var(--primary);
}

.step-header-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
}

.step-header h2 {
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 0;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.step-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.step-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(0, 255, 65, 0.1);
  color: var(--success);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--success);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

/* CHIPS / EXAMPLES */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.chip {
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 94, 0, 0.1);
  padding: 8px 16px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.chip i {
  font-size: 14px;
  color: var(--primary);
}

.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
  box-shadow: 0 0 15px rgba(255, 94, 0, 0.3);
  transform: translateY(-2px);
}

/* AUTO-CONVERT */
.auto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: #2D3748;
  border-radius: 4px;
  position: relative;
  transition: var(--transition-fast);
  border: 1px solid var(--border-subtle);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 2px;
  background: var(--primary);
  top: 1px;
  left: 1px;
  box-shadow: 0 0 10px var(--primary);
  transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(255, 94, 0, 0.2);
  border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
}

.toggle-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 94, 0, 0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 5px rgba(255, 94, 0, 0.3);
}

/* VOICE INPUT/OUTPUT & CLEAR BUTTON */
.textarea-wrapper {
  position: relative;
  width: 100%;
  display: flex;
}

.textarea-buttons {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

.voice-input-btn,
.clear-input-btn,
.voice-output-btn {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid var(--primary);
  background: rgba(255, 94, 0, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
}

/* CLEAR BUTTON SPECIFIC STYLES - LEFT SIDE */
.clear-input-btn {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.1);
  color: var(--danger);
}

/* UNDO STATE FOR CLEAR BUTTON - FIXED (Issue #6) */
.clear-input-btn.undo-state {
  border-color: var(--secondary);
  background: rgba(0, 243, 255, 0.1);
  color: var(--secondary);
}

.voice-input-btn:hover,
.voice-output-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background: rgba(0, 243, 255, 0.1);
  box-shadow: 0 0 15px var(--secondary);
}

.clear-input-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(255, 68, 68, 0.2);
  box-shadow: 0 0 15px var(--danger);
  transform: translateY(-1px);
}

.clear-input-btn.undo-state:hover {
  border-color: var(--secondary);
  background: rgba(0, 243, 255, 0.2);
  box-shadow: 0 0 15px var(--secondary);
}

.voice-input-btn.recording,
.voice-output-btn.speaking {
  animation: pulse-glow 1.5s infinite;
  background: var(--primary);
  color: #000;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 5px var(--primary); }
  50% { box-shadow: 0 0 20px var(--primary); }
  100% { box-shadow: 0 0 5px var(--primary); }
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-top: 8px;
  border-radius: 4px;
  background: rgba(0, 243, 255, 0.1);
  color: var(--secondary);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.voice-status i {
  color: var(--secondary);
  text-shadow: 0 0 5px var(--secondary);
}

/* INPUTS & TEXTAREAS */
.field-block {
  margin-bottom: 16px;
}

.textarea-idea,
.output-textarea {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  padding: 12px;
  outline: none;
  transition: var(--transition-fast);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.textarea-idea {
  resize: none;
  min-height: 140px;
}

.field-block-output {
  flex: 1;
  margin-bottom: 16px;
  display: flex;
}

.output-textarea {
  flex: 1;
  resize: none;
  min-height: 200px;
  line-height: 1.5;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  padding-right: 60px;
}

textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.textarea-idea:focus,
.output-textarea:focus {
  border-color: var(--input-border-focus);
  box-shadow: 
    var(--input-shadow-focus),
    inset 0 0 15px rgba(0, 0, 0, 0.5);
  outline: none;
}

/* BUTTONS */
.btn-primary {
  border-radius: 4px;
  border: 1px solid var(--primary);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: var(--gradient-brand);
  color: var(--text-on-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 
    0 0 15px rgba(255, 94, 0, 0.4),
    inset 0 0 10px rgba(0, 243, 255, 0.2);
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 0 25px rgba(255, 94, 0, 0.6),
    inset 0 0 15px rgba(0, 243, 255, 0.3);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-full {
  width: 100%;
}

.btn-ghost-small {
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  font-size: 12px;
  background: rgba(255, 94, 0, 0.1);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.btn-ghost-small:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 94, 0, 0.3);
}

.btn-ghost-small.danger {
  border-color: rgba(255, 68, 68, 0.3);
  color: #FF4444;
  background: rgba(255, 68, 68, 0.1);
}

.btn-ghost-small.danger:hover {
  background: rgba(255, 68, 68, 0.2);
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

.btn-ghost {
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
  font-size: 14px;
  background: rgba(255, 94, 0, 0.1);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.btn-ghost:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 94, 0, 0.3);
}

/* TEMPLATES - UPDATED: Shortened with eye icon */
.template-section {
  margin: 16px 0 0 0;
}

.template-toggle {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 94, 0, 0.1);
  padding: 10px 16px;
  font-size: 14px;
  color: var(--primary);
  display: flex;
  align-items: left;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.template-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-toggle-eye {
  color: var(--secondary);
  font-size: 14px;
  transition: var(--transition-fast);
}

.template-toggle:hover .template-toggle-eye {
  color: var(--primary);
}

.template-toggle:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 94, 0, 0.3);
}

.templates-panel {
  margin-top: 12px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  padding: 16px;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 20px rgba(255, 94, 0, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.3);
}

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

.templates-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.templates-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.templates-sub {
  color: var(--text-muted);
  font-size: 12px;
}

.templates-actions-inline {
  display: flex;
  gap: 8px;
}

.input-search {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 8px 12px;
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.input-search:focus {
  border-color: var(--primary);
  box-shadow: 
    0 0 0 3px rgba(255, 94, 0, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.3);
  outline: none;
}

.template-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.template-category {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 94, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--primary);
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.template-category.active {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(255, 94, 0, 0.3);
}

.template-category:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.template-card {
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 14, 23, 0.8);
  padding: 12px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.template-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(255, 94, 0, 0.3);
  transform: translateY(-2px);
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.template-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.template-card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.template-card-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.template-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state i {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
  color: var(--primary);
}

/* PRESET SELECTOR – FIXED (SCROLL SAFE) */
.preset-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;

  /* 🔥 FIX */
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

/* Optional scrollbar styling */
.preset-selector::-webkit-scrollbar {
  height: 6px;
}

.preset-selector::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 6px;
}

.preset-option {
  flex: 0 0 auto;
  white-space: nowrap;

  border-radius: 4px;
  border: 1px solid rgba(255, 94, 0, 0.6);
  background: rgba(255, 94, 0, 0.18);
  padding: 8px 14px;

  display: flex;
  align-items: center;
  gap: 8px;

  cursor: pointer;
  transition: all 0.2s ease;

  color: #FFD6BF;
  font-size: 13px;

  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}
/* ACTIVE PRESET – CLEAR SELECTED STATE */
.preset-option.active {
  background: linear-gradient(
    135deg,
    #FF5E00 0%,
    #00F3FF 100%
  );

  color: #000; /* strong contrast */
  font-weight: 700;

  border-color: #00F3FF;

  box-shadow:
    0 0 12px rgba(255, 94, 0, 0.8),
    0 0 22px rgba(0, 243, 255, 0.6),
    inset 0 0 8px rgba(255, 255, 255, 0.35);

  transform: scale(1.05);
}

/* Ensure hover does NOT override active */
.preset-option.active:hover {
  background: linear-gradient(
    135deg,
    #FF5E00 0%,
    #00F3FF 100%
  );
  transform: scale(1.05);
}

.preset-option:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.3);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* OUTPUT FOOTER */
.output-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.output-actions {
  display: flex;
  gap: 8px;
}

/* HISTORY */
.history-panel {
  margin-top: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  padding: 16px;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 20px rgba(255, 94, 0, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#historyList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 14, 23, 0.8);
  cursor: pointer;
  transition: var(--transition-fast);
}

.history-item:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.1);
  transform: translateY(-2px);
}

.history-item-title {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-family: 'Courier New', monospace;
}

.history-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* LAUNCH BUTTONS - FIXED SHARP TEXT */
.launch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.launch-btn {
  width: 100%;
  border: none;
  border-radius: 4px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(17, 24, 39, 0.8);
  box-shadow: 
    0 0 10px rgba(255, 94, 0, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
}

.launch-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 
    0 0 20px rgba(255, 94, 0, 0.4),
    inset 0 0 15px rgba(0, 0, 0, 0.4);
  border-color: var(--primary);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.launch-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid;
  transition: all 0.3s ease;
  text-shadow: none;
  filter: none;
}

.launch-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.launch-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: none;
  filter: none;
}

.launch-sub {
  font-size: 12px;
  color: var(--text-muted);
  text-shadow: none;
  filter: none;
}

/* Launch button variants - SHARP TEXT VERSIONS */
.launch-chatgpt {
  background: rgba(116, 170, 156, 0.1);
  border-color: rgba(116, 170, 156, 0.3);
}
.launch-chatgpt .launch-icon {
  color: #74AA9C;
  background: rgba(116, 170, 156, 0.1);
  border: 1px solid rgba(116, 170, 156, 0.3);
}

.launch-claude {
  background: rgba(222, 115, 86, 0.1);
  border-color: rgba(222, 115, 86, 0.3);
}
.launch-claude .launch-icon {
  color: #DE7356;
  background: rgba(222, 115, 86, 0.1);
  border: 1px solid rgba(222, 115, 86, 0.3);
}

.launch-gemini {
  background: rgba(71, 150, 227, 0.1);
  border-color: rgba(71, 150, 227, 0.3);
}
.launch-gemini .launch-icon {
  color: #4796E3;
  background: rgba(71, 150, 227, 0.1);
  border: 1px solid rgba(71, 150, 227, 0.3);
}

.launch-perplexity {
  background: rgba(32, 128, 141, 0.1);
  border-color: rgba(32, 128, 141, 0.3);
}
.launch-perplexity .launch-icon {
  color: #20808D;
  background: rgba(32, 128, 141, 0.1);
  border: 1px solid rgba(32, 128, 141, 0.3);
}

.launch-deepseek {
  background: rgba(0, 243, 255, 0.1);
  border-color: rgba(0, 243, 255, 0.3);
}
.launch-deepseek .launch-icon {
  color: #00F3FF;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid rgba(0, 243, 255, 0.3);
}

.launch-copilot {
  background: rgba(25, 159, 215, 0.1);
  border-color: rgba(25, 159, 215, 0.3);
}
.launch-copilot .launch-icon {
  color: #199FD7;
  background: rgba(25, 159, 215, 0.1);
  border: 1px solid rgba(25, 159, 215, 0.3);
}

.launch-grok {
  background: rgba(255, 94, 0, 0.1);
  border-color: rgba(255, 94, 0, 0.3);
}
.launch-grok .launch-icon {
  color: #FF5E00;
  background: rgba(255, 94, 0, 0.1);
  border: 1px solid rgba(255, 94, 0, 0.3);
}

.launch-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  color: var(--text-secondary) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* LAUNCH HINT - REMOVED (Issue #5) */
.launch-hint {
  display: none; /* Hidden as per Issue #5 */
}

/* FOOTER - UPDATED */
.footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.footer-left,
.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer i {
  margin-right: 4px;
  color: var(--primary);
}

.dot {
  opacity: 0.6;
  color: var(--secondary);
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal {
  background: var(--panel-bg);
  border-radius: 8px;
  border: 1px solid var(--primary);
  box-shadow: 
    0 0 30px rgba(255, 94, 0, 0.3),
    0 0 60px rgba(0, 243, 255, 0.1);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 94, 0, 0.1);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--primary);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.input-text {
  width: 100%;
  border-radius: 4px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition-fast);
  font-family: 'Courier New', monospace;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.input-text:focus {
  border-color: var(--input-border-focus);
  box-shadow: 
    var(--input-shadow-focus),
    inset 0 0 10px rgba(0, 0, 0, 0.5);
  outline: none;
}

.form-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

/* NOTIFICATION */
.notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(30, 41, 59, 0.95);
  color: var(--secondary);
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 
    0 0 20px rgba(0, 243, 255, 0.3),
    inset 0 0 10px rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 1001;
  border: 1px solid var(--secondary);
  backdrop-filter: blur(10px);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.notification i {
  color: var(--success);
  text-shadow: 0 0 5px var(--success);
}

/* CARD ACTIONS */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}

.converted-badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(0, 255, 65, 0.1);
  color: var(--success);
  border: 1px solid var(--success);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

/* STATS ROW */
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.stats-row span {
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 94, 0, 0.05);
  border: 1px solid rgba(255, 94, 0, 0.1);
}

/* Expand buttons */
.expand-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 94, 0, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(5px);
  text-transform: uppercase;
  font-family: 'Courier New', monospace;
}

.expand-btn:hover {
  border-color: var(--primary);
  background: rgba(255, 94, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 94, 0, 0.4);
  transform: scale(1.1);
}

.expand-btn.expanded {
  background: rgba(0, 243, 255, 0.2);
  border-color: var(--secondary);
  color: var(--secondary);
}

.expand-btn.expanded:hover {
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

/* Expand overlay */
.expand-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 999;
  display: none;
}

/* Size info */
.size-info {
  position: absolute;
  top: 12px;
  right: 50px;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(10, 14, 23, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: none;
}

/* Textarea expanded mode */
.textarea-expanded {
  position: fixed !important;
  top: 50px !important;
  left: 50px !important;
  right: 50px !important;
  bottom: 50px !important;
  width: auto !important;
  height: auto !important;
  z-index: 1000 !important;
  background: var(--panel-bg) !important;
  border: 2px solid var(--primary) !important;
  box-shadow: 
    0 0 40px rgba(255, 94, 0, 0.5),
    0 0 80px rgba(0, 243, 255, 0.3) !important;
  resize: none !important;
  max-height: none !important;
  min-height: auto !important;
  font-size: 16px !important;
  padding: 20px !important;
}

.textarea-expanded + .expand-btn {
  position: fixed;
  top: 60px;
  right: 60px;
  z-index: 1001;
  background: rgba(255, 94, 0, 0.3);
}

/* Responsive adjustments for resize features */
@media (max-width: 768px) {
  .textarea-expanded {
    top: 20px !important;
    left: 20px !important;
    right: 20px !important;
    bottom: 20px !important;
  }
  
  .expand-btn {
    top: 8px;
    right: 8px;
  }
  
  .size-info {
    top: 8px;
    right: 46px;
    font-size: 9px;
    padding: 3px 6px;
  }
}

/* === ENHANCED AI TOOL RANKING UI === */



@keyframes glow-pulse {
  0% { box-shadow: 0 0 8px rgba(0,255,65,.8); }
  50% { box-shadow: 0 0 15px rgba(0,255,65,1); }
  100% { box-shadow: 0 0 8px rgba(0,255,65,.8); }
}

.launch-btn.best-match {
  border-color: #00FF41 !important;
  box-shadow: 0 0 16px rgba(0,255,65,.5);
  position: relative;
}

.launch-btn.best-match::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, 
    rgba(0,255,65,0.2), 
    rgba(0,243,255,0.2),
    rgba(0,255,65,0.2));
  border-radius: inherit;
  z-index: -1;
  animation: border-glow 3s infinite linear;
}

@keyframes border-glow {
  0% { opacity: 0.3; }
  50% { opacity: 0.7; }
  100% { opacity: 0.3; }
}

/* Match score indicator */
.match-score {
  position: absolute;
  top: 6px;
  left: 8px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  color: #000;
  background: linear-gradient(135deg, #FF5E00, #FF8C42);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 2;
}

/* Ranking explanation */
.ai-ranking-explanation {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--secondary);
  background: rgba(0,243,255,.08);
  border: 1px solid rgba(0,243,255,.35);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}

.ai-ranking-explanation.hidden {
  display: none;
}

/* ================================
   Intent Detection Chips (Card 1)
================================ */

.intent-row {
  margin-top: 10px;
  width: 100%;
}

.intent-scroll {
  display: flex;
  align-items: center;
  gap: 8px;

  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;

  padding-bottom: 6px;
  scrollbar-width: thin;
}

.intent-scroll::-webkit-scrollbar {
  height: 6px;
}

.intent-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.intent-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 6px;
}

/* Individual chip styling */
.intent-chip {
  flex: 0 0 auto;

  padding: 6px 10px;
  border-radius: 999px;

  font-size: 12px;
  font-weight: 500;

  color: #ffffff;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);

  backdrop-filter: blur(6px);
}

/* ================================
   FINAL STABLE TEXTAREA + CARD LAYOUT
================================ */

.step-card {
  display: flex;
  flex-direction: column;
  min-height: 550px;
}

.step-card .textarea-idea,
.step-card .output-textarea {
  flex: 1;
  min-height: 0;
  resize: vertical;

  background: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--input-border);
  border-radius: 4px;

  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
}

/* Prevent resize artifact line */
.step-card textarea {
  overflow: auto;
}

/* Push footer buttons to bottom */
.step-card .template-section,
.step-card .output-footer {
  margin-top: auto;
}

/* ================================
   CUSTOM TOOLTIP FOR AI TOOLS (Issue #5)
================================ */

.custom-tooltip {
  position: absolute;
  z-index: 9999;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 12px;
  max-width: 300px;
  box-shadow: 
    0 0 20px rgba(255, 94, 0, 0.4),
    0 10px 30px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  font-family: 'Courier New', monospace;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  animation: tooltip-fade 0.2s ease;
}

@keyframes tooltip-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 94, 0, 0.3);
}

.tooltip-header strong {
  font-size: 13px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tooltip-match {
  font-size: 10px;
  background: rgba(0, 255, 65, 0.2);
  color: var(--success);
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.tooltip-body {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.tooltip-reason {
  font-size: 11px;
  color: var(--secondary);
  background: rgba(0, 243, 255, 0.1);
  padding: 6px 8px;
  border-radius: 4px;
  margin: 8px 0;
  border-left: 3px solid var(--secondary);
}

.tooltip-reason i {
  margin-right: 5px;
}

.tooltip-footer {
  font-size: 10px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 94, 0, 0.2);
  padding-top: 6px;
  margin-top: 8px;
}

.tooltip-footer i {
  color: var(--primary);
  margin-right: 4px;
}

/* Responsive */
@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .page {
    padding: 16px;
  }

  .hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .hero-brand {
    width: 100%;
    justify-content: space-between;
  }

  .hero-logo {
    width: 48px;
    height: 48px;
  }

  .logo-text {
    font-size: 20px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-title-block {
    flex: 1;
  }

  .settings-btn {
    align-self: flex-end;
    margin-top: -60px;
  }

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

  .step-card {
    min-height: 500px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

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

  .modal {
    width: 95%;
    margin: 10px;
  }
  
  .textarea-expanded {
    top: 10px !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
  }
  
  /* Hide tooltips on mobile */
  .custom-tooltip {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .page {
    padding: 12px;
  }
  
  .hero-logo {
    width: 44px;
    height: 44px;
  }
  
  .logo-text {
    font-size: 18px;
  }
  
  .hero-title {
    font-size: 20px;
  }
  
  .step-card {
    padding: 16px;
  }
  
  .chip-row {
    justify-content: center;
  }
  
  .chip {
    flex: 1;
    min-width: calc(50% - 8px);
    justify-content: center;
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .preset-option {
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .launch-btn {
    padding: 10px 12px;
  }
  
  .launch-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .launch-name {
    font-size: 13px;
  }
  
  .launch-sub {
    font-size: 11px;
  }
  
  .textarea-idea,
  .output-textarea {
    min-height: 100px;
    font-size: 13px;
    padding: 10px 40px 10px 10px;
  }
  
  .textarea-buttons {
    bottom: 8px;
    left: 8px;
    right: 8px;
  }
  
  .voice-input-btn,
  .clear-input-btn,
  .voice-output-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  
  .settings-btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .btn-primary {
    padding: 10px 20px;
    font-size: 13px;
  }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
  .step-card {
    min-height: 400px;
  }
  
  .textarea-idea {
    min-height: 80px;
  }
  
  .output-textarea {
    min-height: 120px;
  }
}

/* CARD LAYOUT OPTIMIZATION */
.cards-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  gap: 24px;
}

.chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 16px;
  justify-content: space-between;
}

.chip {
  flex: 1;
  min-width: 0;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 94, 0, 0.1);
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
  text-align: center;
}

.chip i {
  font-size: 12px;
}

/* Adjust third card content to fit better */
.step-card:nth-child(3) .launch-list {
  gap: 10px;
}

.step-card:nth-child(3) .launch-btn {
  padding: 10px 14px;
}

.step-card:nth-child(3) .launch-icon {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.step-card:nth-child(3) .launch-name {
  font-size: 13px;
}

.step-card:nth-child(3) .launch-sub {
  font-size: 11px;
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .chip-row {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .chip {
    flex: 0 0 calc(50% - 5px);
    min-width: auto;
    margin-bottom: 8px;
  }
}

@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .chip {
    flex: 0 0 100%;
  }
}

@media (max-width: 480px) {
  .chip {
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .chip i {
    font-size: 11px;
  }
  
  .step-card:nth-child(3) .launch-btn {
    padding: 8px 12px;
  }
}
/* Fix for best match tag positioning */
.launch-btn.best-match {
  position: relative;
  padding-top: 10px; /* Make room for the tag */
}

.match-score {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
  z-index: 10;
}

/* =================================== */
/* FIXED: Best Match Tag Positioning   */
/* =================================== */

/* Override the earlier conflicting styles */
.launch-btn.best-match {
  position: relative;
  padding-top: 10px; /* Make room for the tag above */
  margin-top: 4px;
  min-height: 56px; /* Ensure enough height */
}

/* Fix position: TOP CENTER instead of top right */
.best-match-tag {
  position: absolute !important;
  top: -10px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: linear-gradient(135deg, #00FF41, #00F3FF) !important;
  color: #000 !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 3px 10px !important;
  border-radius: 12px !important;
  white-space: nowrap !important;
  z-index: 10 !important;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.8) !important;
  border: 2px solid #000 !important;
  pointer-events: none !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-family: 'Courier New', monospace !important;
  text-align: center !important;
  min-width: 100px !important;
}

/* Match score position - ABOVE the best match tag */
.match-score {
  position: absolute !important;
  top: -24px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: linear-gradient(135deg, #FF5E00, #FF8C42) !important;
  color: #000 !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
  z-index: 11 !important;
  border: 1px solid #000 !important;
  pointer-events: none !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-family: 'Courier New', monospace !important;
}
/* =================================== */
/* FIX: Clear/Undo Button States       */
/* =================================== */
#clearInputBtn.undo-state {
  background: linear-gradient(135deg, #00F3FF 0%, #00A3B5 100%) !important;
  color: #000 !important;
  border-color: #00F3FF !important;
}

#clearInputBtn.undo-state:hover {
  background: linear-gradient(135deg, #00A3B5 0%, #007A8A 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.5) !important;
}

/* =================================== */
/* FIX: Hide Converted Badge When Empty */
/* =================================== */
.converted-badge:empty {
  display: none !important;
}

.converted-badge.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* =================================== */
/* FIX: Ensure Card2 & Card3 Reset When Empty */
/* =================================== */
#output:empty ~ .output-footer .converted-badge {
  display: none !important;
}

#output:empty + .output-actions button {
  opacity: 0.6 !important;
  pointer-events: none !important;
}

/* =================================== */
/* FIX: Prevent Tooltip Overlap */
/* =================================== */
.custom-tooltip {
  max-width: 280px !important;
  word-wrap: break-word !important;
  white-space: normal !important;
  line-height: 1.4 !important;
  pointer-events: none !important;
}

/* Ensure tooltip doesn't overlap button text */
.launch-btn {
  overflow: visible !important;
}

.launch-btn:hover .launch-text {
  z-index: 1 !important;
  position: relative !important;
}
/* ===========================================
   CIRCUIT BOARD LOGO (Your Selection)
=========================================== */

.hero-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.9);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 20px rgba(255, 94, 0, 0.5),
    inset 0 0 15px rgba(0, 243, 255, 0.1);
}

/* Cyberpunk glow effect around the logo */
.hero-logo::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    var(--primary) 0%,
    var(--secondary) 50%,
    var(--primary) 100%);
  border-radius: inherit;
  z-index: -1;
  opacity: 0.3;
  animation: circuit-glow 3s infinite linear;
}

@keyframes circuit-glow {
  0% { opacity: 0.2; }
  50% { opacity: 0.4; }
  100% { opacity: 0.2; }
}

/* Circuit container */
.logo-circuit {
  position: relative;
  width: 40px;
  height: 40px;
}

/* Circuit lines (orange) */
.circuit-line {
  position: absolute;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  animation: circuit-pulse 2s infinite;
  border-radius: 1px;
}

.circuit-horizontal {
  width: 30px;
  height: 3px;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
}

.circuit-vertical {
  width: 3px;
  height: 30px;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  animation-delay: 0.5s;
}

/* Circuit nodes (blue) */
.circuit-node {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--secondary);
  animation: node-pulse 2s infinite;
}

.circuit-node-1 { 
  top: 30%; 
  left: 30%; 
  animation-delay: 0s;
}
.circuit-node-2 { 
  top: 30%; 
  right: 30%; 
  animation-delay: 0.3s;
}
.circuit-node-3 { 
  bottom: 30%; 
  left: 30%; 
  animation-delay: 0.6s;
}
.circuit-node-4 { 
  bottom: 30%; 
  right: 30%; 
  animation-delay: 0.9s;
}

/* Animations */
@keyframes circuit-pulse {
  0%, 100% { 
    opacity: 0.4;
    box-shadow: 0 0 5px var(--primary);
  }
  50% { 
    opacity: 1;
    box-shadow: 0 0 15px var(--primary);
  }
}

@keyframes node-pulse {
  0%, 100% { 
    transform: scale(1);
    opacity: 0.7;
  }
  50% { 
    transform: scale(1.3);
    opacity: 1;
  }
}

/* Hover effect */
.hero-logo:hover .circuit-line {
  animation-duration: 0.5s;
  background: var(--secondary);
  box-shadow: 0 0 15px var(--secondary);
}

.hero-logo:hover .circuit-node {
  animation-duration: 0.5s;
  background: var(--primary);
  box-shadow: 0 0 15px var(--primary);
}

.hero-logo:hover::before {
  animation-duration: 1s;
  opacity: 0.5;
}
