/* ==========================================================================
   YBPolice - Duolingo-Grade Gamified Design System
   Tailored for 12th-Pass Maharashtra Police Bharti Aspirants (2026 Edition)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800;900&family=Noto+Sans+Devanagari:wght@400;600;700;800;900&display=swap');

:root {
  --duo-green: #639922;
  --duo-green-border: #173404;
  --duo-green-light: #EAF3DE;
  --duo-green-dark: #235300;
  
  --duo-sky: #378ADD;
  --duo-sky-border: #042C53;
  --duo-sky-light: #E4F0FA;
  
  --duo-gold: #FAC775;
  --duo-gold-border: #412402;
  --duo-gold-light: #FDF3E1;
  
  --duo-red: #E24B4A;
  --duo-red-border: #501313;
  --duo-red-light: #FBE3E3;
  --duo-red-dark: #820000;
  
  --duo-purple: #D4537E;
  --duo-purple-border: #4B1528;
  
  --duo-navy: #2C2C2A;
  --duo-card-bg: #FFFFFF;
  --duo-border: #2C2C2A;
  --duo-text-muted: #5F5E5A;
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans Devanagari', sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ==========================================================================
   1. 3D CHUNKY TACTILE BUTTONS (Duolingo Style)
   ========================================================================== */
.btn-duo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 1rem;
  border-width: 0 0 4px 0;
  transition: all 0.1s ease;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.btn-duo:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 1px;
  margin-bottom: 3px;
}

.btn-duo-green {
  background-color: var(--duo-green);
  border-color: var(--duo-green-border);
  color: #ffffff;
}
.btn-duo-green:hover:not(:disabled) {
  background-color: #61e002;
}

.btn-duo-sky {
  background-color: var(--duo-sky);
  border-color: var(--duo-sky-border);
  color: #ffffff;
}
.btn-duo-sky:hover:not(:disabled) {
  background-color: #33bbf8;
}

.btn-duo-gold {
  background-color: var(--duo-gold);
  border-color: var(--duo-gold-border);
  color: #0f172a;
}
.btn-duo-gold:hover:not(:disabled) {
  background-color: #ffd226;
}

.btn-duo-red {
  background-color: var(--duo-red);
  border-color: var(--duo-red-border);
  color: #ffffff;
}
.btn-duo-red:hover:not(:disabled) {
  background-color: #ff5f5f;
}

.btn-duo-ghost {
  background-color: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.btn-duo-ghost:hover:not(:disabled) {
  background-color: #334155;
}

.btn-duo:disabled {
  background-color: #334155;
  border-color: #1e293b;
  color: #64748b;
  cursor: not-allowed;
  transform: none !important;
  border-bottom-width: 4px !important;
  margin-bottom: 0 !important;
}

/* ==========================================================================
   2. DUOLINGO 2-STEP OPTION CARDS (A, B, C, D)
   ========================================================================== */
.duo-opt-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  background-color: #0f172a;
  border: 2px solid #334155;
  border-bottom: 5px solid #1e293b;
  border-radius: 1.25rem;
  color: #f8fafc;
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  width: 100%;
}

.duo-opt-card:hover:not(.evaluated) {
  border-color: #475569;
  background-color: #1e293b;
}

.duo-opt-card:active:not(.evaluated) {
  transform: translateY(2px);
  border-bottom-width: 3px;
  margin-bottom: 2px;
}

/* Selected State (Sky Blue Active) */
.duo-opt-card.selected {
  background-color: rgba(28, 176, 246, 0.15) !important;
  border-color: var(--duo-sky) !important;
  border-bottom-color: var(--duo-sky-border) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(28, 176, 246, 0.25);
}

.duo-opt-card.selected .duo-opt-badge {
  background-color: var(--duo-sky) !important;
  color: #ffffff !important;
  border-color: var(--duo-sky-border) !important;
}

/* Evaluated Correct State (Green) */
.duo-opt-card.correct {
  background-color: rgba(88, 204, 2, 0.2) !important;
  border-color: var(--duo-green) !important;
  border-bottom-color: var(--duo-green-border) !important;
  color: #ffffff !important;
}

.duo-opt-card.correct .duo-opt-badge {
  background-color: var(--duo-green) !important;
  color: #ffffff !important;
  border-color: var(--duo-green-border) !important;
}

