/* catknows Repair Tool — Dark theme matching admin panel */

:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #1e2a45;
  --border: #0f3460;
  --accent: #e94560;
  --accent-hover: #d63851;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7a;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --info: #2196f3;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* Version banner */
.version-banner {
  background: var(--warning);
  color: #1a1a2e;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

.version-banner a {
  color: #1a1a2e;
  font-weight: 700;
  text-decoration: underline;
}

.version-banner .banner-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #1a1a2e;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

.hidden {
  display: none !important;
}

/* Header */
header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

h1 .dot {
  color: var(--accent);
}

.version-badge {
  background: var(--border);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.install-dir {
  color: var(--text-secondary);
  font-size: 13px;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tabs */
.tabs {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 0;
}

.tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Main content */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.card p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: 14px;
}

/* Status grid */
.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.status-item {
  display: flex;
  gap: 8px;
  font-size: 14px;
}

.status-item .label {
  color: var(--text-secondary);
}

.status-item .value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  background: var(--border);
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  background: var(--accent);
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-small {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-large {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  text-decoration: underline;
  padding: 4px 8px;
}

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

.button-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Warning box */
.warning-box {
  background: rgba(255, 152, 0, 0.1);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--warning);
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Drop zone */
.upload-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.upload-method h3 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(233, 69, 96, 0.05);
}

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

.drop-icon {
  font-size: 40px;
  opacity: 0.6;
}

.drop-zone p {
  color: var(--text-secondary);
  margin: 0;
}

.drop-zone p.small {
  font-size: 12px;
  color: var(--text-muted);
}

/* Downloads list */
.downloads-list {
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.download-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.download-item .file-info {
  display: flex;
  flex-direction: column;
}

.download-item .file-name {
  color: var(--text-primary);
  font-weight: 500;
}

.download-item .file-meta {
  color: var(--text-muted);
  font-size: 11px;
}

/* Selected file */
.selected-file {
  margin-top: 12px;
  padding: 12px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid var(--success);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/* Progress */
.progress-area {
  margin-top: 16px;
}

.progress-bar-container {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  background: var(--accent);
  height: 100%;
  width: 0%;
  transition: width 0.3s;
  border-radius: var(--radius);
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Result boxes */
.result-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  font-size: 14px;
  white-space: pre-wrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
  max-height: 300px;
  overflow-y: auto;
}

.result-box.success {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.result-box.error {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.result-box.info {
  background: rgba(33, 150, 243, 0.1);
  border: 1px solid var(--info);
  color: var(--info);
}

/* Backups list */
.backups-list {
  font-size: 14px;
}

.backup-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 4px;
}

.backup-item .backup-name {
  color: var(--text-primary);
  font-weight: 500;
}

.backup-item .backup-meta {
  color: var(--text-muted);
  font-size: 12px;
}

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

/* Footer */
footer {
  padding: 16px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* Responsive */
@media (max-width: 700px) {
  .upload-methods {
    grid-template-columns: 1fr;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .install-dir {
    max-width: 100%;
  }
}
