/* ═══════════════════════════════════════════════════════
   AutoMixSJ88 Python Edition — PREMIUM UPGRADE LAYER
   Features that ROOT/CODEX versions DO NOT have
   ═══════════════════════════════════════════════════════ */

/* ─── Aurora Floating Orbs ──────────────────────────── */
.aurora-orbs {
  position: fixed; inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
.aurora-orb:nth-child(1) {
  width: 500px; height: 500px;
  background: #8b5cf6;
  top: -10%; left: -5%;
  animation: orb1 18s;
}
.aurora-orb:nth-child(2) {
  width: 600px; height: 600px;
  background: #3b82f6;
  bottom: -15%; right: -10%;
  animation: orb2 22s;
}
.aurora-orb:nth-child(3) {
  width: 350px; height: 350px;
  background: #06b6d4;
  top: 50%; left: 40%;
  animation: orb3 15s;
  opacity: 0.07;
}
.aurora-orb:nth-child(4) {
  width: 280px; height: 280px;
  background: #ec4899;
  top: 20%; right: 15%;
  animation: orb4 20s;
  opacity: 0.06;
}
@keyframes orb1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.15); }
}
@keyframes orb2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-70px, -50px) scale(1.1); }
}
@keyframes orb3 {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.07; }
  100% { transform: translate(40px, -80px) scale(1.3); opacity: 0.1; }
}
@keyframes orb4 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, 30px) scale(0.85); }
}

/* ─── Holographic Card Borders ──────────────────────── */
.card-holo {
  position: relative;
  z-index: 1;
}
.card-holo::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--holo-angle, 0deg),
    #8b5cf6 0%,
    #3b82f6 15%,
    #06b6d4 30%,
    #10b981 45%,
    #f59e0b 60%,
    #ec4899 75%,
    #8b5cf6 100%
  );
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
}
.card-holo:hover::after {
  opacity: 0.6;
  animation: holoSpin 4s linear infinite;
}
@keyframes holoSpin {
  to { --holo-angle: 360deg; }
}
/* Fallback for browsers that don't support @property */
@property --holo-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ─── Auth Floating Particles ───────────────────────── */
.auth-particles {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.auth-particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-1);
  opacity: 0;
  animation: particleFloat linear infinite;
}
.auth-particle:nth-child(1) { width: 6px; height: 6px; left: 15%; animation-duration: 12s; animation-delay: 0s; }
.auth-particle:nth-child(2) { width: 4px; height: 4px; left: 30%; animation-duration: 15s; animation-delay: 2s; background: var(--accent-3); }
.auth-particle:nth-child(3) { width: 8px; height: 8px; left: 50%; animation-duration: 10s; animation-delay: 4s; }
.auth-particle:nth-child(4) { width: 3px; height: 3px; left: 65%; animation-duration: 18s; animation-delay: 1s; background: var(--accent-4); }
.auth-particle:nth-child(5) { width: 5px; height: 5px; left: 80%; animation-duration: 14s; animation-delay: 3s; background: #ec4899; }
.auth-particle:nth-child(6) { width: 7px; height: 7px; left: 25%; animation-duration: 11s; animation-delay: 5s; background: var(--accent-2); }
.auth-particle:nth-child(7) { width: 4px; height: 4px; left: 70%; animation-duration: 16s; animation-delay: 6s; }
.auth-particle:nth-child(8) { width: 6px; height: 6px; left: 45%; animation-duration: 13s; animation-delay: 7s; background: var(--accent-4); }
@keyframes particleFloat {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.5; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ─── Auth Card — Glassmorphism Ultra ───────────────── */
.auth-card {
  overflow: visible;
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(
    from 180deg,
    rgba(139, 92, 246, 0.3),
    rgba(99, 102, 241, 0.15),
    rgba(59, 130, 246, 0.3),
    rgba(6, 182, 212, 0.15),
    rgba(139, 92, 246, 0.3)
  );
  z-index: -1;
  animation: authBorderSpin 8s linear infinite;
  filter: blur(1px);
}
@keyframes authBorderSpin {
  to { transform: rotate(360deg); }
}

/* ─── Animated Gradient Title ───────────────────────── */
.page-header h2 {
  background: linear-gradient(
    90deg,
    #8b5cf6 0%,
    #6366f1 20%,
    #3b82f6 40%,
    #06b6d4 60%,
    #8b5cf6 80%,
    #6366f1 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientText 4s linear infinite;
}
@keyframes gradientText {
  to { background-position: 200% center; }
}

/* ─── Upgraded Sidebar — Gradient Active + Glow ────── */
.nav-item.active {
  background: linear-gradient(135deg,
    rgba(139, 92, 246, 0.12) 0%,
    rgba(99, 102, 241, 0.08) 50%,
    rgba(59, 130, 246, 0.12) 100%
  );
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.08);
}
.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
}

/* ─── Sidebar Gradient Line ─────────────────────────── */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(139, 92, 246, 0.3) 20%,
    rgba(59, 130, 246, 0.4) 50%,
    rgba(6, 182, 212, 0.3) 80%,
    transparent 100%
  );
}

/* ─── Upgraded Stat Cards — Gradient BG ─────────────── */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: var(--accent-gradient);
  opacity: 0.06;
  filter: blur(40px);
  transition: opacity 0.5s ease;
}
.stat-card:hover::before {
  opacity: 0.12;
}
.stat-value {
  position: relative;
  z-index: 1;
}

/* ─── Card Shimmer on Hover ─────────────────────────── */
.card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 50%,
    transparent 100%
  );
  transition: none;
  pointer-events: none;
}
.card:hover::after {
  animation: cardShimmer 0.8s ease;
}
@keyframes cardShimmer {
  0%   { left: -50%; }
  100% { left: 150%; }
}

