/*
 * Custom styles for Hop Into Hangul
 *
 * Base utilities are provided by Tailwind CSS.
 * This file contains only project-specific custom styles.
 */

/* Form enhancements - custom focus states */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

@media (prefers-color-scheme: dark) {
  input[type="text"]:focus,
  input[type="email"]:focus,
  input[type="password"]:focus,
  input[type="time"]:focus,
  select:focus,
  textarea:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
  }
}

/* Flash message animation */
@keyframes slide-down {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-slide-down {
  animation: slide-down 0.3s ease-out;
}

/* Word View Stamp Icon Animation */
.word-view-stamp-container {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.word-view-stamp {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Initial state - gray outline only */
.stamp-outline {
  stroke: #d1d5db;
  opacity: 0.4;
  transition: opacity 200ms ease;
}

@media (prefers-color-scheme: dark) {
  .stamp-outline {
    stroke: #4b5563;
    opacity: 0.3;
  }
}

/* Fill circle - starts invisible */
.stamp-fill {
  fill: #dc2626; /* Traditional Korean stamp red */
  transform-origin: center;
  transform: scale(0);
  opacity: 0;
}

@media (prefers-color-scheme: dark) {
  .stamp-fill {
    fill: #ef4444; /* Brighter in dark mode */
  }
}

/* Checkmark icon - starts invisible */
.stamp-icon {
  stroke: white;
  transform-origin: center;
  transform: scale(0) rotate(-10deg);
  opacity: 0;
}

/* Animated state (triggered by JS) */
.word-view-stamp-animated .stamp-outline {
  opacity: 0;
}

.word-view-stamp-animated .stamp-fill {
  animation: stamp-fill-in 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.word-view-stamp-animated .stamp-icon {
  animation: stamp-icon-in 300ms cubic-bezier(0.34, 1.56, 0.64, 1) 250ms forwards;
}

/* Stamp fill animation - ink spreading effect */
@keyframes stamp-fill-in {
  0% {
    transform: scale(0) rotate(-5deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.15) rotate(2deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Icon appears after stamp */
@keyframes stamp-icon-in {
  0% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .word-view-stamp-animated .stamp-fill,
  .word-view-stamp-animated .stamp-icon {
    animation: none;
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }

  .stamp-fill {
    transform: scale(1);
    opacity: 1;
  }

  .stamp-icon {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Mobile size adjustment */
@media (max-width: 640px) {
  .word-view-stamp-container {
    width: 40px;
    height: 40px;
  }
}
