/* Custom variables for theme */
:root {
  --bg-primary: #050515;
  --bg-secondary: #0a0a23;
  --neon-blue: #00f2fe;
  --neon-purple: #9b51e0;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --glass-bg: rgba(15, 23, 42, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
}

/* Base Body Styles */
body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(155, 81, 224, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 242, 254, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

/* Glassmorphism Card Effect */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 242, 254, 0.25);
  box-shadow: 0 12px 40px 0 rgba(0, 242, 254, 0.15);
}

/* Glassmorphism Input Field */
.glass-input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}
.glass-input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

/* Neon Glow Animations & Effects */
.text-neon-glow {
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.5), 0 0 20px rgba(0, 242, 254, 0.2);
}
.text-purple-glow {
  text-shadow: 0 0 10px rgba(155, 81, 224, 0.5), 0 0 20px rgba(155, 81, 224, 0.2);
}

.btn-neon {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  color: white;
  z-index: 1;
  transition: all 0.3s ease;
}
.btn-neon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}
.btn-neon:hover::before {
  opacity: 1;
}
.btn-neon:hover {
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.6);
  transform: translateY(-2px);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-success {
  background: rgba(16, 185, 129, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: white;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
}
.toast-error {
  background: rgba(239, 68, 68, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: white;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

/* Navigation Link Animation */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* Floating Coffee Button pulsing glow effect */
.floating-coffee-pulse {
  background: rgba(15, 23, 42, 0.65);
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.4), 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(251, 191, 36, 0), 0 12px 40px 0 rgba(251, 191, 36, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(251, 191, 36, 0), 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  }
}

/* Auth Modal Overlay and Transition Styles */
.auth-modal-overlay {
  background-color: rgba(5, 5, 21, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.3s ease-in-out;
}

.auth-modal-card {
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-modal-open .auth-modal-card {
  transform: scale(1);
}

/* --- Visual Page Editor (Widget Editor) Styles --- */

.widget-row {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget-row:hover {
  border-color: rgba(0, 242, 254, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Form Fields within Widget Editor */
.widget-row .glass-input {
  background: rgba(5, 5, 20, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.widget-row .glass-input:focus {
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* --- Code Block and Copy Button Styles --- */

.widget-code pre {
  margin: 0;
  background: rgba(5, 5, 20, 0.85);
}

.copy-code-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

/* --- Responsive Video (Aspect Ratio) Styles --- */

.aspect-video {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.aspect-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* --- Async Loaded Image Boundaries & Skeleton Loader --- */

.widget-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background-color: rgba(15, 23, 42, 0.6);
  transition: opacity 0.3s ease-in-out;
}

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.6s infinite;
}

@keyframes loading-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
