/* === QF BTEC IT - Animations CSS === */

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

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

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

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

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

@keyframes spinOnce {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes goldGlow {
  0%, 100% { text-shadow: 0 0 10px rgba(212,175,55,0.3); }
  50% { text-shadow: 0 0 25px rgba(212,175,55,0.7), 0 0 40px rgba(212,175,55,0.3); }
}

/* === Entry Animations === */
.animate-fade-in {
  animation: fadeInUp 0.7s ease both;
}

.animate-fade-in-delay {
  animation: fadeInUp 0.7s ease 0.2s both;
}

.animate-fade-in-delay2 {
  animation: fadeInUp 0.7s ease 0.4s both;
}

.animate-fade-in-delay3 {
  animation: fadeInUp 0.7s ease 0.6s both;
}

/* === Scroll Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* === Skeleton Loading === */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    rgba(212,175,55,0.05) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
}

/* === Winner Draw Animation === */
.winner-spin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.3s ease;
}

.winner-spin-name {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--gold);
  animation: goldGlow 0.5s ease infinite;
  text-align: center;
  padding: 0 1rem;
}

.winner-result-card {
  background: var(--card-bg);
  border: 2px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.5s ease;
  box-shadow: 0 0 60px rgba(212,175,55,0.2);
}

.winner-trophy {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  animation: float 2s ease-in-out infinite;
}

.winner-result-name {
  font-family: 'Aref Ruqaa', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(212,175,55,0.4);
}

.winner-prize-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* === Confetti Particles (CSS) === */
.confetti {
  position: fixed;
  top: -10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 3001;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* === Notification Toast === */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-h) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  min-width: 280px;
  max-width: 400px;
}

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

.toast.toast-success { border-color: rgba(16,185,129,0.4); }
.toast.toast-success i { color: #10b981; }
.toast.toast-error { border-color: rgba(239,68,68,0.4); }
.toast.toast-error i { color: #ef4444; }
.toast.toast-info { border-color: rgba(212,175,55,0.4); }
.toast.toast-info i { color: var(--gold); }

/* === Loading Overlay === */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: 80px;
  height: 80px;
  animation: float 2s ease-in-out infinite;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader-text {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--teal));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 3px;
  text-shadow: 0 0 30px rgba(212,175,55,0.4);
  position: relative;
}

.loader-text::before {
  content: '⚡';
  position: absolute;
  top: -5px;
  right: -20px;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* === Particles === */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.2; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* === Glow Effects === */
.glow-gold {
  box-shadow: 0 0 15px rgba(212,175,55,0.3), 0 0 30px rgba(212,175,55,0.1);
}

.glow-teal {
  box-shadow: 0 0 15px rgba(0,206,209,0.3), 0 0 30px rgba(0,206,209,0.1);
}

.text-glow-gold {
  text-shadow: 0 0 15px rgba(212,175,55,0.5);
}

/* === Interactive hover states === */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(212,175,55,0.3);
}

/* === Gradient texts === */
.gradient-text-gold {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), #ffe082);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-teal {
  background: linear-gradient(135deg, #00a0a3, var(--teal), #80deea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === Divider === */
.section-divider {
  height: 1px;
  background: linear-gradient(to left, transparent, var(--gold), transparent);
  opacity: 0.3;
  margin: 0;
}
