/* Distantec shared UI-kit components.
   Shared header, cards, buttons and utility layout for tool pages. */

:root {
  --bg: #0a0a0f;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --primary: #6366f1;
  --primary-light: #818cf8;
  --accent: #8b5cf6;
  --danger: #ef4444;
  --success: #22c55e;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --text-sub: #94a3b8;
  --radius: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 1.5rem 0;
  background: linear-gradient(180deg, rgba(10,10,15,0.96), rgba(10,10,15,0.72) 72%, rgba(10,10,15,0));
  backdrop-filter: blur(18px);
}

.app-header-card {
  width: min(100%, 1100px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.24);
}

.app-header-card--narrow { width: min(100%, 900px); }

.header-main {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.header-brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(99,102,241,0.28);
}
.header-brand-icon .ui-icon {
  width: 20px;
  height: 20px;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.22));
}
.header-brand-icon-passgen { background: linear-gradient(135deg, #10b981, #3b82f6); }
.header-brand-icon-whois { background: linear-gradient(135deg, #f59e0b, #d97706); }
.header-brand-icon-ssl { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.header-brand-icon-dns { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.header-brand-icon-http { background: linear-gradient(135deg, #22c55e, #6366f1); }

.back-link:focus-visible,
.header-brand:focus-visible,
.btn:focus-visible,
.btn-ghost:focus-visible,
.btn-primary:focus-visible,
.btn-danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(129,140,248,0.22);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


.header-brand-name {
  line-height: 1.15;
  font-size: 1rem;
  font-weight: 750;
  color: var(--text);
}

.header-brand-sub {
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-sub);
}

.back-link {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.65rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.back-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.045);
  border-color: var(--border);
}

.header-actions {
  flex-shrink: 0;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
  color: var(--text-sub);
  font-size: 0.76rem;
  white-space: nowrap;
}

.tool-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.35rem 1.5rem 2rem;
}
.tool-main--compact { max-width: 700px; }
.tool-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-sub);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  border-color: rgba(255,255,255,0.15);
  color: var(--text);
}

.btn-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.2);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.4);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none;
}

.btn-icon {
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
}

@media (max-width: 720px) {
  .app-shell-header { padding: 0.75rem 0.75rem 0; }
  .app-header-card {
    grid-template-columns: auto 1fr;
    gap: 0.65rem;
    padding: 0.75rem;
  }
  .header-main { justify-content: flex-start; }
  .app-header-card--actions .header-main {
    order: 2;
    grid-column: 1 / -1;
  }
  .header-actions { justify-self: end; gap: 0.45rem; }
  .status-pill { margin-left: auto; }
  .header-brand-sub { display: none; }
  .tool-main { padding: 1rem 1rem 2rem; }
  .tool-card { padding: 1.25rem; }
  .btn-sm { padding: 0.42rem 0.65rem; }
}
