/* Accessibility & UX overrides — loaded after app CSS */

/* Skip link */
.kj-skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 10000;
  padding: 10px 16px;
  background: #7030a0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.kj-skip-link:focus {
  top: 8px;
  outline: 3px solid #df35ad;
  outline-offset: 2px;
}

/* Visible keyboard focus */
:focus-visible {
  outline: 3px solid #7030a0 !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #7030a0 !important;
  outline-offset: 2px !important;
}

/* Nav back icon — improve contrast */
.van-nav-bar .van-icon-arrow-left {
  color: #555 !important;
  padding: 12px !important;
  margin-left: -8px;
  min-width: 44px;
  min-height: 44px;
  box-sizing: border-box;
}

/* Floating luck-draw — avoid bottom nav + CTA overlap */
img.luckDraw {
  cursor: pointer;
  right: 12px !important;
  bottom: calc(14.667vw + 20px + env(safe-area-inset-bottom, 0px)) !important;
  max-width: 64px;
  max-height: 64px;
  z-index: 90;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

img.luckDraw:focus-visible {
  outline: 3px solid #7030a0 !important;
  outline-offset: 3px;
  border-radius: 50%;
}

img.btn-go {
  cursor: pointer;
}

img.btn-go:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px;
  border-radius: 50%;
}

/* Banner dots — larger tap targets */
.banner-wrap .dots span,
.dots span {
  min-width: 10px;
  min-height: 10px;
  padding: 6px;
  margin: 0 2px;
  cursor: pointer;
}

/* Safe area padding for fixed UI */
.van-nav-bar,
.app-header,
.home-container .nav-bar {
  padding-top: env(safe-area-inset-top, 0px);
}

.van-tabbar {
  padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

/* Screen-reader only */
.kj-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#kj-live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Empty state */
.kj-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  min-height: 40vh;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

.kj-empty p {
  max-width: 280px;
  margin: 0 0 20px;
}

.kj-empty-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(90deg, #df35ad, #4f1db5);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}

/* Load more button */
.kj-load-more {
  display: block;
  width: calc(100% - 32px);
  max-width: 400px;
  margin: 12px auto 24px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #7030a0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.kj-load-more:focus-visible {
  outline: 3px solid #df35ad !important;
}

/* Age gate */
.kj-age-gate {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.kj-age-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.kj-age-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  color: #333;
}

.kj-age-card p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.kj-age-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kj-age-enter,
.kj-age-leave {
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.kj-age-enter {
  background: linear-gradient(90deg, #df35ad, #4f1db5);
  color: #fff;
}

.kj-age-leave {
  background: #f2f2f2;
  color: #555;
}

/* Profile card spacing — light touch */
.profile-item .row-tags,
.basicData .row-tags {
  gap: 4px;
  margin-bottom: 4px;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

#main-content {
  outline: none;
}

#main-content:focus {
  outline: none;
}
