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

:root {
  --bg-primary: #F5F3EF;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #EBE8E3;
  --bg-elevated: #FAFAF8;
  --border-color: #E5E5E5;
  --border-subtle: #F0F0F0;
  --text-primary: #000000;
  --text-secondary: #525252;
  --text-tertiary: #737373;
  --accent-blue: #3B82F6;
  --accent-green: #248536;
  --accent-red: #EF4444;
  --accent-yellow: #F59E0B;
  --accent-purple: #8B5CF6;
  --success: #248536;
  --warning: #F59E0B;
  --error: #EF4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Welcome Screen */
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.welcome-content {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.welcome-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.welcome-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.welcome-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.5;
}

.welcome-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.welcome-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.welcome-note {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 16px;
}

/* Global Link Styles */
a {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--text-tertiary);
  text-underline-offset: 2px;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--text-secondary);
  text-decoration-color: var(--text-primary);
}

/* Header and footer links override */
.header a,
.footer-links a {
  text-decoration: none;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 80px;
  right: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-secondary);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 10000;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  max-width: 360px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: var(--error);
}

.toast.warning {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(255, 255, 255, 0.95);
  color: var(--warning);
}

.toast.info {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.version {
  font-size: 12px;
  color: var(--text-secondary);
}

.header-right {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
  font-weight: 500;
}

.btn-primary:hover:not(:disabled) {
  background: #2563EB;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--text-tertiary);
}

.btn-success {
  background: var(--success);
  color: white;
  font-weight: 500;
}

.btn-success:hover:not(:disabled) {
  background: #1a6b2a;
}

.btn-danger {
  background: var(--error);
  color: white;
  font-weight: 500;
}

.btn-danger:hover:not(:disabled) {
  background: #DC2626;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-secondary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.checkbox-label input {
  cursor: pointer;
}

/* File Tree */
.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.file-tree::-webkit-scrollbar {
  width: 6px;
}

.file-tree::-webkit-scrollbar-track {
  background: transparent;
}

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

.file-tree::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.file-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.file-item:hover {
  background: var(--bg-tertiary);
}

.file-item.active {
  background: var(--bg-elevated);
  color: var(--accent-blue);
  font-weight: 500;
}

.file-item.transformed {
  color: var(--success);
}

.file-item.pending {
  color: var(--warning);
}

.file-item.skipped {
  color: var(--text-secondary);
  text-decoration: line-through;
}

.folder-item {
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.folder-item:hover {
  background: var(--bg-tertiary);
}

.folder-children {
  padding-left: 16px;
}

.folder-children.collapsed {
  display: none;
}

/* Tree View Toggle */
.tree-toggle-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tree-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
}

/* Next.js Tree View Styles */
.file-item.unspecified {
  color: var(--error);
}

.file-item.unspecified:hover {
  background: rgba(239, 68, 68, 0.08);
}

.file-item.asset-file {
  color: var(--text-tertiary);
  font-style: italic;
}

.unspecified-badge {
  display: none;
}

.folder-item.unspecified-folder {
  color: var(--error);
  font-weight: 600;
}

.folder-item.collapsed + .folder-contents {
  display: none;
}

/* Keyboard Shortcuts Hint */
.keyboard-hint {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 10px;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
  animation-delay: 2s;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.keyboard-hint kbd {
  display: inline-block;
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', monospace;
  font-size: 9px;
  margin: 0 1px;
  font-weight: 500;
}

/* Interactive Tour */
.tour-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9998;
  pointer-events: none;
}

.tour-highlight {
  position: relative;
  z-index: 9999 !important;
  box-shadow: 0 0 0 3px var(--text-primary), 0 0 0 9999px rgba(0, 0, 0, 0.75) !important;
  border-radius: 6px;
}

.tour-tooltip {
  position: fixed;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

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

.tour-step-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tour-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1;
}

.tour-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.tour-content h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.tour-content p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.tour-nav {
  display: flex;
  gap: 6px;
}

.tour-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.tour-skip {
  background: transparent;
  color: var(--text-tertiary);
  padding: 6px 10px;
}

.tour-skip:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.tour-prev {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.tour-prev:hover {
  background: var(--bg-elevated);
}

.tour-next {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.tour-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tour-arrow {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transform: rotate(45deg);
}

/* Guide Overlay - Keep for backwards compatibility */
.guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.guide-modal {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
}

.guide-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 32px;
  color: var(--text-tertiary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.guide-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.guide-modal h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

.guide-steps {
  margin-bottom: 24px;
}

.guide-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.step-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--text-primary);
  color: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.step-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.step-content p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.step-content kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  margin: 0 2px;
}

.guide-got-it {
  width: 100%;
  padding: 14px;
  background: var(--text-primary);
  color: var(--bg-secondary);
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.guide-got-it:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.guide-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  justify-content: center;
}

.guide-checkbox input {
  cursor: pointer;
}

.guide-tips {
  background: var(--bg-tertiary);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 13px;
}

.guide-tips strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.guide-tips ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-secondary);
}

