* {
  box-sizing: border-box;
}
body {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  font-family: system-ui, "Segoe UI", sans-serif;
  margin: 0;
  padding: 20px;
  color: #e0e0e0;
}
.container {
  max-width: 1600px;
  margin: 0 auto;
}
.header {
  text-align: center;
  margin-bottom: 28px;
}
.header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  margin: 0;
}
.header p {
  color: #94a3b8;
}
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 24px;
}
@media (max-width: 1000px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}
.card {
  background: #1e293b;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #334155;
}
.card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 20px 0;
  border-left: 4px solid #8b5cf6;
  padding-left: 14px;
  color: #f1f5f9;
}
.source-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.source-btn {
  flex: 1;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  color: #cbd5e1;
}
.source-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border-color: #a78bfa;
  color: white;
}
.input-group {
  margin-top: 20px;
}
.input-group label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
}
input, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #475569;
  background: #0f172a;
  color: #e0e0e0;
  font-size: 0.9rem;
}
input:focus, textarea:focus {
  outline: none;
  border-color: #8b5cf6;
}
.flex-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
button {
  background: #475569;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: all 0.2s;
}
button.primary {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}
button.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}
button.success {
  background: linear-gradient(135deg, #10b981, #059669);
}
button.secondary {
  background: #334155;
}
.options-panel {
  background: #0f172a;
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid #334155;
}
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.checkbox-group:hover {
  background: #1e293b;
}
.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin: 0;
  accent-color: #8b5cf6;
}
.checkbox-group label {
  margin: 0;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 0.9rem;
  font-weight: 500;
}
.ignore-area {
  background: #0f172a;
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid #475569;
}
.ignore-area textarea {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  resize: vertical;
}
.analysis-panel {
  background: #0f172a;
  border-radius: 16px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid #10b981;
}
.analysis-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.analysis-stat {
  text-align: center;
  padding: 12px;
  background: #1e293b;
  border-radius: 12px;
}
.analysis-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #10b981;
}
.analysis-stat-label {
  font-size: 0.7rem;
  color: #94a3b8;
}
.file-tree-container {
  background: #0f172a;
  border-radius: 16px;
  padding: 16px;
  max-height: 500px;
  overflow: auto;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.75rem;
  margin-top: 16px;
  border: 1px solid #334155;
}
.tree-node {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
.tree-node .tree-node {
  margin-left: 20px;
}
.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  cursor: pointer;
  border-radius: 4px;
}
.tree-item:hover {
  background: #1e293b;
}
.tree-toggle {
  width: 16px;
  font-size: 8px;
  cursor: pointer;
  color: #60a5fa;
  user-select: none;
}
.tree-toggle.empty {
  opacity: 0;
  cursor: default;
}
.tree-icon {
  font-size: 12px;
}
.tree-label {
  cursor: pointer;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #cbd5e1;
}
.tree-size {
  font-size: 0.65rem;
  color: #10b981;
  margin-left: 8px;
  font-family: monospace;
  white-space: nowrap;
}
.tree-checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
}
.stats-bar {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: #0f172a;
  border-radius: 12px;
  margin: 16px 0;
  border: 1px solid #334155;
}
.stat {
  text-align: center;
  flex: 1;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #8b5cf6;
}
.stat-label {
  font-size: 0.7rem;
  color: #94a3b8;
}
.status {
  background: #0f172a;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  margin: 16px 0;
  border-left: 4px solid #8b5cf6;
  color: #cbd5e1;
}
.status.error {
  border-left-color: #ef4444;
  background: #7f1a1a;
}
.status.success {
  border-left-color: #10b981;
  background: #064e3b;
}
.badge {
  background: #334155;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #cbd5e1;
  display: inline-block;
  margin-top: 8px;
}
.compression-badge {
  background: #10b981;
  color: white;
  margin-left: 8px;
}
.selection-stats {
  font-family: monospace;
  font-size: 0.7rem;
  color: #94a3b8;
  text-align: right;
  margin-bottom: 8px;
}
.file-tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}
.action-buttons button {
  flex: 1;
}
pre {
  background: #0f172a;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 11px;
  border: 1px solid #334155;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 500px;
  overflow-y: auto;
  font-family: "SF Mono", "Fira Code", "Noto Color Emoji", monospace;
}
progress {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  margin: 10px 0;
  display: none;
}
progress::-webkit-progress-bar {
  background-color: #334155;
  border-radius: 4px;
}
progress::-webkit-progress-value {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border-radius: 4px;
  transition: width 0.3s;
}
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px 0;
  flex-wrap: wrap;
  gap: 10px;
}
.output-header h2 {
  margin: 0;
  font-size: 1rem;
}
.output-actions {
  display: flex;
  gap: 10px;
}
.copy-btn, .download-text-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  color: white;
  font-weight: 500;
}
.download-text-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.copy-btn:hover, .download-text-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}
.copy-btn.copied {
  background: linear-gradient(135deg, #10b981, #059669);
}
.cache-badge {
  font-size: 0.7rem;
  background: #8b5cf6;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
}
#downloadContainer {
  margin-top: 12px;
  text-align: center;
}
.download-zip-btn {
  background: linear-gradient(135deg, #10b981, #059669);
}
hr {
  border-color: #334155;
  margin: 16px 0;
}
.auth-status {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #1e293b;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  border: 1px solid #334155;
  z-index: 1000;
}
.auth-status.authenticated {
  border-color: #10b981;
  color: #10b981;
}
.auth-status.unauthenticated {
  border-color: #ef4444;
  color: #ef4444;
}
