/* ==========================================================================
   UniMate AI — Precision Engineering Stylesheet
   Theme: Deep Obsidian & Electric Sapphire Accent
   Designed for Ahmad Yardan Rasika (ardans-dev)
   ========================================================================== */

:root {
  /* Color Palette - Clean, Grounded, High Contrast */
  --bg-deep: #070b14;
  --bg-surface: #0a0f1d;
  --bg-card: rgba(13, 19, 34, 0.85);
  --bg-card-hover: rgba(18, 27, 49, 0.95);
  --bg-glass: rgba(10, 15, 29, 0.9);

  /* Accents */
  --sapphire-blue: #0284c7;
  --sapphire-bright: #38bdf8;
  --sky-subtle: rgba(56, 189, 248, 0.15);
  --emerald-accent: #10b981;
  --amber-accent: #f59e0b;
  --rose-accent: #f43f5e;

  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.35);

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Space Grotesk', sans-serif;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  scroll-behavior: smooth;
  color-scheme: dark;
  overflow-x: hidden;
}

/* Clean, crisp engineering background without hazy colorful fog */
body {
  position: relative;
  min-height: 100vh;
  line-height: 1.6;
  background-color: var(--bg-deep);
  background-image: radial-gradient(rgba(56, 189, 248, 0.07) 1px, transparent 1px);
  background-size: 32px 32px;
}

::selection {
  background-color: rgba(2, 132, 199, 0.4);
  color: #ffffff;
}

/* Navigation Glass */
.glass-nav {
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Cards - Crisp, Solid, No Cliché Top-Shimmer */
.unimate-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 0.875rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.unimate-card:not(.flashcard-face):hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.7);
}

.flashcard-face:hover {
  background-color: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.35);
}

/* Buttons - Professional & Controlled */
.btn-unimate-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  background-color: #0284c7;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 10px 0 rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
}

.btn-unimate-primary:hover {
  background-color: #0369a1;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 4px 16px 0 rgba(2, 132, 199, 0.4);
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-unimate-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-unimate-outline:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  border-radius: 0.45rem;
}

/* Badges */
.badge-unimate {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-sky {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-indigo {
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ==========================================================================
   3D Flip Flashcard Engine (Flicker-Free & Rock-Solid)
   ========================================================================== */
.perspective-1000 {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  cursor: pointer;
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

/* Base Flashcard Faces */
.flashcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  border-radius: 0.875rem;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.flip-card-inner .unimate-card,
.flip-card-inner .unimate-card:hover,
.flashcard-face,
.flashcard-face:hover {
  transform: none;
}

.flashcard-front {
  transform: rotateY(0deg) !important;
  z-index: 2;
  pointer-events: auto;
}

.flip-card-inner.flipped .flashcard-front {
  transform: rotateY(0deg) !important;
  z-index: 1;
  pointer-events: none;
}

.flashcard-back {
  transform: rotateY(180deg) !important;
  z-index: 1;
  pointer-events: none;
}

.flip-card-inner.flipped .flashcard-back {
  transform: rotateY(180deg) !important;
  z-index: 2;
  pointer-events: auto;
}

.flashcard-back:hover,
.flip-card-inner.flipped .flashcard-back:hover {
  transform: rotateY(180deg) !important;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #0f172a;
  color: #f8fafc;
  padding: 0.7rem 1.15rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7);
  transform: translateY(15px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Subtle, Controlled Pulse Dot (Restricted to Terminal Telemetry) */
.pulse-dot-sky {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
}

.pulse-dot-sky::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background-color: #10b981;
  opacity: 0.35;
  animation: skyPing 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes skyPing {
  75%, 100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #070b14;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--sapphire-blue);
}

/* FAQ Accordion */
.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0, 1, 0, 1);
}

.faq-item.active .faq-content {
  max-height: 500px;
  transition: max-height 0.3s ease-in-out;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
}

/* Code Snippet & Terminal Window Box */
.terminal-window {
  background-color: #090e1a;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.875rem;
  color: #e2e8f0;
  overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.75);
}
