/* Custom styles and premium animations for QR Code Web Application */

:root {
  --color-glow: rgba(99, 102, 241, 0.15);
  --color-glow-hover: rgba(99, 102, 241, 0.3);
}

.dark {
  --color-glow: rgba(139, 92, 246, 0.1);
  --color-glow-hover: rgba(139, 92, 246, 0.25);
}

/* Base Body Grid Background */
body {
  background-attachment: fixed;
}

.bg-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

.dark .bg-grid {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}

/* Glassmorphism Styles */
.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dark .glass-panel {
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Ambient Glow for Preview */
.glow-preview {
  box-shadow: 0 0 40px var(--color-glow);
  transition: box-shadow 0.5s ease-in-out;
}

.glow-preview:hover {
  box-shadow: 0 0 50px var(--color-glow-hover);
}

/* Animation utilities */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Shimmer effect for loaders */
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.shimmer::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 2s infinite;
  content: '';
}

.dark .shimmer::after {
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.5);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(75, 85, 99, 0.7);
}

/* Custom inputs styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  background: rgba(156, 163, 175, 0.2);
  height: 6px;
  border-radius: 9999px;
}

.dark input[type="range"]::-webkit-slider-runnable-track {
  background: rgba(75, 85, 99, 0.4);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -5px; /* Centers thumb on the track */
  background-color: #6366f1;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  transition: transform 0.1s ease, background-color 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background-color: #4f46e5;
}

.dark input[type="range"]::-webkit-slider-thumb {
  background-color: #8b5cf6;
}

.dark input[type="range"]::-webkit-slider-thumb:hover {
  background-color: #7c3aed;
}

/* Quick animation for Tab Transition */
.tab-content {
  transition: all 0.3s ease-in-out;
}
