/* ======================================================
   Starter Packs page — packs.css
   Shared variables from theme.css apply here too.
   ====================================================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: #05070d;
  color: #e8eeff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header — matches main page style ────────────────── */

.packs-header {
  display: flex;
  align-items: center;
  padding: 0 28px;
  height: 90px;
  background-image: url("../Images/header.png");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.packs-brand-link {
  text-decoration: none;
  color: inherit;
}

.packs-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.packs-logo {
  height: 75px;
  width: auto;
  flex-shrink: 0;
}

.packs-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.packs-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.packs-tagline {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.packs-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.packs-back-link {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.packs-back-link:hover { color: #fff; }

.packs-user-email {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ── Landing overlay (unauthenticated) ──────────────── */

.packs-landing {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  color: #fff;
}

.packs-landing h2 { font-size: 20px; font-weight: 600; }
.packs-landing p  { font-size: 14px; color: rgba(255,255,255,0.65); }

.packs-signin-btn {
  margin-top: 8px;
  padding: 11px 36px;
  background: #5e81ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.packs-signin-btn:hover { background: #4b6de6; }

/* ── Page body ──────────────────────────────────────── */

.packs-body {
  flex: 1;
  padding: 36px 28px 60px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.packs-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #e8eeff;
  margin-bottom: 4px;
}

.packs-page-subtitle {
  font-size: 14px;
  color: #7a8ab8;
  margin-bottom: 28px;
}

/* ── Project selector ───────────────────────────────── */

.packs-project-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 14px 16px;
  background: #0d1120;
  border: 1px solid rgba(94, 129, 255, 0.15);
  border-radius: 12px;
}

.packs-project-label {
  font-size: 13px;
  font-weight: 600;
  color: #e8eeff;
  white-space: nowrap;
}

.packs-project-select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid rgba(94, 129, 255, 0.18);
  border-radius: 8px;
  font-size: 14px;
  color: #c8d4ff;
  background: #080b14;
  outline: none;
  font-family: inherit;
}

.packs-project-select:focus { border-color: #5e81ff; }

/* ── Content layout (sidebar + main) ────────────────── */

.packs-content {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* ── Filter sidebar ──────────────────────────────────── */

.packs-sidebar-col {
  width: 192px;
  flex-shrink: 0;
  position: sticky;
  top: 106px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.packs-sidebar {
  background: #0d1120;
  border: 1px solid rgba(94, 129, 255, 0.12);
  border-radius: 14px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.packs-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(94, 129, 255, 0.18);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  color: #c8d4ff;
  background: #080b14;
  outline: none;
  box-sizing: border-box;
}

.packs-search-input:focus {
  border-color: #5e81ff;
  box-shadow: 0 0 0 3px rgba(94, 129, 255, 0.12);
}

.packs-sidebar-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4a5a7a;
  padding: 0 6px;
  margin-bottom: 4px;
}

.packs-sidebar-divider {
  border: none;
  border-top: 1px solid rgba(94, 129, 255, 0.1);
  margin: 10px 0 8px;
}

.packs-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #a0b0d4;
  transition: background 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.packs-filter-item:hover {
  background: rgba(94, 129, 255, 0.08);
  color: #c8d4ff;
}

.packs-filter-item.active {
  background: rgba(94, 129, 255, 0.15);
  color: #5e81ff;
  font-weight: 600;
}

.packs-filter-count {
  font-size: 12px;
  color: #4a5a7a;
  background: rgba(94, 129, 255, 0.08);
  border-radius: 10px;
  padding: 1px 7px;
  min-width: 22px;
  text-align: center;
}

.packs-filter-item.active .packs-filter-count {
  background: rgba(94, 129, 255, 0.2);
  color: #5e81ff;
}

.packs-main {
  flex: 1;
  min-width: 0;
}

/* ── Registry (replaces card grid) ──────────────────── */

.packs-grid {
  background: #0d1120;
  border: 1px solid rgba(94, 129, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

/* Column header row */
.registry-header {
  display: flex;
  align-items: center;
  padding: 9px 16px;
  background: #080b14;
  border-bottom: 1px solid rgba(94, 129, 255, 0.1);
  gap: 12px;
}

.registry-header-cell {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4a5a7a;
}

.registry-header-cell.col-vertical { width: 80px; flex-shrink: 0; }
.registry-header-cell.col-info     { flex: 1; min-width: 0; }
.registry-header-cell.col-meta     { width: 120px; flex-shrink: 0; text-align: right; }
.registry-header-cell.col-action   { width: 160px; flex-shrink: 0; text-align: right; }

/* Individual pack row */
.registry-row {
  display: flex;
  align-items: flex-start;
  padding: 13px 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(94, 129, 255, 0.08);
  transition: background 0.12s, box-shadow 0.12s;
  position: relative;
}

.registry-row:last-child {
  border-bottom: none;
}

.registry-row:hover {
  background: rgba(94, 129, 255, 0.06);
  box-shadow: inset 3px 0 0 #5e81ff;
}

.registry-row.is-applied {
  background: rgba(74, 222, 128, 0.04);
}

.registry-row.is-applied:hover {
  background: rgba(74, 222, 128, 0.08);
  box-shadow: inset 3px 0 0 #4ade80;
}

/* Vertical badge */
.col-vertical { width: 80px; flex-shrink: 0; padding-top: 2px; }

.registry-vertical-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.registry-vertical-badge.v-finance   { background: rgba(26, 86, 219, 0.15);  color: #93c5fd; }
.registry-vertical-badge.v-technical { background: rgba(22, 101, 52, 0.15);  color: #4ade80; }
.registry-vertical-badge.v-audit     { background: rgba(107, 33, 168, 0.15); color: #c084fc; }
.registry-vertical-badge.v-legal     { background: rgba(234, 179, 8, 0.15);  color: #fde68a; }
.registry-vertical-badge.v-other     { background: rgba(71, 85, 105, 0.15);  color: #94a3b8; }

/* Info column */
.col-info {
  flex: 1;
  min-width: 0;
}

.registry-pack-name {
  font-size: 14px;
  font-weight: 600;
  color: #e8eeff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.registry-pack-desc {
  font-size: 12px;
  color: #7a8ab8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.45;
  margin-top: 2px;
}

/* Meta column */
.col-meta {
  width: 120px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding-top: 1px;
}

.registry-version {
  font-size: 11px;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  color: #7a8ab8;
  background: rgba(94, 129, 255, 0.08);
  border: 1px solid rgba(94, 129, 255, 0.15);
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}

.registry-item-count {
  font-size: 11px;
  color: #4a5a7a;
}

/* Action column */
.col-action {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 1px;
}

.pack-apply-btn {
  padding: 6px 16px;
  background: transparent;
  color: #5e81ff;
  border: 1.5px solid #5e81ff;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
}

.pack-apply-btn:hover {
  background: #5e81ff;
  color: #fff;
}

.pack-apply-btn:disabled {
  border-color: rgba(94, 129, 255, 0.2);
  color: rgba(94, 129, 255, 0.3);
  cursor: default;
  background: transparent;
}

.pack-applied-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.pack-applied-badge {
  font-size: 12px;
  font-weight: 600;
  color: #4ade80;
}

.pack-applied-date {
  font-size: 11px;
  color: #4a5a7a;
}

/* Unapply button — ghost destructive */
.pack-unapply-btn {
  padding: 5px 11px;
  background: transparent;
  color: #4a5a7a;
  border: 1px solid rgba(94, 129, 255, 0.15);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
  white-space: nowrap;
}

.pack-unapply-btn:hover {
  border-color: #ff3b30;
  color: #f87171;
  background: rgba(255, 59, 48, 0.08);
}

/* Inline confirm state */
.pack-unapply-btn.confirming {
  border-color: #ff3b30;
  color: #f87171;
  background: rgba(255, 59, 48, 0.08);
  font-weight: 600;
}

/* ── Loading / empty states ─────────────────────────── */

.packs-state {
  text-align: center;
  padding: 60px 20px;
  color: #7a8ab8;
  font-size: 14px;
}

.packs-state strong {
  display: block;
  font-size: 16px;
  color: #e8eeff;
  margin-bottom: 6px;
}

/* ── Toast notification ─────────────────────────────── */

.packs-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0d1120;
  border: 1px solid rgba(94, 129, 255, 0.2);
  color: #e8eeff;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 500;
  pointer-events: none;
  white-space: nowrap;
}

.packs-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.packs-toast.error {
  background: #ff3b30;
  border-color: #ff3b30;
}