/* Evaluated Wrong State (Red) */
.duo-opt-card.wrong {
  background-color: rgba(255, 75, 75, 0.2) !important;
  border-color: var(--duo-red) !important;
  border-bottom-color: var(--duo-red-border) !important;
  color: #ffffff !important;
  animation: duo-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

.duo-opt-card.wrong .duo-opt-badge {
  background-color: var(--duo-red) !important;
  color: #ffffff !important;
  border-color: var(--duo-red-border) !important;
}

/* Number / Letter Key Pill Badge */
.duo-opt-badge {
  width: 2rem;
  height: 2rem;
  border-radius: 0.625rem;
  background-color: #1e293b;
  border: 1px solid #334155;
  color: var(--duo-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 900;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

/* ==========================================================================
   3. DUOLINGO S-CURVE LEARNING PATHWAY (The Iconic Map)
   ========================================================================== */
.duo-pathway-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0 4rem 0;
  width: 100%;
}

/* S-Curve Zigzag Positioning */
.duo-step-row {
  display: flex;
  justify-content: center;
  width: 100%;
  position: relative;
}

.duo-node-center { transform: translateX(0); }
.duo-node-right-1 { transform: translateX(3.5rem); }
.duo-node-right-2 { transform: translateX(5.5rem); }
.duo-node-left-1 { transform: translateX(-3.5rem); }
.duo-node-left-2 { transform: translateX(-5.5rem); }

/* Circular Stepping Stone Node */
.duo-node-btn {
  position: relative;
  width: 4.75rem;
  height: 4.5rem;
  border-radius: 50%;
  border-width: 0 0 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.duo-node-btn:active {
  transform: translateY(4px);
  border-bottom-width: 2px;
}

/* Active Node (Gold Glowing) */
.duo-node-active {
  background-color: var(--duo-gold);
  border-color: var(--duo-gold-border);
  color: #0f172a;
  animation: duo-pulse-gold 2s infinite ease-in-out;
}

/* Completed Node (Green Check) */
.duo-node-completed {
  background-color: var(--duo-green);
  border-color: var(--duo-green-border);
  color: #ffffff;
}

/* Locked Node (Greyed out) */
.duo-node-locked {
  background-color: #334155;
  border-color: #1e293b;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}
.duo-node-locked:active {
  transform: none;
  border-bottom-width: 6px;
}

/* Floating Crown / Star on Active Node */
.duo-node-crown {
  position: absolute;
  top: -1.25rem;
  background-color: #0f172a;
  border: 2px solid var(--duo-gold);
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 900;
  color: var(--duo-gold);
  white-space: nowrap;
  animation: duo-bounce-gentle 1.5s infinite ease-in-out;
}

/* Unit Banner Header */
.duo-unit-banner {
  background: linear-gradient(135deg, #58cc02 0%, #235300 100%);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  color: #ffffff;
  width: 100%;
  max-width: 36rem;
  box-shadow: 0 10px 25px -5px rgba(88, 204, 2, 0.3);
  position: relative;
  overflow: hidden;
}

/* ==========================================================================
   4. DUOLINGO FULL-WIDTH BOTTOM RIBBON FEEDBACK
   ========================================================================== */
.duo-bottom-ribbon {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 1.25rem 1.5rem;
  transform: translateY(105%);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.15);
  border-top-width: 2px;
}

.duo-bottom-ribbon.open {
  transform: translateY(0);
}

/* Correct Answer Ribbon (Bright Green) */
.duo-bottom-ribbon.is-correct {
  background-color: #0d2818;
  border-color: #58cc02;
}

/* Wrong Answer Ribbon (Deep Crimson/Red) */
.duo-bottom-ribbon.is-wrong {
  background-color: #2b0b0e;
  border-color: #ff4b4b;
}

/* ==========================================================================
   5. CANDY PROGRESS BAR & FLAME ANIMATIONS
   ========================================================================== */
.candy-progress-bar {
  background: linear-gradient(90deg, #58cc02, #22c55e, #10b981);
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.candy-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: candy-shine 2s infinite linear;
}

@keyframes candy-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.flame-anim {
  animation: duo-flame 1.2s infinite ease-in-out alternate;
  display: inline-block;
}

@keyframes duo-flame {
  0% { transform: scale(1) rotate(-3deg); filter: drop-shadow(0 0 2px #f59e0b); }
  100% { transform: scale(1.15) rotate(3deg); filter: drop-shadow(0 0 8px #ef4444); }
}

@keyframes duo-pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 0, 0.7); }
  50% { box-shadow: 0 0 0 14px rgba(255, 200, 0, 0); }
}

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

@keyframes duo-shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* ==========================================================================
   Google Stitch 3D Tactile Claymorphism & Micro-Interactions
   ========================================================================== */
.clay-card {
  background: #161b29;
  box-shadow: 
    0 10px 28px -6px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 5px 0 rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.clay-node-completed {
  background: #1a1f2d;
  box-shadow: 
    0 8px 20px -3px rgba(0, 0, 0, 0.6),
    0 0 16px rgba(255, 184, 111, 0.25),
    inset 0 2px 2px rgba(255, 255, 255, 0.2),
    inset 0 -3px 4px rgba(0, 0, 0, 0.5);
}

.clay-node-active {
  background: #ff9900;
  box-shadow: 
    0 8px 0 #b36b00,
    0 16px 25px rgba(255, 153, 0, 0.35),
    inset 0 2px 3px rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.clay-node-locked {
  background: #111520;
  box-shadow: 
    inset 0 3px 8px rgba(0, 0, 0, 0.7),
    0 2px 4px rgba(255, 255, 255, 0.03);
}

.clay-btn-hero {
  background: linear-gradient(180deg, #ffaa22 0%, #ff9900 100%);
  box-shadow: 
    0 5px 0 #b36b00,
    0 12px 20px rgba(255, 153, 0, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.4);
  transition: all 0.1s ease-in-out;
}

.clay-btn-hero:active {
  transform: translateY(3px);
  box-shadow: 
    0 2px 0 #b36b00,
    0 6px 12px rgba(255, 153, 0, 0.2),
    inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

.clay-option {
  background: #161b29;
  box-shadow: 
    0 5px 0 #0e1320,
    0 8px 16px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.08);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.clay-option:active {
  transform: translateY(2px);
  box-shadow: 
    0 2px 0 #0e1320,
    0 4px 8px rgba(0,0,0,0.5),
    inset 0 1px 1px rgba(255,255,255,0.08);
}

.clay-option-selected {
  background: #1e2638;
  border: 2px solid #ff9900;
  box-shadow: 
    0 4px 0 #8a5100,
    0 0 18px rgba(255, 153, 0, 0.25),
    inset 0 2px 4px rgba(0,0,0,0.4);
}

.police-beacon-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255, 153, 0, 0.15) 0%, rgba(8, 13, 26, 0) 70%);
}
