/* ============================================================
   FileHost — UI Components CSS
   ============================================================ */

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border: none; cursor: pointer;
  color: var(--text2); transition: all var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
}

/* ── Dropdown Select ─────────────────────────────────────────── */
.select-wrap { position: relative; }
.select-wrap::after {
  content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text3); pointer-events: none; font-size: .75rem;
}
.select-wrap select { padding-right: 36px; appearance: none; }

/* ── Toggle Switch ───────────────────────────────────────────── */
.toggle-wrap {
  display: flex; align-items: center; gap: 10px;
}
.toggle {
  position: relative; width: 44px; height: 24px;
  display: inline-block;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer; transition: all .25s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  border-radius: 50%; background: var(--text3);
  top: 2px; left: 2px; transition: all .25s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: white; }
.toggle-label { font-size: .875rem; color: var(--text2); cursor: pointer; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-size: .875rem; font-weight: 500; color: var(--text3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: tabFade .25s ease; }
@keyframes tabFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── Tooltip ─────────────────────────────────────────────────── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--surface2); color: var(--text); font-size: .75rem;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity var(--transition);
  border: 1px solid var(--border); z-index: 100; line-height: 1;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 40px; color: var(--text3);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; color: var(--surface2); }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text2); margin-bottom: 8px; }
.empty-state p  { font-size: .875rem; margin-bottom: 20px; }

/* ── Code Block ──────────────────────────────────────────────── */
.code-block {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-family: 'Fira Code', monospace; font-size: .85rem; color: var(--accent);
  word-break: break-all; position: relative;
}
.code-copy-btn {
  position: absolute; top: 8px; right: 8px;
  padding: 4px 8px; border-radius: 6px;
  background: var(--primary); color: white; border: none;
  font-size: .75rem; cursor: pointer; transition: background var(--transition);
}
.code-copy-btn:hover { background: var(--primary-d); }
.code-copy-btn.copied { background: var(--success); }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loading Overlay ─────────────────────────────────────────── */
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(15,15,26,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; border-radius: inherit;
}

/* ── Checkbox styled ─────────────────────────────────────────── */
.checkbox-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-wrap input[type=checkbox] {
  width: 18px; height: 18px; border-radius: 5px;
  border: 2px solid var(--border); background: var(--surface2);
  accent-color: var(--primary); cursor: pointer;
}

/* ── Progress bar (generic) ──────────────────────────────────── */
.progress-bar { height: 8px; background: var(--surface2); border-radius: 10px; overflow: hidden; }
.progress-fill {
  height: 100%; border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width .5s ease;
}
.progress-fill.danger  { background: var(--danger); }
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
