/* ============================================
   style.css - Enhanced UI Utilities & Animations
   Modern UI Foundation with Glassmorphism,
   Smooth Animations, Responsive Optimization
   & Accessibility Support
   ============================================ */

/* ============================================
   Base Enhancements
   ============================================ */
html {
  scroll-behavior: smooth;
}

/* ============================================
   Custom Font Definitions
   ============================================ */
@font-face {
  font-family: 'Earth';
  src: url('/fonts/earth.woff') format('woff'),
       url('/fonts/earth.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   Animation Keyframes
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bounce-subtle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* ============================================
   Carousel Animations (Preserved)
   ============================================ */
.carousel-slide {
  transition: opacity 1s ease-in-out;
}

/* Screenshot Item Hover Effect (Preserved) */
.screenshot-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.screenshot-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3),
              0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* Navbar Border Radius (Preserved) */
#navbar nav {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* ============================================
   Transition Effect Library
   ============================================ */

/* Duration Variants */
.transition-fast {
  transition-duration: 150ms;
}

.transition-normal {
  transition-duration: 300ms;
}

.transition-slow {
  transition-duration: 500ms;
}

.transition-slower {
  transition-duration: 700ms;
}

/* Easing Function Variants */
.ease-default {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.ease-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.ease-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-bounce {
  transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Property Variants */
.transition-all {
  transition-property: all;
}

.transition-transform {
  transition-property: transform;
}

.transition-opacity {
  transition-property: opacity;
}

.transition-colors {
  transition-property: color, background-color, border-color;
}

.transition-shadow {
  transition-property: box-shadow;
}

/* Combined Transitions */
.transition-base {
  transition-property: transform, opacity, box-shadow;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-smooth {
  transition-property: all;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   Interaction Feedback Classes
   ============================================ */

/* Hover Lift Effect */
.hover-lift {
  transition: transform var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2),
              0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Hover Glow Effect */
.hover-glow {
  transition: box-shadow var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4),
              0 0 40px rgba(59, 130, 246, 0.2);
}

/* Active Scale Feedback */
.active-scale {
  transition: transform var(--duration-fast, 150ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.active-scale:active {
  transform: scale(0.97);
}

/* Focus Ring Effect */
.focus-ring:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
  border-radius: 0.375rem;
}

/* Hover Scale Effect */
.hover-scale {
  transition: transform var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.hover-scale:hover {
  transform: scale(1.03);
}

/* Hover Brightness */
.hover-brightness {
  transition: filter var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.hover-brightness:hover {
  filter: brightness(1.1);
}

/* ============================================
   Responsive Utilities
   ============================================ */

/* Container Query Helpers */
.container-query {
  container-type: inline-size;
  container-name: main-container;
}

@container main-container (min-width: 768px) {
  .cq-stack {
    flex-direction: row;
  }

  .cq-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@container main-container (min-width: 1024px) {
  .cq-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Safe Area Adaptation (Mobile Notch) */
.safe-top {
  padding-top: env(safe-area-inset-top, 0);
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.safe-left {
  padding-left: env(safe-area-inset-left, 0);
}

.safe-right {
  padding-right: env(safe-area-inset-right, 0);
}

.safe-all {
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

/* Responsive Typography */
.text-responsive {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
}

.text-responsive-lg {
  font-size: clamp(1.25rem, 4vw, 2.5rem);
}

.text-responsive-xl {
  font-size: clamp(1.5rem, 5vw, 3.5rem);
}

/* ============================================
   Visual Enhancements
   ============================================ */

/* Carousel Button Styles (Enhanced) */
.carousel-btn {
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  transition: all var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
}

/* Image Hover Effects (Enhanced) */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform var(--duration-slow, 500ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.img-zoom:hover img {
  transform: scale(1.08);
}

.img-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.6) 100%
  );
  opacity: 0;
  transition: opacity var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.img-overlay:hover::after {
  opacity: 1;
}

/* Payment Label Styling (Enhanced) */
.payment-label span {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.payment-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: all var(--duration-normal, 300ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.payment-label:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Badge Styles */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Tooltip Style */
.tooltip-wrapper {
  position: relative;
}

.tooltip-wrapper::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-fast, 150ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
  pointer-events: none;
  z-index: 700;
}

.tooltip-wrapper:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
}

.divider-vertical {
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
}

/* ============================================
   Navigation Link Underline Animation
   ============================================ */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 1px;
  transition: width 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Active state - always show underline */
.nav-link.active::after {
  width: 100%;
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip to Content Link */
.skip-to-content {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 1rem 2rem;
  background: var(--color-primary, #3b82f6);
  color: white;
  font-weight: 600;
  border-radius: 0 0 0.5rem 0.5rem;
  transition: top var(--duration-fast, 150ms) var(--ease-default, cubic-bezier(0.4, 0, 0.2, 1));
}

.skip-to-content:focus {
  top: 0;
  outline: none;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Focus Visible Enhancement */
*:focus-visible {
  outline: 2px solid var(--color-primary, #3b82f6);
  outline-offset: 2px;
}

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

  .carousel-slide,
  .screenshot-item,
  .hover-lift,
  .hover-glow,
  .active-scale,
  .hover-scale,
  .img-zoom img {
    transition: none !important;
  }

  .screenshot-item:hover,
  .hover-lift:hover,
  .hover-scale:hover,
  .img-zoom:hover img {
    transform: none !important;
  }

  @keyframes float {
    0%, 100% { transform: none; }
    50% { transform: none; }
  }

  @keyframes pulse-glow {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: none; }
  }

  @keyframes bounce-subtle {
    0%, 100% { transform: none; }
    50% { transform: none; }
  }
}

/* High Contrast Mode Support */
@media (forced-colors: active) {
  .glass,
  .glass-hover {
    border: 2px solid currentColor;
    background: Canvas;
  }

  .btn-interactive {
    border: 2px solid currentColor;
  }

  .focus-ring:focus-visible {
    outline: 3px solid currentColor;
  }
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }

  .glass,
  .glass-hover {
    background: white !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #e5e7eb !important;
  }

  body {
    background: white !important;
    color: black !important;
  }
}
