/**
 * Wordnus Flashcards Page Styles
 * Minimalist whitish design with slide reveal animation
 */

/* ============================================
   FORCE LIGHT MODE (Ignore OS Settings)
   ============================================ */

:root {
  color-scheme: light only;

  /* Minimalist color palette */
  --fc-bg: #f0efeb;
  --fc-card-bg: #f8f7f4;
  --fc-text: #2d2d2d;
  --fc-text-secondary: #4a4a4a;
  --fc-text-muted: #6b6b6b;
  --fc-border: #2d2d2d;
  --fc-border-light: #e5e5e5;
  --fc-accent: #2d2d2d;
}

/* Override any dark mode preference */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light only;
  }
}

/* Page background */
body {
  background: var(--fc-bg) !important;
  min-height: 100vh;
}

/* ============================================
   TOP NAVIGATION
   ============================================ */

.wn-topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--fc-bg);
  border-bottom: 1px solid var(--fc-border-light);
  padding: var(--wn-space-3) 0;
}

.wn-topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wn-space-3);
}

.wn-topnav__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--fc-text-muted);
  transition: color 0.2s;
}

.wn-topnav__back:hover {
  color: var(--fc-text);
}

.wn-topnav__title {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--wn-text-lg);
  font-weight: 600;
  color: var(--fc-text);
  margin: 0;
}

.wn-topnav__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--fc-text-muted);
  cursor: pointer;
  border-radius: var(--wn-radius-md);
  transition: all 0.2s;
}

.wn-topnav__action:hover {
  background: rgba(45, 45, 45, 0.05);
  color: var(--fc-text);
}

/* ============================================
   LOCKED SCREEN
   ============================================ */

.wn-locked-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fc-bg);
  z-index: 200;
  padding: var(--wn-space-6);
}

.wn-locked-screen__content {
  text-align: center;
  max-width: 400px;
}

.wn-locked-screen__icon {
  color: var(--fc-text-muted);
  margin-bottom: var(--wn-space-6);
}

.wn-locked-screen__content h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  color: var(--fc-text);
  margin-bottom: var(--wn-space-3);
}

.wn-locked-screen__progress {
  font-family: 'Inter', sans-serif;
  font-size: var(--wn-text-lg);
  color: var(--fc-text);
  margin: var(--wn-space-4) 0 var(--wn-space-6);
}

.wn-locked-screen__progress span {
  font-weight: 600;
  color: var(--fc-accent);
}

/* ============================================
   PROGRESS BAR
   ============================================ */

.wn-flashcard-progress {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--fc-border-light);
  z-index: 99;
}

.wn-flashcard-progress__bar {
  height: 100%;
  background: var(--fc-accent);
  transition: width 0.3s ease;
  width: 0%;
}

/* ============================================
   CARD COUNTER
   ============================================ */

.wn-card-counter {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: var(--wn-text-lg);
  color: var(--fc-text-muted);
  margin-bottom: var(--wn-space-4);
  font-variant-numeric: tabular-nums;
}

.wn-card-counter span:first-child {
  font-weight: 600;
  color: var(--fc-text);
}

/* ============================================
   FLASHCARD MAIN
   ============================================ */

.wn-flashcard-main {
  padding-top: 80px;
  padding-bottom: 100px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================
   FLASHCARD WRAPPER & SLIDE REVEAL
   ============================================ */

.wn-flashcard-wrapper {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 16px;
}

.wn-flashcard {
  position: relative;
  width: 100%;
  min-height: 320px;
  height: auto;
  cursor: pointer;
  overflow: hidden;
}

.wn-flashcard__inner {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ============================================
   CARD FACES - STATIC TRIPLE BORDER
   ============================================ */

.wn-flashcard__front,
.wn-flashcard__back {
  width: 100%;
  min-height: 320px;
  background: var(--fc-card-bg);
  border: 3px solid var(--fc-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--wn-space-6);
  text-align: center;
  /* Triple border effect using box-shadow */
  box-shadow:
    0 0 0 6px var(--fc-card-bg),
    0 0 0 9px rgba(45, 45, 45, 0.25),
    0 20px 60px rgba(0, 0, 0, 0.12);
}

/* Front face - slides up and out */
.wn-flashcard__front {
  position: relative;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
}

.wn-flashcard--flipped .wn-flashcard__front {
  transform: translateY(-100%);
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
}

/* Back face - slides in from below */
.wn-flashcard__back {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease 0.1s;
}

.wn-flashcard--flipped .wn-flashcard__back {
  transform: translateY(0);
  opacity: 1;
}

/* ============================================
   CARD CONTENT - MIXED TYPOGRAPHY
   ============================================ */

/* Word - Elegant Serif */
.wn-flashcard__word {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--fc-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--wn-space-3);
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  padding: 0 var(--wn-space-2);
}

/* Pronunciation - Clean Sans */
.wn-flashcard__pronunciation {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.95rem;
  color: var(--fc-text-muted);
  margin-bottom: var(--wn-space-4);
}

/* Hint */
.wn-flashcard__hint {
  font-family: 'Inter', sans-serif;
  font-size: var(--wn-text-sm);
  margin-top: auto;
  color: var(--fc-text-muted);
  opacity: 0.7;
}

/* Part of Speech Badge */
.wn-flashcard__pos {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--fc-accent);
  color: var(--fc-card-bg);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: var(--wn-space-4);
}

