/* ========================================
   ANDROID 16 PIXEL ENHANCEMENTS
   Additional styling for Pixel-specific aesthetics
   ======================================== */

/* === SMOOTH SCROLLING & PERFORMANCE === */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* === ENHANCED GRADIENTS (Pixel Style) === */
.gradient-primary {
  background: linear-gradient(135deg, 
    var(--md-sys-color-primary) 0%, 
    var(--md-sys-color-tertiary) 100%);
}

.gradient-surface {
  background: linear-gradient(180deg, 
    var(--md-sys-color-surface) 0%, 
    var(--md-sys-color-surface-container-low) 100%);
}

/* === GLASS MORPHISM (Android 16 Aesthetic) === */
.glass-effect {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .glass-effect {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === ENHANCED SHADOWS (Pixel Depth) === */
.shadow-soft {
  box-shadow: 
    0px 2px 8px 0px rgba(0, 0, 0, 0.04),
    0px 4px 16px 4px rgba(0, 0, 0, 0.03);
}

.shadow-medium {
  box-shadow: 
    0px 4px 12px 0px rgba(0, 0, 0, 0.08),
    0px 8px 24px 8px rgba(0, 0, 0, 0.05);
}

.shadow-strong {
  box-shadow: 
    0px 8px 20px 0px rgba(0, 0, 0, 0.12),
    0px 16px 40px 16px rgba(0, 0, 0, 0.08);
}

/* === RIPPLE EFFECT (Material You) === */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* === SMOOTH TRANSITIONS === */
.transition-all {
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.transition-transform {
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.transition-opacity {
  transition: opacity var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

/* === HOVER LIFT EFFECT === */
.hover-lift {
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
              box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--md-sys-elevation-4);
}

/* === PULSE ANIMATION (Subtle) === */
@keyframes pulse-subtle {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.pulse-subtle {
  animation: pulse-subtle 3s ease-in-out infinite;
}

/* === GLOW EFFECT (Pixel Accent) === */
.glow-primary {
  box-shadow: 0 0 20px rgba(26, 115, 232, 0.3);
}

.glow-secondary {
  box-shadow: 0 0 20px rgba(0, 137, 123, 0.3);
}

[data-theme="dark"] .glow-primary {
  box-shadow: 0 0 30px rgba(168, 199, 250, 0.4);
}

[data-theme="dark"] .glow-secondary {
  box-shadow: 0 0 30px rgba(77, 182, 172, 0.4);
}

/* === SHIMMER LOADING EFFECT === */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--md-sys-color-surface-container-low) 0%,
    var(--md-sys-color-surface-container-high) 50%,
    var(--md-sys-color-surface-container-low) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

/* === ENHANCED FOCUS STATES === */
*:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
  border-radius: var(--shape-corner-sm);
}

/* === SMOOTH SCALE ON ACTIVE === */
.scale-on-press {
  transition: transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized);
}

.scale-on-press:active {
  transform: scale(0.96);
}

/* === GRADIENT TEXT (Pixel Branding) === */
.gradient-text {
  background: linear-gradient(135deg, 
    var(--md-sys-color-primary) 0%, 
    var(--md-sys-color-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === FLOATING ANIMATION === */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float {
  animation: float 3s ease-in-out infinite;
}

/* === FADE IN ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s var(--md-sys-motion-easing-emphasized) forwards;
}

/* === ENHANCED CARD INTERACTIONS === */
.interactive-card {
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.interactive-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--md-sys-elevation-4);
}

.interactive-card:active {
  transform: translateY(-4px) scale(0.98);
}

/* === BORDER ANIMATIONS === */
@keyframes border-flow {
  0%, 100% {
    border-color: var(--md-sys-color-primary);
  }
  50% {
    border-color: var(--md-sys-color-tertiary);
  }
}

.border-animated {
  border: 2px solid var(--md-sys-color-primary);
  animation: border-flow 3s ease-in-out infinite;
}

/* === BACKDROP BLUR (Modern Pixel UI) === */
.backdrop-blur-sm {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.backdrop-blur-md {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.backdrop-blur-lg {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* === SMOOTH COLOR TRANSITIONS === */
.color-transition {
  transition: color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              background-color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

/* === ENHANCED BUTTON STATES === */
.md3-btn-filled {
  position: relative;
  overflow: hidden;
}

.md3-btn-filled::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.md3-btn-filled:active::before {
  width: 300px;
  height: 300px;
}

/* === PIXEL-STYLE DIVIDERS === */
.divider-gradient {
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--md-sys-color-outline-variant) 50%, 
    transparent 100%);
  margin: var(--spacing-xl) 0;
}

/* === ENHANCED SCROLLBAR (Pixel Style) === */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--md-sys-color-surface-container-low);
  border-radius: var(--shape-corner-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: var(--shape-corner-sm);
  border: 2px solid var(--md-sys-color-surface-container-low);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--md-sys-color-outline);
}

/* === SELECTION STYLING === */
::selection {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

::-moz-selection {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

/* === ACCESSIBILITY ENHANCEMENTS === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
  .md3-card {
    border: 2px solid var(--md-sys-color-outline);
  }
  
  .md3-btn {
    border: 2px solid currentColor;
  }
}
