/* ============================================================
   Project 0076 - Tech Dashboard Landing Page
   Palette: Slate-gray + Indigo-400 accents
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-deep: #0b1120;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --accent: #818cf8;
  --accent-dark: #6366f1;
  --accent-glow: rgba(129, 140, 248, 0.25);
  --accent-glow-strong: rgba(129, 140, 248, 0.45);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: rgba(51, 65, 85, 0.5);
  --success: #34d399;
  --warning: #fbbf24;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Courier New', monospace;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition-fast: 200ms;
  --transition-base: 300ms;
  --transition-slow: 500ms;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ---- Selection ---- */
::selection {
  background: rgba(129, 140, 248, 0.3);
  color: #fff;
}

/* ---- Focus Outline ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Utility: Dashboard Grid Background ---- */
.dashboard-grid {
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ---- Utility: Live Dot (Blinking) ---- */
.live-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 4px currentColor;
  }
  50% {
    opacity: 0.35;
    box-shadow: 0 0 10px currentColor;
  }
}

/* ---- Utility: Scroll Dot (Hero) ---- */
.scroll-dot {
  animation: scroll-bounce 1.8s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(6px);
    opacity: 0.3;
  }
}

/* ============================================================
   NAVBAR - Dark sidebar-inspired
   ============================================================ */

/* Nav link left-accent hover effect (sidebar feel) */
.nav-link {
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--accent);
  border-radius: 1px;
  transition: height var(--transition-base) ease;
}

.nav-link:hover::before {
  height: 16px;
}

/* ---- Mobile Sidebar Menu ---- */
#mobile-menu.active {
  transform: translateX(0);
}

#mobile-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Hamburger animation */
#hamburger.active .ham-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

#hamburger.active .ham-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

#hamburger.active .ham-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   HERO - Data visualization overlays
   ============================================================ */

/* Floating glass-morphism cards */
.float-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  min-width: 180px;
}

.float-card .bar {
  display: inline-block;
  transition: height 0.6s ease;
}

/* Floating animation variants */
.animate-float-slow {
  animation: float-slow 6s ease-in-out infinite;
}

.animate-float-slow-delayed {
  animation: float-slow 6s ease-in-out 2s infinite;
}

@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

/* Hero sparkline mini-bars */
.bar {
  display: inline-block;
  width: 6px;
  border-radius: 2px;
  background: rgba(129, 140, 248, 0.6);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  border: 1px solid rgba(129, 140, 248, 0.3);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.1) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

.btn-secondary {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ============================================================
   FEATURES - Dashboard widget cards
   ============================================================ */

.dash-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  transition: transform var(--transition-base) ease,
    box-shadow var(--transition-base) ease,
    border-color var(--transition-base) ease;
  position: relative;
  overflow: hidden;
}

/* Subtle top accent line */
.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-base) ease;
}

.dash-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 20px 40px -12px rgba(129, 140, 248, 0.15),
    0 0 0 1px rgba(129, 140, 248, 0.15);
  border-color: rgba(129, 140, 248, 0.3);
}

.dash-card:hover::before {
  opacity: 1;
}

/* Progress bar inside dash cards */
.progress-bar {
  width: 100%;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6366f1, #818cf8, #a5b4fc);
  background-size: 200% 100%;
  animation: progress-shimmer 2s linear infinite;
  transition: width 1.2s cubic-bezier(0.25, 0.8, 0.25, 1.2);
}

@keyframes progress-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================================
   STATS - KPI tiles with grid backgrounds
   ============================================================ */

.kpi-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-base) ease,
    box-shadow var(--transition-base) ease,
    border-color var(--transition-base) ease;
}

.kpi-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -8px rgba(129, 140, 248, 0.12),
    0 0 0 1px rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.25);
}

/* Subtle dot grid background on KPI tiles */
.kpi-grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(129, 140, 248, 0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   TESTIMONIAL CARDS
   ============================================================ */

.testimonial-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  transition: transform var(--transition-base) ease,
    box-shadow var(--transition-base) ease,
    border-color var(--transition-base) ease;
  position: relative;
}

/* Subtle corner decoration */
.testimonial-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 60px;
  background: radial-gradient(circle at bottom right, rgba(129, 140, 248, 0.06), transparent 70%);
  border-radius: 0 0 var(--radius-xl) 0;
  pointer-events: none;
}

.testimonial-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.4);
  border-color: rgba(129, 140, 248, 0.25);
}

/* ============================================================
   FAQ ACCORDION
   ============================================================ */

.faq-item {
  overflow: hidden;
}

.faq-item .faq-answer {
  transition: max-height 0.35s ease;
}

.faq-item.active .faq-question {
  border-color: rgba(129, 140, 248, 0.35) !important;
  background: rgba(30, 41, 59, 0.8);
}

.faq-question {
  cursor: pointer;
  background: var(--bg-secondary);
}

.faq-question:hover {
  background: rgba(30, 41, 59, 0.7);
}

/* ============================================================
   CTA SECTION - Glowing indigo accent
   ============================================================ */

/* Glow pulses for the CTA section */
#cta .bg-indigo-500\/10 {
  animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 0.7;
  }
}

/* ============================================================
   FOOTER
   ============================================================ */

footer a {
  text-decoration: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .dash-card {
    padding: 1.25rem;
  }

  .testimonial-card {
    padding: 1.25rem;
  }

  .kpi-tile {
    padding: 0.25rem;
  }

  .float-card {
    display: none;
  }

  .hero .dashboard-grid {
    background-size: 30px 30px;
  }
}

@media (max-width: 480px) {
  .kpi-tile .text-3xl {
    font-size: 1.5rem;
  }

  .faq-question span {
    font-size: 0.8125rem;
  }

  .btn-primary,
  .btn-secondary {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    font-size: 0.875rem;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