.guide-tips li {
  margin-bottom: 6px;
  line-height: 1.5;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
}

.stats {
  display: flex;
  justify-content: space-around;
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Editor Panel */
.editor-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.editor-tabs {
  display: flex;
  gap: 4px;
}

.tab-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
  color: var(--text-primary);
  font-weight: 500;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.badge {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.high {
  background: rgba(36, 133, 54, 0.15);
  color: var(--success);
  border: 1px solid rgba(36, 133, 54, 0.3);
}

.badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge.low {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Editor Container */
.editor-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.editor-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
}

.editor-view.active {
  display: flex;
}

#splitView {
  display: none;
  gap: 1px;
  background: var(--border-color);
}

#splitView.active {
  display: flex;
}

.editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.pane-header {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.editor {
  flex: 1;
}

/* Editor Actions */
.editor-actions {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.action-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.folder-select {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  min-width: 160px;
  transition: all 0.2s ease;
}

.folder-select:hover {
  background: var(--bg-elevated);
  border-color: var(--border-color);
}

.folder-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-elevated);
}

.spacer {
  flex: 1;
}

/* Footer */
.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Diagnostics Panel */
.diagnostics-panel {
  width: 260px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-size: 13px;
  font-weight: 600;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-track {
  background: transparent;
}

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

.panel-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

.diagnostic-item {
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.diagnostic-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-tertiary);
}

.diagnostic-item.warning {
  border-color: var(--warning);
  background: var(--bg-secondary);
}

.diagnostic-item.error {
  border-color: var(--error);
  background: var(--bg-secondary);
}

.diagnostic-item.success {
  border-color: var(--success);
  background: var(--bg-secondary);
}

.diagnostic-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.diagnostic-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.pattern-list {
  margin-top: 12px;
}

.pattern-item {
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  border: 1px solid var(--border-color);
}

.pattern-name {
  font-weight: 600;
  color: var(--accent-green);
  margin-bottom: 4px;
}

.pattern-detail {
  color: var(--text-secondary);
  font-size: 11px;
}

/* Routing Guide */
.routing-guide {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  max-height: 300px;
  transition: max-height 0.3s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.routing-guide.collapsed {
  max-height: 48px;
}

.guide-header {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.guide-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.routing-guide.collapsed .toggle-btn {
  transform: rotate(180deg);
}

.guide-content {
  padding: 0 20px 20px;
  overflow-y: auto;
  max-height: 240px;
}

.guide-step {
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
}

.step-number {
  display: inline-block;
  width: 24px;
  height: 24px;
  background: var(--accent-blue);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 8px;
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-content {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.file-mapping {
  background: var(--bg-primary);
  padding: 8px;
  border-radius: 4px;
  margin-top: 8px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
}

.mapping-item {
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mapping-arrow {
  color: var(--accent-blue);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-secondary);
  text-align: center;
  padding: 40px;
}

.empty-state h2 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 8px;
}

.empty-state .hint {
  font-size: 12px;
  color: var(--text-secondary);
}

#editorEmptyState {
  display: none;
}

#editorEmptyState.active {
  display: flex;
}

/* Responsive */
@media (max-width: 1200px) {
  .diagnostics-panel {
    width: 280px;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 240px;
  }
  
  .diagnostics-panel {
    display: none;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-item,
.diagnostic-item,
.guide-step {
  animation: fadeIn 0.2s ease-out;
}

/* Loading Spinner */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Enhanced Button Styles */
#uploadBtn {
  background: var(--accent-blue);
  font-weight: 500;
  padding: 8px 16px;
  font-size: 13px;
}

#uploadBtn:hover:not(:disabled) {
  background: #2563EB;
}

#acceptBtn {
  background: rgba(36, 133, 54, 0.12);
  color: var(--success);
  border: 1px solid rgba(36, 133, 54, 0.3);
  font-weight: 600;
  padding: 6px 14px;
  font-size: 12px;
  min-width: 110px;
}

