/**
 * Glassmorphism UI System for Vedika.io
 * Modern 2025 design language with cosmic theme
 * Based on Apple's design system + Awwwards 2025 winners
 */

:root {
  /* Cosmic Color Palette */
  --cosmic-purple: #8b5cf6;
  --cosmic-pink: #ec4899;
  --cosmic-indigo: #6366f1;
  --cosmic-violet: #764ba2;

  /* Background Depths */
  --deep-space: #0a0f2c;
  --nebula-dark: #1a1a3a;
  --nebula-light: #2a2a5a;

  /* Glass Variables */
  --glass-bg: rgba(139, 92, 246, 0.08);
  --glass-bg-hover: rgba(139, 92, 246, 0.15);
  --glass-border: rgba(139, 92, 246, 0.2);
  --glass-border-hover: rgba(139, 92, 246, 0.4);

  /* Shadows */
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.25),
                  inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --glass-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.35),
                     inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Base Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  box-shadow: var(--glass-shadow-lg);
  transform: translateY(-2px);
}

/* Glass Navigation (Sticky) */
.glass-nav {
  background: rgba(10, 15, 44, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Glass Button (Primary CTA) */
.glass-btn {
  background: linear-gradient(135deg, var(--cosmic-purple), var(--cosmic-pink));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.glass-btn:hover {
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.02);
}

.glass-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Glass Input Field */
.glass-input {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  border: 1.5px solid var(--glass-border);
  border-radius: 10px;
  color: white;
  padding: 12px 16px;
  transition: all 0.3s ease;
}

.glass-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--cosmic-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.glass-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Glass Badge/Tag */
.glass-badge {
  background: rgba(139, 92, 246, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Glass Modal/Dialog */
.glass-modal {
  background: rgba(26, 26, 58, 0.92);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Holographic Border Effect */
.holographic-border {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 2px;
  overflow: hidden;
}

.holographic-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--cosmic-purple),
    var(--cosmic-pink),
    var(--cosmic-indigo),
    var(--cosmic-violet)
  );
  background-size: 300% 300%;
  animation: holographic 8s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

@keyframes holographic {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.holographic-border > * {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  border-radius: 14px;
  padding: 20px;
}

/* Iridescent Text */
.iridescent-text {
  background: linear-gradient(
    135deg,
    var(--cosmic-purple),
    var(--cosmic-pink),
    var(--cosmic-indigo),
    var(--cosmic-violet)
  );
  background-size: 200% 200%;
  animation: iridescent 10s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

@keyframes iridescent {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Frosted Glass Panel (for sidebar/overlays) */
.frosted-glass {
  background: rgba(26, 26, 58, 0.7);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-right: 1px solid rgba(139, 92, 246, 0.15);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

/* Glass Divider */
.glass-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.3) 50%,
    transparent
  );
  margin: 24px 0;
}

/* Glass Tooltip */
.glass-tooltip {
  background: rgba(26, 26, 58, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: white;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Glow Effect on Hover */
.glow-hover {
  transition: all 0.3s ease;
}

.glow-hover:hover {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4),
              0 0 40px rgba(139, 92, 246, 0.2),
              0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Animated Shimmer Effect */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Neumorphism (Soft UI) - Alternative Style */
.neomorphic {
  background: linear-gradient(145deg, #1e1e3a, #25254a);
  box-shadow: 8px 8px 16px #15152a,
              -8px -8px 16px #2f2f5a;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.neomorphic:hover {
  box-shadow: 12px 12px 24px #15152a,
              -12px -12px 24px #2f2f5a;
}

/* Cosmic Grid Background */
.cosmic-grid {
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 50px 50px;
  position: relative;
}

.cosmic-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, var(--deep-space) 100%);
  pointer-events: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .glass-card {
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
  }

  .glass-nav {
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
  }

  .frosted-glass {
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
  }
}

/* Vanta.js Container - Fallback Gradient (Darker to match logo) */
#vanta-hero-bg {
  background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
              linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 50%, #0f0a1f 100%);
}

/* When Vanta loads, it replaces the background */
#vanta-hero-bg canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
}

/* Performance: Reduce effects on low-power devices */
@media (prefers-reduced-motion: reduce) {
  .glass-card,
  .glass-btn,
  .glass-input,
  .glow-hover,
  .holographic-border,
  .shimmer {
    transition: none;
    animation: none;
  }

  .holographic-border::before,
  .shimmer::after {
    display: none;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  :root {
    --glass-bg: rgba(139, 92, 246, 0.1);
    --glass-bg-hover: rgba(139, 92, 246, 0.18);
  }
}