/* Definition - Clean Sans */
.wn-flashcard__definition {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(0.95rem, 2.5vw, 1.125rem);
  font-weight: 400;
  color: var(--fc-text-secondary);
  line-height: 1.6;
  max-width: 95%;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-y: auto;
  max-height: 150px;
}

/* Example */
.wn-flashcard__example {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--fc-text-muted);
  margin-top: var(--wn-space-4);
  padding-top: var(--wn-space-3);
  border-top: 1px solid var(--fc-border-light);
  max-width: 95%;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ============================================
   SLIDE ANIMATIONS
   ============================================ */

.wn-flashcard--swipe-left {
  animation: swipeLeft 0.3s ease forwards;
}

.wn-flashcard--swipe-right {
  animation: swipeRight 0.3s ease forwards;
}

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

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

.wn-flashcard--enter {
  animation: enterCard 0.3s ease forwards;
}

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

/* ============================================
   CONFIDENCE INDICATOR
   ============================================ */

.wn-confidence-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wn-space-2);
  margin-top: var(--wn-space-6);
  font-family: 'Inter', sans-serif;
  font-size: var(--wn-text-sm);
  color: var(--fc-text-muted);
}

.wn-confidence-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fc-border-light);
}

.wn-confidence-dot--green {
  background: #22c55e;
}

.wn-confidence-dot--orange {
  background: #f59e0b;
}

.wn-confidence-dot--red {
  background: #ef4444;
}

/* ============================================
   NAVIGATION FOOTER
   ============================================ */

.wn-nav-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 97;
  background: var(--fc-bg);
  border-top: 1px solid var(--fc-border-light);
  padding: var(--wn-space-4) 0;
}

.wn-nav-footer__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--wn-space-6);
}

.wn-nav-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid var(--fc-border-light);
  color: var(--fc-text-muted);
  transition: all 0.2s ease;
}

.wn-nav-btn:hover:not(:disabled) {
  border-color: var(--fc-accent);
  color: var(--fc-text);
}

.wn-nav-btn:disabled {
  opacity: 0.3;
}

.wn-flip-btn {
  display: flex;
  align-items: center;
  gap: var(--wn-space-2);
  padding: var(--wn-space-3) var(--wn-space-6);
  border-radius: 30px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  background: var(--fc-accent);
  color: var(--fc-card-bg);
  border: none;
  transition: all 0.2s ease;
}

.wn-flip-btn:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

/* ============================================
   PROGRESS DOTS
   ============================================ */

.wn-progress-dots {
  position: fixed;
  bottom: 90px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: var(--wn-space-2);
  padding: var(--wn-space-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wn-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fc-border-light);
  flex-shrink: 0;
  transition: all 0.2s;
}

.wn-progress-dot--current {
  width: 24px;
  border-radius: 12px;
  background: var(--fc-accent);
}

.wn-progress-dot--viewed {
  background: var(--fc-text-muted);
}

/* ============================================
   KEYBOARD SHORTCUTS MODAL
   ============================================ */

.wn-shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: var(--wn-space-3);
}

.wn-shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wn-space-4);
}

.wn-shortcut kbd {
  display: inline-block;
  padding: var(--wn-space-1) var(--wn-space-2);
  background: var(--fc-bg);
  border: 1px solid var(--fc-border-light);
  border-radius: var(--wn-radius-sm);
  font-family: monospace;
  font-size: var(--wn-text-sm);
  color: var(--fc-text);
}

.wn-shortcut span {
  color: var(--fc-text-muted);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.wn-loading-overlay {
  background: var(--fc-bg);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .wn-flashcard__front,
  .wn-flashcard__back {
    min-height: 280px;
    padding: var(--wn-space-4);
  }

  .wn-flashcard-wrapper {
    max-width: 100%;
    padding: 0 12px;
  }

  .wn-flashcard__word {
    font-size: 1.5rem;
  }

  .wn-flashcard__definition {
    font-size: 0.95rem;
    max-height: 120px;
  }
}

@media (min-width: 640px) {
  .wn-flashcard__front,
  .wn-flashcard__back {
    min-height: 350px;
  }

  .wn-flashcard__word {
    font-size: 2rem;
  }

  .wn-flashcard__definition {
    font-size: 1.05rem;
  }
}

@media (min-width: 1024px) {
  .wn-flashcard-wrapper {
    max-width: 750px;
  }

  .wn-flashcard__front,
  .wn-flashcard__back {
    min-height: 380px;
  }

  .wn-flashcard__word {
    font-size: 2.5rem;
  }

  .wn-flashcard__definition {
    font-size: 1.125rem;
  }

  .wn-nav-footer__inner {
    gap: var(--wn-space-8);
  }
}

/* ============================================
   SAFE AREA (iOS)
   ============================================ */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .wn-nav-footer {
    padding-bottom: calc(var(--wn-space-4) + env(safe-area-inset-bottom));
  }
}

/* ============================================
   TOUCH FEEDBACK
   ============================================ */

.wn-flashcard:active .wn-flashcard__front,
.wn-flashcard:active .wn-flashcard__back {
  transform: scale(0.98);
}

.wn-flashcard--flipped:active .wn-flashcard__back {
  transform: translateY(0) scale(0.98);
}

/* ============================================
   TOUCH/SWIPE AREAS
   ============================================ */

.wn-flashcard-wrapper {
  touch-action: pan-y;
}
