/* Additional custom styles for the Dew Styles documentation site */

/* Smooth transitions */
* {
  transition: color 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}

/* Glass morphism effect */
.glass-effect {
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Custom gradients */
.gradient-primary {
  background: linear-gradient(135deg, #4c91ff 0%, #8537fa 100%);
}

.gradient-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-success {
  background: linear-gradient(135deg, #10b08f 0%, #00f2fe 100%);
}

/* Color swatch animations */
.color-swatch {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.color-swatch:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Color palette specific styles */
.color-palette {
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.color-palette-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: 1px solid #e2e8f0;
}

.color-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.color-name {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Navigation effects */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #4c91ff, #8537fa);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Code block enhancements */
pre {
  position: relative;
  overflow: hidden;
}

pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

pre:hover::before {
  transform: translateX(100%);
}

/* Button hover effects */
.button-primary {
  background: linear-gradient(135deg, #4c91ff, #276cf0);
  position: relative;
  overflow: hidden;
}

.button-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.button-primary:hover::before {
  left: 100%;
}

/* Section animations */
.section-fade-in {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Parallax effect for hero section */
.parallax-bg {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Loading animation */
.loading-spinner {
  border: 2px solid #f3f4f6;
  border-top: 2px solid #4c91ff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Toast notifications */
.toast {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Copy button styles */
.copy-button {
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.copy-button:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.4) !important;
}

/* Spacing visualization */
.spacing-demo {
  background: linear-gradient(135deg, #4c91ff 0%, #8537fa 100%);
  border-radius: 4px;
  height: 24px;
  display: inline-block;
  vertical-align: middle;
}

.border-radius-demo {
  width: 60px;
  height: 40px;
  background: linear-gradient(135deg, #4c91ff 0%, #8537fa 100%);
  display: inline-block;
  vertical-align: middle;
}

.box-shadow-demo {
  width: 120px;
  height: 80px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #374151;
  border: 1px solid #e5e7eb;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #4c91ff, #8537fa);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #276cf0, #7211e3);
}

/* Feature cards */
.feature-card {
  transition: all 0.3s ease;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Color grid layout */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.color-item {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-item:hover {
  z-index: 10;
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.color-item-content {
  text-align: center;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.color-item-shade {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 2px;
}

.color-item-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Chart colors grid */
.chart-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.chart-color-item {
  background: white;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  cursor: pointer;
}

.chart-color-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.chart-color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 auto 8px;
  border: 2px solid #f3f4f6;
}

/* Responsive design */
@media (max-width: 768px) {
  .nav-link::after {
    display: none;
  }

  .color-swatch:hover {
    transform: none;
  }

  .feature-card:hover {
    transform: none;
  }

  .color-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  .color-item {
    padding: 4px;
  }

  .color-item-shade {
    font-size: 0.75rem;
  }

  .color-item-value {
    font-size: 0.625rem;
  }
}

/* Focus states for accessibility */
input:focus,
button:focus,
a:focus {
  outline: 2px solid #4c91ff;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .glass-effect {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .copy-button,
  .nav-link,
  footer {
    display: none !important;
  }

  .color-swatch {
    break-inside: avoid;
  }
}

/* Dark mode utilities (for future implementation) */
.dark {
  color-scheme: dark;
}

.dark .glass-effect {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Utility classes */
.text-shadow {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.backdrop-blur {
  backdrop-filter: blur(10px);
}

/* Animation delays for staggered effects */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}
