/* ============================================================
   MintFileRecovery — Design System
   Inspired by Tauri / Iced desktop apps
   ============================================================ */

/* Fonts are vendored locally (SIL OFL 1.1) — the desktop app never
   contacts a font CDN at runtime, so it works on an air-gapped machine. */
@import url('./fonts.css');

/* The `hidden` attribute must win over any class rule that sets `display`.
   The browser default is `[hidden] { display: none }` in the UA stylesheet,
   which a class selector (.modal-overlay { display: flex }) outranks — so an
   element marked hidden stayed visible and, in the case of the modal
   overlay, blurred the entire application behind it. This rule makes the
   attribute authoritative for every element. */
[hidden] { display: none !important; }

/* ----------- Design Tokens ----------- */
:root {
  /* Brand — Mint */
  --mint-50:  #E6FBF5;
  --mint-100: #B8F0E0;
  --mint-200: #80E5C8;
  --mint-300: #4FD9B0;
  --mint-400: #26D49E;
  --mint-500: #00D4A0;   /* primary */
  --mint-600: #00A87F;
  --mint-700: #007A5C;
  --mint-800: #005542;
  --mint-900: #003828;

  /* Surfaces — deep dark teal/blue */
  --bg-base:     #0A0F14;
  --bg-canvas:   #0E141C;
  --bg-surface:  #131C28;
  --bg-elevated: #1A2535;
  --bg-overlay:  #1F2D40;
  --bg-hover:    #25354A;
  --bg-active:   #2D405A;

  /* Borders */
  --border-subtle:  #1A2535;
  --border-default: #243246;
  --border-strong:  #344559;
  --border-glow:    rgba(0, 212, 160, 0.35);

  /* Text */
  --text-primary:   #E6EDF5;
  --text-secondary: #9AA8BD;
  --text-muted:     #6B7A92;
  --text-disabled:  #4A5772;
  --text-inverse:   #0A0F14;

  /* Status */
  --success:    #10D87E;
  --success-bg: rgba(16, 216, 126, 0.12);
  --warning:    #F5B544;
  --warning-bg: rgba(245, 181, 68, 0.12);
  --danger:     #F4506E;
  --danger-bg:  rgba(244, 80, 110, 0.12);
  --info:       #3B82F6;
  --info-bg:    rgba(59, 130, 246, 0.12);
  --purple:     #A78BFA;
  --purple-bg:  rgba(167, 139, 250, 0.12);

  /* Gradients */
  --grad-mint:    linear-gradient(135deg, #00D4A0 0%, #14B8A6 100%);
  --grad-aurora:  linear-gradient(135deg, #00D4A0 0%, #3B82F6 50%, #A78BFA 100%);
  --grad-success: linear-gradient(135deg, #10D87E 0%, #00D4A0 100%);
  --grad-danger:  linear-gradient(135deg, #F4506E 0%, #B91C4E 100%);
  --grad-warn:    linear-gradient(135deg, #F5B544 0%, #F4506E 100%);
  --grad-mesh:    radial-gradient(at 0% 0%, rgba(0,212,160,0.12) 0px, transparent 50%),
                  radial-gradient(at 100% 100%, rgba(59,130,246,0.10) 0px, transparent 50%),
                  radial-gradient(at 50% 50%, rgba(167,139,250,0.05) 0px, transparent 50%);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
  --shadow-glow-mint: 0 0 24px rgba(0, 212, 160, 0.25);
  --shadow-glow-info: 0 0 24px rgba(59, 130, 246, 0.25);

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 9999px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Window metrics */
  --titlebar-h: 38px;
  --sidebar-w: 232px;
}

/* ----------- Base Reset ----------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: #050810;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

/* ----------- Window Shell (Tauri/Iced-like) ----------- */
.window {
  width: 1440px;
  height: 900px;
  margin: 24px auto;
  background: var(--bg-canvas);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  position: relative;
}
.window::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-mesh);
  pointer-events: none;
  z-index: 0;
}
.window > * { position: relative; z-index: 1; }

.titlebar {
  height: var(--titlebar-h);
  display: flex;
  align-items: center;
  padding: 0 var(--s-4);
  background: rgba(10, 15, 20, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
}
.traffic-lights {
  display: flex;
  gap: 8px;
  align-items: center;
}
.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: rgba(0,0,0,0.5);
  font-weight: 700;
  line-height: 1;
}
.traffic-light.close    { background: #FF5F57; }
.traffic-light.minimize { background: #FEBC2E; }
.traffic-light.maximize { background: #28C840; }

.titlebar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}
.titlebar-title .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-mint);
  box-shadow: 0 0 8px rgba(0, 212, 160, 0.6);
}
.titlebar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.titlebar-action {
  width: 30px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: all 0.15s ease;
}
.titlebar-action:hover { background: var(--bg-hover); color: var(--text-primary); }

/* App shell */
.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ----------- Sidebar ----------- */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(15, 22, 32, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--s-4) var(--s-3);
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--s-3);
}
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--grad-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-mint);
  flex-shrink: 0;
}
.brand-logo svg { color: #0A0F14; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text .name { font-weight: 700; font-size: 13px; color: var(--text-primary); }
.brand-text .ver { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

.sidebar-section { margin-bottom: var(--s-5); }
.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: var(--s-2);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(0,212,160,0.12) 0%, rgba(0,212,160,0.04) 100%);
  color: var(--mint-400);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--mint-500);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--mint-500);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--r-full);
  background: rgba(245, 181, 68, 0.15);
  color: #F5B544;
  text-transform: uppercase;
}
.nav-item .nav-badge.tier-trial { background: rgba(0, 212, 160, 0.15); color: #4FD9B0; }
.nav-item .nav-badge.tier-personal,
.nav-item .nav-badge.tier-pro,
.nav-item .nav-badge.tier-enterprise { background: rgba(16, 216, 126, 0.15); color: #10D87E; }
.nav-item .badge {
  margin-left: auto;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
}
.nav-item.active .badge { background: rgba(0,212,160,0.18); color: var(--mint-300); }

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border-subtle);
}
.disk-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
}
.disk-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--grad-mint);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0A0F14;
  flex-shrink: 0;
}
.disk-info { flex: 1; min-width: 0; }
.disk-info .label { font-size: 11px; color: var(--text-muted); }
.disk-info .name {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.disk-info .bar {
  height: 3px;
  background: var(--bg-elevated);
  border-radius: var(--r-full);
  margin-top: 4px;
  overflow: hidden;
}
.disk-info .bar-fill {
  height: 100%;
  width: 67%;
  background: var(--grad-mint);
  border-radius: var(--r-full);
}

/* ----------- Main Content ----------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 var(--s-6);
  gap: var(--s-4);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 22, 32, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.breadcrumb .crumb { padding: 4px 8px; border-radius: var(--r-sm); }
.breadcrumb .crumb:hover { background: var(--bg-hover); color: var(--text-primary); }
.breadcrumb .crumb.current { color: var(--text-primary); font-weight: 600; }
.breadcrumb .sep { color: var(--text-muted); font-size: 11px; }

.topbar-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 6px 10px;
  width: 280px;
  transition: all 0.15s ease;
}
.topbar-search:focus-within { border-color: var(--mint-500); box-shadow: 0 0 0 3px rgba(0,212,160,0.12); }
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  flex: 1;
  font-size: 12px;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search svg { color: var(--text-muted); width: 14px; height: 14px; }
.kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xs);
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* ----------- Buttons ----------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-md);
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  letter-spacing: 0.2px;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad-mint);
  color: #0A0F14;
  box-shadow: 0 4px 12px rgba(0,212,160,0.25);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(0,212,160,0.35); }

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(244,80,110,0.3);
}
.btn-danger:hover { background: rgba(244,80,110,0.2); }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  transition: all 0.15s ease;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon svg { width: 14px; height: 14px; }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 13px; }

/* ----------- Card / Surface ----------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}
.card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.glass {
  background: rgba(26, 37, 53, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

/* ----------- Chips / Badges / Tags ----------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chip svg { width: 10px; height: 10px; }
.chip-mint   { background: rgba(0,212,160,0.12); color: var(--mint-400); }
.chip-success{ background: var(--success-bg); color: var(--success); }
.chip-warning{ background: var(--warning-bg); color: var(--warning); }
.chip-danger { background: var(--danger-bg);  color: var(--danger); }
.chip-info   { background: var(--info-bg);    color: var(--info); }
.chip-purple { background: var(--purple-bg); color: var(--purple); }
.chip-neutral{ background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-default); }

/* ----------- Inputs ----------- */
.input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 8px 12px;
  transition: all 0.15s ease;
}
.input:focus-within { border-color: var(--mint-500); box-shadow: 0 0 0 3px rgba(0,212,160,0.12); }
.input input, .input select {
  background: none;
  border: none;
  outline: none;
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}
.input input::placeholder { color: var(--text-muted); }

.label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all 0.2s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.2s ease;
}
.toggle input:checked + .toggle-slider {
  background: var(--mint-500);
  border-color: var(--mint-500);
  box-shadow: 0 0 8px rgba(0,212,160,0.3);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: #0A0F14;
}

/* ----------- Progress ----------- */
.progress {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--r-full);
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: var(--grad-mint);
  border-radius: var(--r-full);
  position: relative;
  transition: width 0.3s ease;
}
.progress-fill.animated::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: var(--r-full); border: 2px solid var(--bg-canvas); }
::-webkit-scrollbar-thumb:hover { background: var(--bg-active); }

/* Utility */
.mono { font-family: var(--font-mono); }
.text-mint { color: var(--mint-400); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; } .flex-1 { flex: 1; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