#acceptBtn:hover:not(:disabled) {
  background: rgba(36, 133, 54, 0.2);
  border-color: rgba(36, 133, 54, 0.5);
}

#rejectBtn {
  background: rgba(239, 68, 68, 0.12);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-weight: 600;
  padding: 6px 14px;
  font-size: 12px;
  min-width: 110px;
}

#rejectBtn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

#skipBtn {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 500;
  padding: 6px 14px;
  font-size: 12px;
  min-width: 80px;
}

#skipBtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
}

#nextBtn,
#prevBtn {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 500;
  padding: 6px 12px;
  font-size: 12px;
  min-width: 70px;
}

#nextBtn:hover:not(:disabled),
#prevBtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.15);
}

#downloadBtn {
  background: var(--success);
  font-weight: 500;
  padding: 8px 16px;
  font-size: 13px;
}

#downloadBtn:hover:not(:disabled) {
  background: #1a6b2a;
}

#transformAllBtn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  font-weight: 500;
  padding: 8px 14px;
  font-size: 13px;
}

#transformAllBtn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--text-tertiary);
}

#skipBtn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 14px;
  font-size: 13px;
}

#skipBtn:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

#clearSessionBtn {
  padding: 8px 14px;
  font-size: 13px;
}


/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .logo-img {
    height: 28px;
    width: 28px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-link {
    font-size: 13px;
    padding: 6px 12px;
  }

  .main-content {
    padding: 16px;
  }

  .upload-section {
    padding: 24px 16px;
  }

  .upload-title {
    font-size: 20px;
  }

  .upload-subtitle {
    font-size: 13px;
  }

  .upload-zone {
    padding: 32px 16px;
    min-height: 200px;
  }

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

  .upload-text {
    font-size: 14px;
  }

  .upload-hint {
    font-size: 12px;
  }

  .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
  }

  .editor-container {
    flex-direction: column;
    height: auto;
  }

  .editor-panel {
    width: 100% !important;
    min-height: 400px;
    max-height: 500px;
  }

  .editor-header {
    padding: 10px 16px;
  }

  .editor-title {
    font-size: 13px;
  }

  .editor-actions {
    gap: 8px;
  }

  .btn-icon {
    padding: 6px;
  }

  .btn-icon svg {
    width: 16px;
    height: 16px;
  }

  .monaco-editor {
    font-size: 12px !important;
  }

  .results-section {
    padding: 24px 16px;
  }

  .results-title {
    font-size: 20px;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 28px;
  }

  .stat-label {
    font-size: 12px;
  }

  .btn-download {
    padding: 12px 24px;
    font-size: 14px;
  }

  .footer {
    padding: 24px 16px;
  }

  .footer-content {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 10px 12px;
  }

  .logo-img {
    height: 24px;
    width: 24px;
  }

  .nav-links {
    gap: 6px;
  }

  .nav-link {
    font-size: 12px;
    padding: 5px 10px;
  }

  .main-content {
    padding: 12px;
  }

  .upload-section {
    padding: 20px 12px;
  }

  .upload-title {
    font-size: 18px;
  }

  .upload-zone {
    padding: 24px 12px;
    min-height: 180px;
  }

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

  .upload-text {
    font-size: 13px;
  }

  .upload-hint {
    font-size: 11px;
  }

  .btn-primary {
    padding: 8px 16px;
    font-size: 13px;
    width: 100%;
  }

  .editor-panel {
    min-height: 350px;
  }

  .monaco-editor {
    font-size: 11px !important;
  }

  .results-section {
    padding: 20px 12px;
  }

  .results-title {
    font-size: 18px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 24px;
  }

  .btn-download {
    padding: 10px 20px;
    font-size: 13px;
    width: 100%;
  }
}
