/* ==========================================================================
   Data Master Academy - Elite High-End Data Engineering Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #030712;
  --bg-secondary: #080D1A;
  --bg-card: rgba(13, 20, 36, 0.7);
  --accent-cyan: #06B6D4;
  --accent-emerald: #10B981;
  --accent-purple: #8B5CF6;
  --accent-blue: #3B82F6;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(6, 182, 212, 0.4);
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Custom Base */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  selection-background-color: #06B6D4;
  selection-color: #030712;
}

::selection {
  background: rgba(6, 182, 212, 0.3);
  color: #38BDF8;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #030712;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.5);
}

/* Engineering Grid Background */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.bg-dots-pattern {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Glassmorphism */
.glass-panel {
  background: rgba(11, 18, 33, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-panel-hover {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.glass-panel-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 12px 30px -10px rgba(6, 182, 212, 0.15);
}

/* Glowing Neon Elements */
.glow-cyan {
  box-shadow: 0 0 35px -5px rgba(6, 182, 212, 0.35);
}
.glow-emerald {
  box-shadow: 0 0 35px -5px rgba(16, 185, 129, 0.3);
}
.glow-purple {
  box-shadow: 0 0 35px -5px rgba(139, 92, 246, 0.3);
}

/* Gradient Text */
.text-gradient-cyan {
  background: linear-gradient(135deg, #FFFFFF 0%, #38BDF8 60%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #FFFFFF 0%, #34D399 60%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, #FFFFFF 0%, #C084FC 60%, #9333EA 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-fire {
  background: linear-gradient(135deg, #FBBF24 0%, #F97316 50%, #EF4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Modern Typography Utilities */
.font-mono-code {
  font-family: var(--font-mono);
}
.font-display {
  font-family: var(--font-display);
}

/* Animated Pulse Rings */
@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.pulse-ring-effect {
  position: relative;
}
.pulse-ring-effect::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  border: 1px solid currentColor;
  animation: pulse-ring 2.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

/* Terminal & Code View */
.code-line-num {
  user-select: none;
  color: #4B5563;
  text-align: right;
  padding-right: 1.25rem;
}

.terminal-scroll::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.terminal-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Canvas Container */
#pipeline-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}

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

.toast-item {
  pointer-events: auto;
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

@keyframes toast-in {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.toast-out {
  transform: translateX(30px);
  opacity: 0;
}

/* Modal styling */
.modal-backdrop {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(3, 7, 18, 0.85);
}

/* Scanline Effect */
.scanline {
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.2)
  );
  background-size: 100% 4px;
}

/* Glowing Border Animation */
@keyframes borderGlow {
  0%, 100% { border-color: rgba(6, 182, 212, 0.4); box-shadow: 0 0 15px rgba(6, 182, 212, 0.2); }
  50% { border-color: rgba(139, 92, 246, 0.5); box-shadow: 0 0 20px rgba(139, 92, 246, 0.25); }
}

.border-animate-glow {
  animation: borderGlow 6s ease-in-out infinite;
}

/* ==========================================================================
   Mini-Games: Sophisticated Roulette Wheel & Result Reveal
   ========================================================================== */
.roulette-wheel {
  position: relative;
  will-change: transform;
  border-radius: 9999px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.05),
    0 0 0 6px rgba(12, 16, 28, 0.95),
    0 0 0 7px rgba(255, 255, 255, 0.08),
    inset 0 0 0 3px rgba(255, 255, 255, 0.1),
    inset 0 0 36px rgba(0, 0, 0, 0.65),
    0 20px 60px -20px rgba(0, 0, 0, 0.9);
}

.roulette-wheel.is-spinning {
  filter: drop-shadow(0 0 28px rgba(251, 191, 36, 0.45)) drop-shadow(0 0 60px rgba(168, 85, 247, 0.35));
}

/* Casino-style frets (marcadores) ao redor do aro */
.roulette-marker {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.roulette-marker-dot {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 15px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fef3c7 0%, #d4af37 45%, #8a6d1f 100%);
  box-shadow:
    0 0 6px rgba(251, 191, 36, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Gloss / reflexo de vidro */
.roulette-gloss {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.06) 30%, transparent 52%),
    radial-gradient(circle at 50% 50%, transparent 62%, rgba(0, 0, 0, 0.38) 100%);
}

/* Luz varrendo o disco durante o giro */
.roulette-sweep {
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 255, 255, 0.05) 12deg,
    rgba(255, 255, 255, 0.28) 22deg,
    rgba(255, 255, 255, 0.05) 32deg,
    transparent 44deg
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.roulette-sweep.is-active {
  opacity: 1;
  animation: roulette-sweep-spin 0.85s linear infinite;
}

@keyframes roulette-sweep-spin {
  to { transform: rotate(360deg); }
}

/* Hub central metálico */
.roulette-hub {
  background: radial-gradient(circle at 35% 30%, #fef3c7 0%, #d4af37 40%, #7c5a12 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 0 0 4px rgba(10, 12, 20, 0.9),
    0 0 0 6px rgba(212, 175, 55, 0.25),
    0 10px 24px rgba(0, 0, 0, 0.6);
}

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

#roulette-pointer {
  animation: roulette-pointer-bounce 1s ease-in-out infinite;
}

@keyframes result-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.result-card-enter {
  animation: result-card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
