/* ============================================================
   ANIMATIONS.CSS - Transitions, Keyframes, Loading States
   ============================================================ */

/* ========== KEYFRAME ANIMATIONS ========== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

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

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

@keyframes scaleOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.95); opacity: 0; }
}

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

/* ========== ANIMATION CLASSES ========== */
.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bounce {
  animation: bounce 1s ease-in-out infinite;
}

/* ========== PAGE TRANSITIONS ========== */
.page-enter {
  animation: fadeIn 0.3s ease-out;
}

.page-exit {
  animation: fadeIn 0.2s ease-out reverse;
}

/* ========== CARD ANIMATIONS ========== */
.card {
  animation: slideUp 0.3s ease-out;
}

.card-enter {
  animation: slideDown 0.3s ease-out;
}

/* ========== EVENT CARD ANIMATION ========== */
.event-card-enter {
  animation: slideDown 0.3s ease-out;
}

.event-card-fade {
  animation: fadeIn 0.2s ease-out;
}

/* ========== LOADING SKELETON ========== */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  margin-bottom: 12px;
  width: 60%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* ========== BUTTON ANIMATIONS ========== */
.btn {
  transition: all var(--transition-fast);
}

.btn:not(:disabled):active {
  transform: scale(0.98);
}

/* ========== MODAL / OVERLAY ANIMATIONS ========== */
.modal-overlay {
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  animation: slideUp 0.3s ease-out;
}

/* ========== TOAST ANIMATIONS ========== */
.toast {
  animation: slideIn 0.3s ease-out;
}

.toast-exit {
  animation: slideOut 0.3s ease-in;
}

/* ========== DROPDOWN ANIMATIONS ========== */
.dropdown {
  animation: slideDown 0.2s ease-out;
}

/* ========== LIST ITEM ANIMATIONS ========== */
.list-item {
  animation: slideUp 0.3s ease-out;
}

.list-item-enter {
  animation: slideDown 0.2s ease-out;
}

/* ========== BADGE ANIMATIONS ========== */
.badge-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========== SMOOTH TRANSITIONS ========== */
* {
  --transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
}

/* ========== SCROLL BEHAVIOR ========== */
html {
  scroll-behavior: smooth;
}

/* ========== INPUT FOCUS ========== */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transition: all var(--transition-fast);
}

/* ========== DISABLED STATE ANIMATIONS ========== */
*:disabled {
  pointer-events: none;
  opacity: 0.6;
}

/* ========== SMOOTH COLOR TRANSITION ========== */
body {
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* ========== TEXT LINK ANIMATION ========== */
a {
  position: relative;
  transition: color var(--transition-fast);
}

/* ========== HOVER LIFT EFFECT ========== */
.lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ========== BLINK ANIMATION (for alerts) ========== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.blink {
  animation: blink 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ========== GRADIENT ANIMATION ========== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}
