/*
 * AgentHub shared dashboard styles
 * Used by all dashboard templates via /css/agenthub.css
 */

:root {
  --cyber-blue: #00f2ff;
  --cyber-purple: #bc13fe;
  --cyber-green: #05ffa1;
  --dark-bg: #0f172a; /* slate-900 — 30% lighter than original #020617 */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.14);
}

html, body {
  background-color: var(--dark-bg);
  /* position: relative is important: it creates a stacking context so the
     fixed animated background can use z-index correctly without disappearing
     behind the body's painted background. */
  position: relative;
}

body {
  font-family: 'Inter', sans-serif;
  color: #e2e8f0;
  overflow-x: hidden;
  min-height: 100vh;
}

.heading-font {
  font-family: 'Rajdhani', sans-serif;
}

/* ============================================================
 * Glass card style
 * ============================================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glow-blue:hover {
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
  border-color: var(--cyber-blue);
}

.glow-purple:hover {
  box-shadow: 0 0 20px rgba(188, 19, 254, 0.3);
  border-color: var(--cyber-purple);
}

.glow-green:hover {
  box-shadow: 0 0 20px rgba(5, 255, 161, 0.3);
  border-color: var(--cyber-green);
}

/* ============================================================
 * Animated background — fluid blobs
 *
 * Uses z-index: 0 on the container (NOT negative) so it sits inside the
 * body's stacking context. The body has position: relative for the same
 * reason. Main content gets z-10 to render on top.
 * ============================================================ */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.fluid-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  mix-blend-mode: screen;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(10vw, 15vh) scale(1.2) rotate(120deg); }
  66%  { transform: translate(-5vw, 20vh) scale(0.8) rotate(240deg); }
  100% { transform: translate(0, 0) scale(1) rotate(360deg); }
}

@keyframes drift-slow {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-15vw, -10vh) scale(1.1); }
  100% { transform: translate(0, 0) scale(1); }
}

.shape-blue {
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, var(--cyber-blue), transparent 70%);
  animation: drift 20s infinite ease-in-out;
  top: -10%; left: -10%;
}

.shape-purple {
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, var(--cyber-purple), transparent 70%);
  animation: drift 25s infinite ease-in-out reverse;
  bottom: -10%; right: -10%;
}

.shape-green {
  width: 40vw; height: 40vw;
  background: radial-gradient(circle, var(--cyber-green), transparent 70%);
  animation: drift-slow 30s infinite ease-in-out;
  top: 20%; right: -5%;
}

.shape-indigo {
  width: 45vw; height: 45vw;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  animation: drift 35s infinite ease-in-out;
  bottom: 20%; left: -5%;
}

/* Main content needs to render above the animated background */
main, nav, footer {
  position: relative;
  z-index: 10;
}

/* ============================================================
 * Animations
 * ============================================================ */
@keyframes float {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-float { animation: float 6s ease-in-out infinite; }
.animate-fade-in { animation: fadeIn 0.6s ease-out forwards; }

.cyber-gradient-text {
  background: linear-gradient(90deg, var(--cyber-blue), var(--cyber-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar-fill {
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
 * Scrollbar
 * ============================================================ */
.custom-scrollbar::-webkit-scrollbar { width: 4px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 10px;
}

/* ============================================================
 * Subtext readability — user requested whiter subtexts.
 * Override low-contrast gray-500/600 helper classes used in templates.
 * ============================================================ */
.subtext       { color: #f1f5f9; }  /* near white (slate-100) */
.subtext-muted { color: #cbd5e1; }  /* slate-300 — still readable but quieter */

/* ============================================================
 * User dropdown menu (in navbar)
 * ============================================================ */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  transition: background 0.2s;
}

.user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 240px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  padding: 0.5rem;
  display: none;
  z-index: 100;
}

.user-menu.open .user-menu-dropdown {
  display: block;
  animation: fadeIn 0.2s ease-out forwards;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  color: #e2e8f0;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.user-menu-item.danger {
  color: #f87171;
}

.user-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
}

.user-menu-item i {
  width: 1.125rem;
  text-align: center;
  opacity: 0.7;
}

.user-menu-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0.375rem 0.5rem;
}

.user-menu-header {
  padding: 0.875rem 0.875rem 0.625rem;
}

.user-menu-header .name {
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  display: block;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.user-menu-header .role {
  color: var(--cyber-blue);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 0.125rem;
}

/* ============================================================
 * Language dropdown
 * ============================================================ */
.lang-menu {
  position: relative;
}

.lang-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #cbd5e1;
  transition: background 0.2s, color 0.2s;
}

.lang-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.lang-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 160px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  padding: 0.375rem;
  display: none;
  z-index: 100;
}

.lang-menu.open .lang-menu-dropdown {
  display: block;
  animation: fadeIn 0.2s ease-out forwards;
}

.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #e2e8f0;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background 0.15s;
}

.lang-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.lang-menu-item.active {
  color: var(--cyber-blue);
  font-weight: 700;
}

.lang-menu-item .flag {
  font-size: 1rem;
}

/* ============================================================
 * Quickstart wizard tabs
 * ============================================================ */
.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.tab-btn.active {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--cyber-blue);
  color: var(--cyber-blue);
}

