/* ═══════════════════════════════════════
   KTANA DASHBOARD – Main Stylesheet
   Primary: #e63946 (red)
═══════════════════════════════════════ */

:root {
  --red: #e63946;
  --red-dark: #c1121f;
  --red-glow: rgba(230,57,70,.35);
  --bg: #0d0d0f;
  --bg2: #141417;
  --bg3: #1c1c20;
  --bg4: #242428;
  --border: rgba(255,255,255,.07);
  --text: #f0f0f0;
  --text-muted: #8a8a9a;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50%   0%,   rgba(230,57,70,.14) 0%, transparent 70%),
    radial-gradient(ellipse 55% 40% at 0%    45%,  rgba(230,57,70,.08) 0%, transparent 65%),
    radial-gradient(ellipse 55% 40% at 100%  60%,  rgba(230,57,70,.07) 0%, transparent 65%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--red-dark); border-radius: 3px; }

/* ══════════════════════════════════════
   NAVBAR
══════════════════════════════════════ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  background: rgba(13,13,15,.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
}

.navbar-brand-icon {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  box-shadow: 0 0 14px var(--red-glow);
}

.navbar-nav {
  display: flex;
  gap: .25rem;
  list-style: none;
  flex: 1;
}

.navbar-nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
}

.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--white);
  background: var(--bg3);
}

.navbar-nav a.active {
  color: var(--red);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* User Badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: .65rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: .3rem .75rem .3rem .3rem;
  text-decoration: none;
  cursor: pointer;
  position: relative;
}

.user-badge-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--red);
}

.user-badge-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge-role {
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 20px;
  background: var(--red);
  color: #fff;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.user-badge-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 160px;
  padding: .5rem;
  display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}

/* Extend the hover hit area of the badge downward to bridge the gap */
.user-badge::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.user-badge:hover .user-badge-dropdown,
.user-badge.open .user-badge-dropdown {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.user-badge-dropdown a {
  color: var(--text-muted);
  text-decoration: none;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .825rem;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.user-badge-dropdown a:hover { color: var(--white); background: var(--bg4); }
.user-badge-dropdown a.danger:hover { color: var(--red); }

/* Login btn */
.btn-login {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--red);
  color: #fff;
  padding: .5rem 1.2rem;
  border-radius: 40px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 14px var(--red-glow);
}

.btn-login:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════
   PAGE WRAPPER
══════════════════════════════════════ */
.page-wrapper {
  padding-top: 64px;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   HERO (index)
══════════════════════════════════════ */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 2rem 5rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(230,57,70,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(230,57,70,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(230,57,70,.12);
  border: 1px solid rgba(230,57,70,.3);
  color: var(--red);
  border-radius: 40px;
  padding: .35rem .9rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 1.25rem;
  color: var(--white);
}

.hero-title span {
  color: var(--red);
  position: relative;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: 40px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 20px var(--red-glow);
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 24px var(--red-glow);
}

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg4);
  transform: translateY(-2px);
}

.btn-sm {
  padding: .45rem 1.1rem;
  font-size: .8rem;
}

/* ── Scroll fade indicator ── */
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ══════════════════════════════════════
   PRODUCTS SECTION
══════════════════════════════════════ */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-block;
  background: rgba(230,57,70,.1);
  color: var(--red);
  border: 1px solid rgba(230,57,70,.25);
  padding: .25rem .8rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .5rem;
}

.section-sub {
  color: var(--text-muted);
  font-size: .95rem;
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

.card:hover { border-color: rgba(230,57,70,.3); transform: translateY(-4px); }
.card:hover::before { transform: scaleX(1); }

.card-icon {
  width: 48px; height: 48px;
  background: rgba(230,57,70,.1);
  border: 1px solid rgba(230,57,70,.2);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  color: var(--red);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .5rem;
}

.card-text {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-undetected { color: #22c55e; background: rgba(34,197,94,.1); }
.status-updating { color: #f59e0b; background: rgba(245,158,11,.1); }
.status-detected { color: #ff0000; background: rgba(230,57,70,.1); }

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
}

.footer a { color: var(--red); text-decoration: none; }

/* ══════════════════════════════════════
   RESPONSIVE — base elements only
   (Panel-specific responsive rules are
    in panels.css)
══════════════════════════════════════ */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .hero { padding: 5rem 1.5rem 3rem; }
  .section { padding: 3rem 1.5rem; }
  .hero-title { font-size: 2.5rem; }
}

