/* ========================================
   UAV MTC - Component Animations & Utilities
   ======================================== */

/* Fade in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* Section divider */
.section-divider {
  width: 48px;
  height: 3px;
  background: var(--c-accent);
  border-radius: 2px;
  margin-bottom: 24px;
}

/* Text utilities */
.text-center { text-align: center; }
.text-accent { color: var(--c-accent); }
.text-muted { color: var(--c-text-secondary); }
.text-sm { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

/* Flex helpers */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Section header centered */
.section-header--center {
  text-align: center;
  margin-bottom: 48px;
}

.section-header--center .section__desc {
  margin: 0 auto;
}

/* Venue card */
.venue-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 32px;
  align-items: center;
}

.venue-card__map {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--c-text-secondary);
}

.venue-card__info h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.venue-card__info p {
  font-size: 14px;
  color: var(--c-text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.venue-card__info svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 3px;
  fill: var(--c-accent);
}

@media (max-width: 768px) {
  .venue-card {
    grid-template-columns: 1fr;
  }
}

/* Contest rules */
.rules-list {
  counter-reset: rule;
  list-style: none;
}

.rules-list li {
  counter-increment: rule;
  padding: 12px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-text-secondary);
  display: flex;
  gap: 12px;
}

.rules-list li::before {
  content: counter(rule);
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c-accent-light);
  color: var(--c-accent);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Prize grid */
.prize-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.prize-card {
  text-align: center;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
}

.prize-card--gold { border-color: #f59e0b; background: rgba(245,158,11,0.05); }
.prize-card--silver { border-color: #9ca3af; background: rgba(156,163,175,0.05); }
.prize-card--bronze { border-color: #b45309; background: rgba(180,83,9,0.05); }

.prize-card__rank {
  font-size: 28px;
  margin-bottom: 8px;
}

.prize-card__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.prize-card__reward {
  font-size: 14px;
  color: var(--c-text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .prize-grid { grid-template-columns: 1fr; }
}

/* Timeline for about page */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--c-border);
}

.timeline__item {
  position: relative;
  padding-bottom: 32px;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-accent);
  border: 2px solid #fff;
}

.timeline__item h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline__item p {
  font-size: 14px;
  color: var(--c-text-secondary);
  line-height: 1.6;
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  border-radius: var(--radius-lg);
  padding: 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,107,43,0.15), transparent 70%);
  pointer-events: none;
}

.cta-banner h2 {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.cta-banner p {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 28px;
}

@media (max-width: 768px) {
  .cta-banner { padding: 40px 24px; }
  .cta-banner h2 { font-size: 24px; }
}

/* Page header for sub pages */
.page-header {
  background: linear-gradient(135deg, #0a0f1f, #1a2a5e);
  padding: calc(var(--nav-h) + 60px) 0 60px;
  text-align: center;
}

.page-header h1 {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.page-header p {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
}

@media (max-width: 768px) {
  .page-header { padding: calc(var(--nav-h) + 40px) 0 40px; }
  .page-header h1 { font-size: 28px; }
}

/* Toast notification */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: var(--z-modal);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateX(0); }
.toast--success { background: var(--c-success); }
.toast--error { background: var(--c-danger); }

/*** Success Modal ***/
.success-modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10,15,31,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.success-modal.show { opacity: 1; pointer-events: auto; }

.success-modal__box {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  transform: scale(0.9) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}
.success-modal.show .success-modal__box { transform: scale(1) translateY(0); }

.success-modal__icon {
  width: 64px; height: 64px;
  background: var(--c-success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}
.success-modal__icon::after {
  content: '';
  display: block;
  width: 18px; height: 10px;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(-45deg) translateY(-3px);
}

.success-modal h3 { font-size: 22px; font-weight: 800; color: var(--c-text); margin-bottom: 8px; }
.success-modal p { font-size: 15px; color: var(--c-text-secondary); line-height: 1.6; margin-bottom: 24px; }

.wechat-code {
  background: var(--c-bg-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--c-text-secondary);
  line-height: 1.5;
}
.wechat-code img {
  width: 160px; height: 160px;
  display: block;
  margin: 0 auto 8px;
  border-radius: 6px;
}

/*** Form validation feedback ***/
.form-input.error { border-color: var(--c-danger) !important; background: #fff5f5; }
.form-input.warn { border-color: #f5a623 !important; }
.form-input.ok { border-color: var(--c-success) !important; }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: 4px; display: none; }
.form-input.error + .form-error { display: block; }

/*** Ticket selected indicator ***/
.ticket-option.selected::before {
  content: '';
  position: absolute;
  top: 8px; right: 8px;
  width: 18px; height: 18px;
  background: var(--c-accent);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 10px;
  background-position: center;
  background-repeat: no-repeat;
}
.ticket-option { position: relative; }

/*** QR Modal for about page ***/
.qr-modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10,15,31,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.qr-modal.show { opacity: 1; pointer-events: auto; }

.qr-modal__box {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  transform: scale(0.9) translateY(16px);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}
.qr-modal.show .qr-modal__box { transform: scale(1) translateY(0); }

.qr-modal__close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  background: var(--c-bg-alt);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--c-text-secondary);
  transition: background 0.2s;
}
.qr-modal__close:hover { background: var(--c-border); }

.qr-modal__img {
  width: 220px; height: 220px;
  border-radius: 8px;
  display: block;
  margin: 0 auto 16px;
  object-fit: cover;
  background: var(--c-bg-alt);
}
.qr-modal__title { font-size: 18px; font-weight: 700; color: var(--c-text); margin-bottom: 6px; }
.qr-modal__desc { font-size: 13px; color: var(--c-text-secondary); line-height: 1.5; }