.tab-btn i {
  font-size: 0.875rem;
}

.tab-panel {
  display: block;
  margin-top: 1rem;
}

.tab-panel.hidden {
  display: none;
}

.code-block {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  overflow: hidden;
}

.code-block pre {
  padding: 1.25rem 1.25rem 1.25rem 1.25rem;
  margin: 0;
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  color: #cbd5e1;
  overflow-x: auto;
  line-height: 1.6;
}

.code-block .copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: #94a3b8;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
}

.code-block .copy-btn:hover {
  background: var(--cyber-blue);
  color: #020617;
  border-color: var(--cyber-blue);
}

.code-block .copy-btn.copied {
  background: var(--cyber-green);
  color: #020617;
  border-color: var(--cyber-green);
}

/* ============================================================
 * Cookie consent banner (GDPR)
 * ============================================================ */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 720px;
  width: calc(100% - 2rem);
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0, 242, 255, 0.25);
  border-radius: 1rem;
  padding: 1.5rem 1.75rem;
  color: #e2e8f0;
  z-index: 9999;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  display: none;
}

.cookie-banner.visible { display: block; animation: fadeIn 0.3s ease-out; }

.cookie-banner h3 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.cookie-banner p {
  font-size: 0.8125rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.cookie-banner p a {
  color: var(--cyber-blue);
  text-decoration: underline;
}

.cookie-banner .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  justify-content: flex-end;
}

.cookie-banner button {
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.625rem 1.125rem;
  border-radius: 0.5rem;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  transition: all 0.2s;
}

.cookie-banner button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.cookie-banner button.primary {
  background: var(--cyber-blue);
  color: #020617;
  border-color: var(--cyber-blue);
}

.cookie-banner button.primary:hover {
  background: #2dffff;
}

