/* ===== ROOT VARIABLES ===== */
:root {
  --bg: #0a0a0a;
  --card: #141414;
  --elevated: #1a1a1a;
  --border: #262626;
  --border-light: #333333;
  --text: #ededed;
  --muted: #737373;
  --dim: #525252;
  --accent: #10b981;
  --accent-teal: #14b8a6;
  --accent-glow: rgba(16, 185, 129, 0.15);
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.015) 1px, transparent 0);
  background-size: 40px 40px;
}

::selection {
  background: rgba(16, 185, 129, 0.3);
  color: var(--text);
}

/* ===== NAV ===== */
.nav-blur {
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(10, 10, 10, 0.8);
}

/* ===== HERO ===== */
.hero-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.08) 0%, rgba(20, 184, 166, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.text-gradient {
  background: linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.scroll-indicator {
  animation: bounce-subtle 2s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-delayed {
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-triggered fade-in */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== CONVERTER CARD ===== */
.converter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 4px 40px rgba(0,0,0,0.4);
}

/* Format tabs */
.format-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  white-space: nowrap;
}

.format-tab:hover {
  color: var(--text);
}

.format-tab.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ===== BATCH TOGGLE ===== */
.batch-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.batch-toggle input {
  display: none;
}

.batch-toggle-track {
  width: 32px;
  height: 18px;
  background: var(--border);
  border-radius: 9px;
  position: relative;
  transition: background 0.2s ease;
}

.batch-toggle input:checked ~ .batch-toggle-track {
  background: var(--accent);
}

.batch-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--muted);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.batch-toggle input:checked ~ .batch-toggle-track .batch-toggle-thumb {
  transform: translateX(14px);
  background: white;
}

.pro-badge {
  font-size: 9px;
  font-weight: 700;
  font-family: 'Geist Mono', monospace;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ===== DROPZONE ===== */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.03);
}

.dropzone.drag-over .dropzone-icon {
  transform: translateY(-4px);
}

.dropzone-icon {
  transition: transform 0.3s ease;
  display: flex;
  justify-content: center;
}

/* ===== CONSOLE ===== */
.console-area {
  border-top: 1px solid var(--border);
}

.console-header {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.console-body {
  padding: 16px;
  min-height: 120px;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  font-family: 'Geist Mono', monospace;
}

.console-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0;
  animation: consoleFadeIn 0.3s ease-out forwards;
}

.console-line + .console-line {
  margin-top: 4px;
}

@keyframes consoleFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.console-line .prefix {
  color: var(--accent);
  user-select: none;
  flex-shrink: 0;
}

.console-line .msg {
  color: var(--muted);
}

.console-line .msg.success {
  color: var(--accent);
}

.console-line .msg.error {
  color: #ef4444;
}

.console-line .timestamp {
  color: var(--dim);
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
}

/* Console progress */
.console-progress {
  height: 3px;
  background: var(--border);
  overflow: hidden;
}

.console-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-teal));
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* ===== RESULT AREA ===== */
.preview-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: rgba(16, 185, 129, 0.9);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--border-light);
}

/* ===== STEP CARDS ===== */
.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.step-number {
  position: absolute;
  top: -12px;
  left: 24px;
  font-size: 11px;
  font-family: 'Geist Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  color: var(--accent);
}

/* ===== PRICING CARDS ===== */
.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.pricing-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pricing-card-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 40px rgba(16, 185, 129, 0.1);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--card) 60%);
}

.pricing-card-featured:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 12px 48px rgba(16, 185, 129, 0.15);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  font-family: 'Geist Mono', monospace;
  color: var(--bg);
  background: var(--accent);
  border-radius: 20px;
  padding: 3px 14px;
  white-space: nowrap;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  position: relative;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
}

/* ===== BATCH TOOLTIP ===== */
.batch-tooltip {
  position: fixed;
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  max-width: 260px;
  z-index: 60;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.batch-tooltip.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.batch-tooltip.hidden {
  display: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .converter-card .flex.flex-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .pricing-card-featured {
    order: -1;
  }
  
  h1 {
    font-size: 2.5rem !important;
  }
}

/* ===== CUSTOM CONSOLE SCROLLBAR ===== */
.console-body::-webkit-scrollbar {
  width: 4px;
}

.console-body::-webkit-scrollbar-track {
  background: transparent;
}

.console-body::-webkit-scrollbar-thumb {
  background: var(--dim);
  border-radius: 2px;
}

/* ===== FILE LIST IN CONSOLE ===== */
.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 12px;
  font-family: 'Geist Mono', monospace;
  color: var(--muted);
}

.file-item .file-icon {
  color: var(--accent);
}

/* ===== LOADING SPINNER ===== */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TYPING CURSOR ===== */
.typing-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}
