/* ============================================
   FLYNN MUSIC BOT - SHARED STYLES
   Theme: The Kinetic Pulse
   ============================================ */

/* --- Theme Variables --- */
:root {
  --primary: #ba9eff;
  --primary-dim: #8455ef;
  --secondary: #a88cfb;
  --tertiary: #ff97b5;
  --surface: #0e0e0e;
  --surface-container: #1a1a1a;
  --surface-container-low: #131313;
  --surface-container-high: #20201f;
  --surface-container-highest: #262626;
  --on-surface: #ffffff;
  --on-surface-variant: #adaaaa;
  --error: #ff6e84;
}

html.light {
  --surface: #f5f5f5;
  --surface-container: #e8e8e8;
  --surface-container-low: #f0f0f0;
  --surface-container-high: #e0e0e0;
  --surface-container-highest: #d8d8d8;
  --on-surface: #1a1a1a;
  --on-surface-variant: #555555;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-container-highest);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dim);
}

/* --- Scroll Animations --- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.animate-visible {
  opacity: 1;
  transform: translateY(0);
}
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* --- Navbar Scrolled State --- */
nav.scrolled {
  background: rgba(14, 14, 14, 0.95) !important;
  box-shadow: 0 4px 30px rgba(186, 158, 255, 0.1) !important;
  backdrop-filter: blur(24px) !important;
}

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-menu.open {
  pointer-events: all;
  opacity: 1;
}
.mobile-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.mobile-menu-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 100%;
  background: var(--surface-container-low);
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.mobile-menu.open .mobile-menu-content {
  transform: translateX(0);
}
.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--on-surface);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}
.mobile-menu-close:hover {
  background: var(--surface-container-highest);
}
.mobile-nav {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav a {
  color: var(--on-surface-variant);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-radius: 8px;
  transition: all 0.2s;
}
.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--primary);
  background: rgba(186, 158, 255, 0.1);
}

/* --- FAQ Accordion --- */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.group.open .faq-answer {
  max-height: 200px;
  padding-top: 16px;
}

/* --- Input Error State --- */
.input-error {
  outline: 2px solid var(--error) !important;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- Button Loading State --- */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 1s linear infinite;
}

/* --- Smooth Scroll --- */
html {
  scroll-behavior: smooth;
}

/* --- Selection --- */
::selection {
  background: rgba(186, 158, 255, 0.3);
  color: #ffffff;
}

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- Print Styles --- */
@media print {
  nav, footer, .mobile-menu-btn {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
}

/* ============================================
   3D EFFECTS - REUSABLE ACROSS ALL PAGES
   ============================================ */

/* --- 3D Card Tilt --- */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.card-3d:hover {
  transform: perspective(1000px) rotateX(3deg) rotateY(-3deg) translateZ(10px);
  box-shadow: 20px 20px 60px rgba(186, 158, 255, 0.1),
              -5px -5px 20px rgba(255, 151, 181, 0.05);
}

/* --- 3D Floating Cards --- */
.float-3d {
  animation: float3d 5s ease-in-out infinite;
}
@keyframes float3d {
  0%, 100% { transform: translateY(0px) rotateX(0deg); }
  50% { transform: translateY(-12px) rotateX(2deg); }
}

/* --- 3D Glow Border --- */
.glow-3d {
  position: relative;
}
.glow-3d::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--tertiary), var(--secondary), var(--primary));
  background-size: 400% 400%;
  animation: glowRotate 4s linear infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.glow-3d:hover::before {
  opacity: 1;
}
@keyframes glowRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- 3D Depth Shadow --- */
.depth-3d {
  box-shadow: 0 1px 1px rgba(0,0,0,0.1),
              0 2px 2px rgba(0,0,0,0.1),
              0 4px 4px rgba(0,0,0,0.1),
              0 8px 8px rgba(0,0,0,0.1),
              0 16px 16px rgba(0,0,0,0.1);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.depth-3d:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 2px rgba(186, 158, 255, 0.1),
              0 4px 4px rgba(186, 158, 255, 0.1),
              0 8px 8px rgba(186, 158, 255, 0.1),
              0 16px 16px rgba(186, 158, 255, 0.1),
              0 32px 32px rgba(186, 158, 255, 0.1);
}