/* Detailed settings panel */
.cookie-banner.expanded .cookie-categories {
  display: block;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

.cookie-categories {
  display: none;
}

.cookie-category {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cookie-category:last-child { border-bottom: none; }

.cookie-category .info {
  flex: 1;
  margin-right: 1rem;
}

.cookie-category .info h4 {
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cookie-category .info p {
  font-size: 0.6875rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.cookie-toggle {
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  background: #334155;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.cookie-toggle::after {
  content: '';
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.cookie-toggle.on { background: var(--cyber-blue); }
.cookie-toggle.on::after { transform: translateX(1.25rem); }

.cookie-toggle.locked {
  background: #475569;
  cursor: not-allowed;
  opacity: 0.7;
}

@media (max-width: 640px) {
  .cookie-banner {
    bottom: 0.75rem;
    width: calc(100% - 1.5rem);
    padding: 1.25rem;
  }
  .cookie-banner .actions { flex-direction: column-reverse; align-items: stretch; }
  .cookie-banner button { width: 100%; }
}

/* ============================================================
 * Legal pages (privacy, terms, imprint)
 * ============================================================ */
.legal-content {
  max-width: 56rem;
  margin: 0 auto;
}

.legal-content h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.legal-content .last-updated {
  color: #64748b;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 2rem;
}

.legal-content h2 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legal-content h2:first-of-type { border-top: none; padding-top: 0; }

.legal-content h3 {
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}

.legal-content p {
  color: #cbd5e1;
  line-height: 1.75;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.legal-content ul, .legal-content ol {
  color: #cbd5e1;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-content ul { list-style: disc; }
.legal-content ol { list-style: decimal; }

.legal-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.legal-content strong { color: #ffffff; }

.legal-content a {
  color: var(--cyber-blue);
  text-decoration: underline;
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}

.legal-content th {
  text-align: left;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--glass-border);
}

.legal-content td {
  color: #cbd5e1;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.legal-content .legal-notice {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  color: #fef3c7;
  font-size: 0.875rem;
}

.legal-content .legal-notice strong { color: #fde68a; }

/* ============================================================
 * AgentHub navbar — full-width top-bar at every screen size.
 *
 * Design decision: dropped the "centered floating pill" because at common
 * laptop sizes (1100-1400px) the Hungarian section labels would NOT fit in
 * one row, and the content-driven flex-wrap created sparse two-row layouts
 * with empty gutters. A full-width top bar always uses the available
 * viewport width and looks consistent at any resolution.
 *
 * Layout:
 *   ┌────────────────────────────────────────────────────────────┐
 *   │ [BRAND] [section links flow centered…] [lang][user]│
 *   └────────────────────────────────────────────────────────────┘
 *
 * On narrow screens, section links wrap to a second row inside the same bar.
 *
 * `!important` is used on positioning rules to defeat Tailwind's
 * runtime-injected utility classes (cdn.tailwindcss.com loads styles
 * after this file).
 * ============================================================ */
.agenthub-nav {
  position: fixed !important;
  top: 1rem !important;
  left: 0.75rem !important;
  right: 0.75rem !important;
  transform: none !important;
  /* Stretch full visible width minus small side gutters */
  max-width: calc(100vw - 1.5rem) !important;
  box-sizing: border-box;
  /* Flex layout — always wrap-capable */
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 0.875rem 1.25rem;
  padding: 0.75rem 1.5rem;
  border-radius: 1.125rem;
  /* Allow children to shrink instead of forcing parent wider */
  min-width: 0;
}

.agenthub-nav > * {
  min-width: 0;
}

.agenthub-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.agenthub-nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  /* Take all the available middle space — pushes nav-right to the far edge */
  flex: 1 1 auto;
}

.agenthub-nav .nav-links a {
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.agenthub-nav .nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  /* No left border — full-width top bar style */
  padding-left: 0;
  border-left: none;
}

/* Tablet & narrower: section links wrap to a full-width 2nd row */
@media (max-width: 899px) {
  .agenthub-nav {
    padding: 0.625rem 1rem;
    gap: 0.625rem;
  }
  .agenthub-nav .nav-links {
    order: 3;
    width: 100%;
    flex-basis: 100%;
    border-top: 1px solid var(--glass-border);
    padding-top: 0.625rem;
    margin-top: 0.125rem;
    font-size: 0.8125rem;
  }
  .agenthub-nav .nav-right {
    margin-left: auto;
  }
}

/* Mobile: tighter padding + smaller fonts */
@media (max-width: 639px) {
  .agenthub-nav {
    top: 0.5rem !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    max-width: calc(100vw - 1rem) !important;
    padding: 0.5rem 0.875rem;
    gap: 0.5rem;
  }
  .agenthub-nav .nav-links {
    font-size: 0.75rem;
    gap: 0.5rem 0.875rem;
  }
  .agenthub-nav .nav-brand .heading-font {
    font-size: 1rem;
  }
}

/* ============================================================
 * Progressive container widening for large monitors
 *
 * Tailwind's max-w-7xl tops out at 80rem (1280px), which leaves
 * huge empty gutters on 1440p / 1600p / 4K screens. These overrides
 * let content breathe on wider viewports while staying readable.
 * Applies to landing-page section containers using max-w-7xl,
 * max-w-6xl, max-w-5xl etc.
 * ============================================================ */
@media (min-width: 1440px) {
  .max-w-7xl { max-width: 88rem !important; } /* 1408px */
  .max-w-6xl { max-width: 80rem !important; } /* 1280px */
  .max-w-5xl { max-width: 72rem !important; } /* 1152px */
}
@media (min-width: 1680px) {
  .max-w-7xl { max-width: 96rem !important; }  /* 1536px */
  .max-w-6xl { max-width: 88rem !important; }  /* 1408px */
  .max-w-5xl { max-width: 80rem !important; }  /* 1280px */
}
@media (min-width: 1920px) {
  .max-w-7xl { max-width: 110rem !important; } /* 1760px */
  .max-w-6xl { max-width: 96rem !important; }  /* 1536px */
  .max-w-5xl { max-width: 88rem !important; }  /* 1408px */
}
