/* Global CSS styles */

/* Reset and base styles */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html,
body {
  max-width: 100vw;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Disable double-tap zoom on mobile */
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}

/* Remove tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent text selection on buttons */
button {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Remove default button styles */
button {
  font-family: inherit;
}

/* Form inputs on mobile */
input,
textarea,
select {
  font-size: 16px; /* Prevents zoom on iOS when focusing inputs */
}

/* Page transition animations */
.page-transition-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}

.page-transition-exit {
  opacity: 1;
}

.page-transition-exit-active {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Staggered fade in for grid items */
.fade-in-stagger {
  opacity: 0;
  animation: fadeIn 0.4s ease-out forwards;
}

.fade-in-stagger:nth-child(1) { animation-delay: 0.05s; }
.fade-in-stagger:nth-child(2) { animation-delay: 0.1s; }
.fade-in-stagger:nth-child(3) { animation-delay: 0.15s; }
.fade-in-stagger:nth-child(4) { animation-delay: 0.2s; }
.fade-in-stagger:nth-child(5) { animation-delay: 0.25s; }
.fade-in-stagger:nth-child(6) { animation-delay: 0.3s; }
.fade-in-stagger:nth-child(7) { animation-delay: 0.35s; }
.fade-in-stagger:nth-child(8) { animation-delay: 0.4s; }
.fade-in-stagger:nth-child(9) { animation-delay: 0.45s; }

/* Smooth tab underline animation */
.tab-underline {
  position: absolute;
  bottom: 0;
  height: 3px;
  background-color: currentColor;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Content fade transition */
.content-fade {
  animation: contentFade 0.3s ease-out;
}

@keyframes contentFade {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal animations */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-backdrop {
  animation: modalFadeIn 0.2s ease-out;
}

.modal-content {
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading skeleton */
@keyframes skeleton {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
  background-size: 200px 100%;
  animation: skeleton 1.2s ease-in-out infinite;
}