/* KeyGuard AI - Cyber-Noir Ultra-Smooth Animations & High-Contrast Styles */

:root {
  --primary: #c0c1ff;
  --primary-glow: rgba(99, 102, 241, 0.5);
  --secondary: #4cd7f6;
  --secondary-glow: rgba(6, 182, 212, 0.5);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.5);
  --crimson: #ef4444;
  --crimson-glow: rgba(239, 68, 68, 0.5);
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Universal Page Styling & Stable Scrollbar (Prevents layout shift) */
html {
  scrollbar-gutter: stable;
  background-color: #0a0d14;
}

body {
  background-color: #0a0d14;
  color: #e1e2ec;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

code, pre, kbd, samp, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace !important;
  font-feature-settings: "liga" 0, "calt" 0;
}

/* ==========================================================================
   PRIMARY ACTION BUTTON (High-Contrast Neon Gradient - Ultra Visible)
   ========================================================================== */
.bg-primary-gradient {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.3) !important;
  transition: all 0.25s var(--ease-spring) !important;
  cursor: pointer !important;
  will-change: transform, box-shadow;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.01) !important;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6), 0 0 25px rgba(6, 182, 212, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.5) !important;
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0px) scale(0.98) !important;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4) !important;
}

/* ==========================================================================
   PAGE & TAB TRANSITIONS (Silky Smooth Fade + Slide)
   ========================================================================== */
@keyframes pageSlideIn {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tab-content:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  animation: pageSlideIn 0.3s var(--ease-spring) forwards;
  will-change: opacity, transform;
}

/* ==========================================================================
   BUTTON & INTERACTIVE ELEMENT TRANSITIONS
   ========================================================================== */
button, a, input, select, textarea {
  transition: all 0.22s var(--ease-smooth);
}

/* Sidebar Navigation Buttons */
.nav-btn {
  position: relative;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-spring), box-shadow 0.25s ease !important;
}

.nav-btn:hover {
  transform: translateX(4px);
}

.nav-btn:active {
  transform: translateX(2px) scale(0.98);
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.15) !important;
  color: #c0c1ff !important;
  border-right: 3px solid #6366f1 !important;
  box-shadow: inset 0 0 15px rgba(99, 102, 241, 0.1);
}

/* Action Icon Buttons */
button[title], button.p-1\.5 {
  transition: transform 0.2s var(--ease-spring), background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
}

button[title]:hover, button.p-1\.5:hover {
  transform: scale(1.15);
}

button[title]:active, button.p-1\.5:active {
  transform: scale(0.92);
}

/* Quick Duration Selector Buttons */
.quick-dur-btn {
  transition: all 0.2s var(--ease-smooth);
}

.quick-dur-btn:hover {
  transform: translateY(-1px);
}

.quick-dur-btn:active {
  transform: scale(0.96);
}

/* ==========================================================================
   GLASSMORPHISM CARDS & HOVER STATES
   ========================================================================== */
.glass-card {
  background: rgba(19, 23, 34, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: transform 0.3s var(--ease-spring), border-color 0.3s ease, box-shadow 0.3s ease;
  will-change: transform, border-color;
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 35px rgba(99, 102, 241, 0.06);
}

/* Table Row Hover Transitions */
tr {
  transition: background-color 0.2s ease, transform 0.2s ease;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.035) !important;
}

/* ==========================================================================
   MODAL DIALOG SMOOTH SCALE-IN
   ========================================================================== */
@keyframes modalScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#create-modal:not(.hidden) > div, #login-screen > div {
  animation: modalScaleIn 0.3s var(--ease-spring) forwards;
}

/* ==========================================================================
   GLOBAL CUSTOM CYBER-NOIR SCROLLBAR
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0b0e15;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: #1c2233;
  border-radius: 4px;
  border: 2px solid #0b0e15;
  transition: background-color 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #6366f1;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #1c2233 #0b0e15;
}

/* Status Radar Pulsing Animations */
@keyframes pulse-radar {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.pulse-green {
  animation: pulse-radar 2s infinite;
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.pulse-red {
  animation: pulse-red 2s infinite;
}

/* Logo and Neon Text Glow */
@keyframes glow-pulse {
  0% {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  }
  50% {
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 30px rgba(6, 182, 212, 0.6);
  }
  100% {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  }
}

.logo-glow:hover {
  animation: glow-pulse 1.5s infinite alternate;
}

/* Mobile Drawer Navigation */
.mobile-menu {
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease-spring);
}

.mobile-menu.open {
  transform: translateX(0);
}

.overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* Animated Progress Bar */
.progress-bar-glow {
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.6), 0 0 30px rgba(99, 102, 241, 0.4);
  transition: width 0.4s var(--ease-spring);
}

@keyframes progress-stripe {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 0;
  }
}

.progress-striped {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  animation: progress-stripe 1.5s linear infinite;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(28, 34, 51, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  animation: toast-in 0.3s var(--ease-spring);
}

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

/* AI Copilot Animation Keyframes */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

.bg-size-200 {
  background-size: 200% auto;
}

.hover\:bg-pos-100:hover {
  background-position: right center;
}

/* Custom Scrollbar for Chat */
#ai-chat-messages::-webkit-scrollbar {
  width: 4px;
}
#ai-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.25);
  border-radius: 4px;
}
#ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