/* ─── Button Glow Pulse (Primary) ───────────────────── */
.btn-primary {
  position: relative;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--accent-gradient);
  z-index: -1;
  filter: blur(12px);
  opacity: 0.35;
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.btn-primary:hover::before {
  opacity: 0.55;
  filter: blur(18px);
}

/* ─── Logo Morph Animation ──────────────────────────── */
.sidebar-logo .logo-icon {
  animation: logoPulse 4s ease-in-out infinite, logoMorph 8s ease-in-out infinite;
}
@keyframes logoMorph {
  0%, 100% { border-radius: 12px; }
  25% { border-radius: 16px 12px 18px 12px; }
  50% { border-radius: 14px 18px 12px 16px; }
  75% { border-radius: 12px 14px 16px 18px; }
}

/* ─── Upgraded Voice Status — Neon Glow ─────────────── */
.voice-status-badge.voice-status-idle {
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}
.voice-status-badge.voice-status-busy {
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
  animation: badgePulse 2s ease-in-out infinite, neonPulse 1.5s ease-in-out infinite;
}
@keyframes neonPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 0 40px rgba(59, 130, 246, 0.2); }
}

/* ─── Upload Zone Upgrade — Animated Border ─────────── */
.upload-zone {
  background-image: repeating-linear-gradient(
    0deg,
    var(--border), var(--border) 8px,
    transparent 8px, transparent 16px
  );
  background-size: 1px 100%;
  background-position: 0 0;
  border: none;
  position: relative;
  z-index: 1;
}
.upload-zone::before {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--bg-primary);
  border-radius: calc(var(--radius-lg) - 2px);
  z-index: -1;
}
.upload-zone:hover {
  background-image: repeating-linear-gradient(
    0deg,
    var(--accent-1), var(--accent-1) 8px,
    transparent 8px, transparent 16px
  );
  border: none;
}

/* ─── Scrollbar Upgrade ─────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139,92,246,0.2), rgba(59,130,246,0.2));
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(139,92,246,0.4), rgba(59,130,246,0.4));
}

/* ─── Focus Ring — Animated ─────────────────────────── */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-1);
  box-shadow:
    0 0 0 3px rgba(139, 92, 246, 0.12),
    0 0 20px rgba(139, 92, 246, 0.08),
    0 0 40px rgba(99, 102, 241, 0.04);
  animation: focusGlow 2s ease-in-out infinite alternate;
}
@keyframes focusGlow {
  0%   { box-shadow: 0 0 0 3px rgba(139,92,246,0.12), 0 0 20px rgba(139,92,246,0.08); }
  100% { box-shadow: 0 0 0 3px rgba(99,102,241,0.18), 0 0 28px rgba(99,102,241,0.12); }
}

/* ─── Script Card — Rainbow Border Accent ───────────── */
.script-result-card {
  position: relative;
  overflow: visible;
}
.script-result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, #8b5cf6, #3b82f6, #06b6d4, #10b981);
  border-radius: 3px 0 0 3px;
  opacity: 0.7;
}

/* ─── File Items — Stagger In ───────────────────────── */
.file-list .file-item {
  animation: staggerIn 0.3s var(--ease-smooth) backwards;
}
.file-list .file-item:nth-child(1)  { animation-delay: 0.02s; }
.file-list .file-item:nth-child(2)  { animation-delay: 0.05s; }
.file-list .file-item:nth-child(3)  { animation-delay: 0.08s; }
.file-list .file-item:nth-child(4)  { animation-delay: 0.11s; }
.file-list .file-item:nth-child(5)  { animation-delay: 0.14s; }
.file-list .file-item:nth-child(6)  { animation-delay: 0.17s; }
.file-list .file-item:nth-child(7)  { animation-delay: 0.20s; }
.file-list .file-item:nth-child(8)  { animation-delay: 0.23s; }
.file-list .file-item:nth-child(9)  { animation-delay: 0.26s; }
.file-list .file-item:nth-child(10) { animation-delay: 0.29s; }
@keyframes staggerIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Job Card — Status Stripe ──────────────────────── */
.job-card { position: relative; overflow: hidden; }
.job-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--accent-gradient);
  opacity: 0.5;
}

/* ─── Toast Progress Bar ────────────────────────────── */
.toast {
  position: relative;
  overflow: hidden;
}
.toast::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: currentColor;
  opacity: 0.3;
  animation: toastProgress 4s linear forwards;
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ─── Hover Cursor Trail (Card Only) ────────────────── */
.card {
  background-image: radial-gradient(
    300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(139, 92, 246, 0.03) 0%,
    transparent 100%
  );
}

/* ─── Voice Manual Box — Glow Border ────────────────── */
.voice-manual-box {
  position: relative;
  overflow: hidden;
}
.voice-manual-box::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 200%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,92,246,0.4), transparent);
  animation: scanLine 4s linear infinite;
}
@keyframes scanLine {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* ─── Settings Table Row Hover — Accent ─────────────── */
.settings-table tr:hover td {
  background: linear-gradient(90deg,
    rgba(139, 92, 246, 0.03) 0%,
    rgba(59, 130, 246, 0.02) 100%
  );
}

/* ─── Auth Card — Breathing Shadow ──────────────────── */
.auth-card {
  animation: authBreathe 4s ease-in-out infinite;
}
@keyframes authBreathe {
  0%, 100% {
    box-shadow:
      0 8px 44px rgba(0,0,0,0.55),
      0 0 60px rgba(99,102,241,0.06);
  }
  50% {
    box-shadow:
      0 12px 56px rgba(0,0,0,0.6),
      0 0 80px rgba(139,92,246,0.10),
      0 0 120px rgba(59,130,246,0.05);
  }
}
