/* ── EasyFile Component Library ── */
/* Classes from SKILL 2.md Layer 2 */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--ef-font);
  font-size: var(--ef-text-14);
  line-height: 1.5;
  color: var(--ef-text);
  background: var(--ef-bg);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: var(--ef-color-primary); text-decoration: none; }
a:hover { color: var(--ef-color-primary-hover); text-decoration: underline; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ef-space-8);
  border: none;
  border-radius: var(--ef-radius-6);
  font-family: var(--ef-font);
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
  text-decoration: none;
  line-height: 1;
}
.btn:focus-visible {
  outline: 2px solid var(--ef-color-focus);
  outline-offset: 2px;
}
.btn:disabled, .btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn svg { width: 15px; height: 15px; stroke-width: 2; }

/* Variants */
.btn-primary { background: var(--ef-color-primary); color: #fff; }
.btn-primary:hover { background: var(--ef-color-primary-hover); color: #fff; text-decoration: none; }

.btn-secondary { background: var(--ef-surface); color: var(--ef-text); border: 1px solid var(--ef-border); }
.btn-secondary:hover { background: var(--ef-surface-2); text-decoration: none; }

.btn-ghost { background: transparent; color: var(--ef-text-muted); }
.btn-ghost:hover { background: var(--ef-surface-2); color: var(--ef-text); text-decoration: none; }

.btn-danger { background: var(--ef-color-danger); color: #fff; }
.btn-danger:hover { background: var(--ef-color-danger-hover); color: #fff; text-decoration: none; }

.btn-icon {
  background: transparent;
  color: var(--ef-text-muted);
  width: 34px;
  height: 34px;
  padding: 0;
}
.btn-icon:hover { background: var(--ef-surface-2); color: var(--ef-text); }

/* Sizes */
.btn-sm { height: 28px; padding: 0 var(--ef-space-8); font-size: var(--ef-text-12); }
.btn-md { height: 34px; padding: 0 var(--ef-space-12); font-size: var(--ef-text-13); }
.btn-lg { height: 42px; padding: 0 var(--ef-space-16); font-size: var(--ef-text-14); }

/* ── Cards ── */
.card {
  background: var(--ef-surface);
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-10);
  box-shadow: var(--ef-shadow-1);
}
.card.pad { padding: var(--ef-space-24); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ef-space-4);
  height: 22px;
  padding: 0 var(--ef-space-8);
  border-radius: var(--ef-radius-14);
  font-size: var(--ef-text-11);
  font-weight: 600;
  line-height: 1;
}
.bdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.b-grn { background: var(--ef-green-bg); color: var(--ef-green-text); }
.b-grn .bdot { background: var(--ef-green); }

.b-ylw { background: var(--ef-yellow-bg); color: var(--ef-yellow-text); }
.b-ylw .bdot { background: var(--ef-yellow); }

.b-red { background: var(--ef-red-bg); color: var(--ef-red-text); }
.b-red .bdot { background: var(--ef-red); }

.b-blu { background: var(--ef-blue-bg); color: var(--ef-blue-text); }
.b-blu .bdot { background: var(--ef-blue); }

.b-gry { background: var(--ef-surface-2); color: var(--ef-text-muted); }
.b-gry .bdot { background: var(--ef-text-muted); }

/* ── Avatars ── */
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ef-color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--ef-text-11);
  font-weight: 600;
  flex-shrink: 0;
  user-select: none;
}

/* ── Alerts / Banners ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--ef-space-8);
  padding: var(--ef-space-12);
  border-radius: var(--ef-radius-6);
  border: 1px solid transparent;
}
.alert-title { font-size: var(--ef-text-12); font-weight: 600; }
.alert-msg { font-size: var(--ef-text-11); opacity: 0.8; margin-top: 2px; }

.alert-info { background: var(--ef-blue-bg); border-color: rgba(37,99,235,0.15); }
.alert-info .alert-title, .alert-info .alert-msg { color: var(--ef-blue-text); }
.alert-info svg { color: var(--ef-blue); }

.alert-warn { background: var(--ef-yellow-bg); border-color: rgba(217,119,6,0.15); }
.alert-warn .alert-title, .alert-warn .alert-msg { color: var(--ef-yellow-text); }
.alert-warn svg { color: var(--ef-yellow); }

.alert-error { background: var(--ef-red-bg); border-color: rgba(220,38,38,0.15); }
.alert-error .alert-title, .alert-error .alert-msg { color: var(--ef-red-text); }
.alert-error svg { color: var(--ef-red); }

.alert-success { background: var(--ef-green-bg); border-color: rgba(22,163,74,0.15); }
.alert-success .alert-title, .alert-success .alert-msg { color: var(--ef-green-text); }
.alert-success svg { color: var(--ef-green); }

/* ── Theme Switcher ── */
.theme-toggle-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9997;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ef-surface);
  border: 1px solid var(--ef-border);
  box-shadow: var(--ef-shadow-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ef-text-muted);
  cursor: pointer;
}
.theme-toggle-btn:hover { background: var(--ef-surface-2); color: var(--ef-text); }

.theme-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9998;
  background: var(--ef-surface);
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-10);
  box-shadow: var(--ef-shadow-2);
  padding: var(--ef-space-12);
  width: 220px;
}
.theme-panel h4 {
  font-size: var(--ef-text-11);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ef-text-muted);
  margin-bottom: var(--ef-space-8);
}
.theme-group { margin-bottom: var(--ef-space-12); }
.theme-group:last-child { margin-bottom: 0; }

.theme-opt {
  display: flex;
  align-items: center;
  gap: var(--ef-space-8);
  padding: 5px 8px;
  border-radius: var(--ef-radius-6);
  cursor: pointer;
  font-size: var(--ef-text-12);
  color: var(--ef-text);
  transition: all 100ms;
  margin-bottom: 2px;
}
.theme-opt:hover { background: var(--ef-surface-2); }
.theme-opt.active { background: var(--ef-color-primary-bg); color: var(--ef-color-primary); font-weight: 600; }

.theme-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--ef-border);
  flex-shrink: 0;
}

/* ── Accessibility ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
