/* ============================================
   Tailwind Class Sorter — Styles
   Theme: Dark mode with Indigo/Cyan palette
   ============================================ */

:root {
  --primary: #6366F1;
  --primary-dim: rgba(99, 102, 241, 0.15);
  --secondary: #94A3B8;
  --accent: #22D3EE;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --bg: #0F172A;
  --bg-card: rgba(15, 23, 42, 0.65);
  --bg-surface: #1E293B;
  --border: rgba(99, 102, 241, 0.12);
  --border-hover: rgba(99, 102, 241, 0.3);
  --text: #E2E8F0;
  --text-dim: #64748B;
  --danger: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 250ms ease;
  --font: 'Inter', system-ui, sans-serif;
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(34, 211, 238, 0.03) 0%, transparent 50%);
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-glow);
  padding: 1.5rem;
}

/* Header */
.header { padding: 1.5rem; text-align: center; border-bottom: 1px solid var(--border); }
.header-inner { max-width: 800px; margin: 0 auto; }
.logo { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.logo-icon { font-size: 1.75rem; }
.logo h1 {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.tagline { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.25rem; }

/* Main */
.main { max-width: 800px; margin: 0 auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.section-title { font-size: 1rem; font-weight: 600; color: var(--primary); margin-bottom: 0.5rem; }

/* Textarea */
.code-textarea {
  width: 100%; padding: 0.75rem; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--accent); font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem; line-height: 1.6; resize: vertical; min-height: 80px; transition: border-color var(--transition);
}
.code-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.input-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* Stats Bar */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.stat-item { text-align: center; padding: 0.75rem; }
.stat-number { display: block; font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

/* Output */
.output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.output-header .section-title { margin-bottom: 0; }
.output-box {
  padding: 0.75rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'SF Mono', monospace; font-size: 0.82rem; color: var(--accent); line-height: 1.8; word-wrap: break-word;
}

/* Grouped View */
.group-list { display: flex; flex-direction: column; gap: 0.5rem; }
.group-item { padding: 0.6rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.group-name { font-size: 0.78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
.group-classes {
  font-family: 'SF Mono', monospace; font-size: 0.78rem; color: var(--text); word-wrap: break-word;
}
.group-classes .cls { display: inline-block; padding: 0.1rem 0.4rem; margin: 2px; background: var(--primary-dim); border-radius: 4px; }

/* Diff View */
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.diff-pane { }
.diff-label { font-size: 0.78rem; font-weight: 700; color: var(--text-dim); margin-bottom: 0.35rem; }
.diff-content {
  padding: 0.6rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'SF Mono', monospace; font-size: 0.75rem; color: var(--text); line-height: 1.6; word-wrap: break-word;
}
.diff-content .moved { color: var(--warning); }
.diff-content .unchanged { color: var(--text-dim); }

/* Warnings */
.warning-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.warning-list li { padding: 0.4rem 0.6rem; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); border-radius: 6px; font-size: 0.82rem; color: var(--warning); }
.warning-list li.duplicate { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 1rem; border: none;
  border-radius: var(--radius-sm); font-family: var(--font); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #4F46E5); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35); }
.btn-accent { background: var(--accent); color: #0F172A; font-weight: 700; }
.btn-accent:hover { box-shadow: 0 4px 16px rgba(34, 211, 238, 0.35); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

/* Toast */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--primary); color: #fff; padding: 0.75rem 1.5rem; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  z-index: 1000; transition: transform 300ms ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* Footer */
.footer { text-align: center; padding: 1.5rem; color: var(--text-dim); font-size: 0.8rem; border-top: 1px solid var(--border); }

@media (max-width: 600px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .diff-grid { grid-template-columns: 1fr; }
}
