@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
  --bg-dark:        #060713;
  --bg-sidebar:     #08091a;
  --bg-card:        #0b0d22;
  --bg-card-hover:  #0e102b;
  --border-color:   rgba(255, 255, 255, 0.08);
  --primary-purple: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  --accent-blue:    #38bdf8;
  --text-white:     #ffffff;
  --text-muted:     #94a3b8;
  --sidebar-w:      270px;
  --radius:         16px;
  --radius-sm:      10px;
}

/* Hide default cursor on desktop for custom glowing cursor */
@media (pointer: fine) {
  body, button, a, input, textarea, select {
    cursor: none !important;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── WELCOME TO QBrain Tech Intro Splash Overlay ─────────────────── */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(5, 6, 18, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s ease;
  pointer-events: auto;
}

.welcome-overlay.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-box {
  background: rgba(13, 14, 34, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  padding: 3rem 4rem;
  text-align: center;
  box-shadow: 0 0 50px rgba(99, 102, 241, 0.35), inset 0 0 30px rgba(56, 189, 248, 0.15);
  position: relative;
  overflow: hidden;
  animation: welcomeBoxPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.welcome-box::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 200%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.12), transparent);
  animation: scanLine 2s linear infinite;
}

@keyframes scanLine {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(50%); }
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 99px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #38bdf8;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
}

.welcome-title {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.4));
}

.welcome-sub {
  font-size: 0.92rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 1.8rem;
}

.welcome-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  margin: 0 auto;
  overflow: hidden;
}

.welcome-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #ec4899);
  border-radius: 99px;
  width: 0%;
  animation: welcomeFill 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes welcomeFill {
  to { width: 100%; }
}

/* ── Custom Glowing Mouse Cursor (Larger & Softer Glow) ──────────── */
.custom-cursor-dot {
  position: fixed;
  top: -6px; left: -6px;
  width: 12px; height: 12px;
  background: #38bdf8;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  box-shadow: 0 0 16px #38bdf8, 0 0 28px #f43f5e;
  transition: opacity 0.2s ease, transform 0.05s ease-out;
  will-change: transform;
}

.custom-cursor-ring {
  position: fixed;
  top: -26px; left: -26px;
  width: 52px; height: 52px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  border: 2px solid transparent;
  opacity: 0.85;
  background:
    linear-gradient(#060713, #060713) padding-box,
    linear-gradient(135deg, #ef4444 0%, #3b82f6 25%, #eab308 50%, #06b6d4 75%, #a855f7 100%) border-box;
  box-shadow:
    0 0 20px rgba(239, 68, 68, 0.5),
    0 0 32px rgba(59, 130, 246, 0.4),
    0 0 45px rgba(234, 179, 8, 0.35);
  animation: cursorRainbowGlow 3.5s linear infinite;
  transition: width 0.25s ease, height 0.25s ease, top 0.25s ease, left 0.25s ease, opacity 0.25s ease;
  will-change: transform;
}

.custom-cursor-ring.cursor-hover {
  width: 72px; height: 72px;
  top: -36px; left: -36px;
  opacity: 0.95;
  box-shadow:
    0 0 25px rgba(239, 68, 68, 0.75),
    0 0 42px rgba(59, 130, 246, 0.65),
    0 0 60px rgba(234, 179, 8, 0.55);
  animation: cursorRainbowGlow 1.4s linear infinite;
}

@keyframes cursorRainbowGlow {
  0%   { filter: hue-rotate(0deg) brightness(1.25); transform: rotate(0deg); }
  100% { filter: hue-rotate(360deg) brightness(1.25); transform: rotate(360deg); }
}

/* ── Body ───────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── App Layout ─────────────────────────────────────────────────── */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.75rem 1.4rem;
  flex-shrink: 0;
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.22s ease;
}

.sidebar-nav li a:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav li.active a {
  color: #ffffff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.sidebar-footer {
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border-color);
}

.private-badge-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.private-badge-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.private-badge-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-white);
}

.private-badge-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ── Main Content ───────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.25rem 3rem;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ── Header ─────────────────────────────────────────────────────── */
.header-bar {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.system-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

/* ── Cards & Hero ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.85rem;
  margin-bottom: 1.5rem;
  transition: all 0.25s ease;
  position: relative;
}

.hero-card {
  background: linear-gradient(135deg, #0e102a 0%, #0a0b1d 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 540px;
  z-index: 1;
}

.welcome-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.95rem;
  border-radius: 99px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.8rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 1.2rem;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.85rem;
  color: #ffffff;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1.85rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.22s ease;
  user-select: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Ripple Element */
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: rippleAnim 0.6s linear;
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(2.8); opacity: 0; }
}

/* ── Module Cards Layout ────────────────────────────────────────── */
.modules-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.module-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.module-info { max-width: 270px; }

.module-icon-box {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.module-icon-purple {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.module-icon-blue {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
}

.module-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.65rem;
  color: #ffffff;
}

.module-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.module-link {
  font-size: 0.88rem;
  font-weight: 700;
  color: #818cf8;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.module-link-blue { color: #38bdf8; }

.module-link:hover { color: #ffffff; }

/* ── Footer ─────────────────────────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.alert {
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.alert-success {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #86efac;
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 99px; }