/* --- 3D Rotating Ring --- */
.ring-3d {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(186, 158, 255, 0.15);
  transform-style: preserve-3d;
}
.ring-3d.spin-x {
  animation: spinX 8s linear infinite;
}
.ring-3d.spin-y {
  animation: spinY 10s linear infinite;
}
.ring-3d.spin-z {
  animation: spinZ 12s linear infinite;
}
@keyframes spinX {
  from { transform: rotateX(0deg); }
  to { transform: rotateX(360deg); }
}
@keyframes spinY {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
@keyframes spinZ {
  from { transform: rotateZ(0deg); }
  to { transform: rotateZ(360deg); }
}

/* --- 3D Floating Particles --- */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.particle.float-1 { animation: drift1 6s ease-in-out infinite; }
.particle.float-2 { animation: drift2 8s ease-in-out infinite; }
.particle.float-3 { animation: drift3 7s ease-in-out infinite; }
.particle.float-4 { animation: drift4 5s ease-in-out infinite; }
.particle.float-5 { animation: drift5 9s ease-in-out infinite; }

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(20px, -30px) scale(1.5); opacity: 0.7; }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(-15px, -25px) scale(1.2); opacity: 0.6; }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0) scale(0.8); opacity: 0.2; }
  50% { transform: translate(25px, -20px) scale(1.4); opacity: 0.5; }
}
@keyframes drift4 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50% { transform: translate(-20px, -35px) scale(1.3); opacity: 0.8; }
}
@keyframes drift5 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(15px, -15px) scale(1.6); opacity: 0.6; }
}

/* --- 3D Perspective Container --- */
.perspective-container {
  perspective: 1200px;
  transform-style: preserve-3d;
}

/* --- 3D Tilt on Hover (for JS enhancement) --- */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

/* --- 3D Neon Pulse --- */
.neon-pulse {
  animation: neonPulse 2s ease-in-out infinite;
}
@keyframes neonPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(186, 158, 255, 0.3),
                0 0 10px rgba(186, 158, 255, 0.2),
                0 0 20px rgba(186, 158, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 10px rgba(186, 158, 255, 0.5),
                0 0 20px rgba(186, 158, 255, 0.3),
                0 0 40px rgba(186, 158, 255, 0.2),
                0 0 60px rgba(186, 158, 255, 0.1);
  }
}

/* --- 3D Gradient Shift --- */
.gradient-shift {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- 3D Icon Bounce --- */
.icon-bounce-3d {
  transition: transform 0.3s ease;
}
.icon-bounce-3d:hover {
  transform: perspective(500px) translateZ(20px) scale(1.1);
}

/* --- Ambient Background Glow --- */
.bg-glow {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.08;
}
.bg-glow-1 {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -200px;
  right: -200px;
  animation: glowMove1 20s ease-in-out infinite;
}
.bg-glow-2 {
  width: 500px;
  height: 500px;
  background: var(--tertiary);
  bottom: -150px;
  left: -150px;
  animation: glowMove2 25s ease-in-out infinite;
}
.bg-glow-3 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: glowMove3 18s ease-in-out infinite;
}
@keyframes glowMove1 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-50px, 80px); }
  66% { transform: translate(30px, -40px); }
}
@keyframes glowMove2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(60px, -50px); }
  66% { transform: translate(-40px, 30px); }
}
@keyframes glowMove3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* --- 3D Text Shadow --- */
.text-3d {
  text-shadow: 0 1px 0 rgba(186, 158, 255, 0.1),
               0 2px 0 rgba(186, 158, 255, 0.08),
               0 3px 0 rgba(186, 158, 255, 0.06),
               0 4px 0 rgba(186, 158, 255, 0.04),
               0 5px 10px rgba(186, 158, 255, 0.1);
}

/* --- 3D Card Stack --- */
.stack-3d {
  position: relative;
}
.stack-3d::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: rgba(186, 158, 255, 0.05);
  border: 1px solid rgba(186, 158, 255, 0.1);
  z-index: -1;
  transform: translateZ(-20px);
}
