/* ===================================================================
   NLockReport Converter - Modern Dark Theme & Glassmorphism Design System
   =================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette */
  --bg-dark: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 32, 50, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.25);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accent Colors */
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-glow: rgba(56, 189, 248, 0.35);

  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.3);

  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);

  --accent-amber: #f59e0b;

  --danger: #ef4444;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background (GPU Cached & Performance Optimized) */
.app-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
  transform: translateZ(0);
}

.gradient-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.4;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.28) 0%, rgba(2, 132, 199, 0.1) 40%, transparent 70%);
  top: -120px;
  left: -120px;
}

.orb-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.24) 0%, rgba(124, 58, 237, 0.08) 40%, transparent 70%);
  bottom: -180px;
  right: -120px;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* Layout Container */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo-box {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(120deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-pulse {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pulse-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #34d399;
  border-radius: 50%;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid #34d399;
  animation: pulsePing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pulsePing {
  0% { transform: scale(0.9); opacity: 0.9; }
  70%, 100% { transform: scale(2.2); opacity: 0; }
}

.badge-info {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-code {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-family: var(--font-mono);
}

/* Quick Sample Bar */
.sample-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.75rem;
  backdrop-filter: blur(8px);
}

.sample-bar-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Cards (Glassmorphism) */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-normal);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.02);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.drop-zone:hover, .drop-zone.dragover, .drop-zone:focus-visible {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.15);
  transform: translateY(-2px);
  outline: none;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.upload-icon-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 0.5rem;
  transition: transform var(--transition-normal);
}

.drop-zone:hover .upload-icon-wrapper {
  transform: scale(1.1);
}

.upload-icon {
  width: 32px;
  height: 32px;
}

.drop-zone h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.browse-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 600;
}

.browse-link:hover {
  color: var(--primary-hover);
}

.supported-tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
}

/* Multi-File Queue Section */
.file-queue-section {
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.queue-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.queue-title-group h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.file-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 24, 38, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  gap: 1rem;
}

.file-item-card:hover {
  background: rgba(24, 32, 50, 0.95);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.file-item-card.active-file-item {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.file-select-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.file-item-card.active-file-item .file-select-dot {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.file-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon-box.server-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

.file-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.file-item-name-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.file-item-name-row strong {
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.preview-file-highlight {
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1.05rem;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.option-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.option-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.auto-detect-box {
  display: flex;
  align-items: center;
  height: 38px;
}

.form-control {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.form-control-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

/* Custom Checkbox */
.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem 0;
  user-select: none;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-box {
  width: 20px;
  height: 20px;
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.custom-checkbox input:checked ~ .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}

.custom-checkbox input:checked ~ .checkbox-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.checkbox-text strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  text-decoration: none;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-color);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Stats Section */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-blue {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.stat-icon-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.stat-icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.stat-icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-top: 0.2rem;
}

/* Preview Table */
.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.preview-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 420px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table thead {
  position: sticky;
  top: 0;
  background: #111726;
  z-index: 2;
}

.data-table th {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.data-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: #e2e8f0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.cell-mono {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.cell-amount {
  font-weight: 600;
  color: #34d399;
}

/* CLI Guide Block */
.code-block {
  margin-top: 1rem;
  background: #080c14;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  overflow-x: auto;
}

.code-block pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #cbd5e1;
}

.code-comment {
  color: #64748b;
}

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

/* Utilities */
.hidden {
  display: none !important;
}

.text-muted {
  color: var(--text-muted);
}

.text-sm {
  font-size: 0.8rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .active-file-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .file-action-buttons {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Spinner Animation (GPU accelerated) */
.spin-icon {
  animation: spin 1s linear infinite;
}

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