/* SalesMaster 6.0 — Gamified Corporate Tech CSS */

:root {
  --primary: #3b82f6;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg-dark: #0b1220;
  --panel-bg: rgba(15, 23, 42, 0.65);
  --glass-border: rgba(59, 130, 246, 0.3);
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
}

/* ========== BG PARTICLES & GRID ========== */
body {
  background-color: var(--bg-dark);
  color: var(--text-main);
}

.bg-particles { 
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; 
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.particle {
  position: absolute; border-radius: 50%; 
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: particleFloat linear infinite;
}
@keyframes particleFloat {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  20%  { opacity: 0.6; }
  80%  { opacity: 0.6; }
  100% { transform: translateY(-100px) scale(1.5); opacity: 0; }
}

/* ========== HERO BG ========== */
#welcome-screen {
  background: linear-gradient(180deg, transparent 0%, var(--bg-dark) 100%), radial-gradient(circle at 50% 0%, #1e3a8a 0%, var(--bg-dark) 70%);
  position: relative;
}
#welcome-screen .page-wrap { position: relative; z-index: 1; }

/* ========== SCREEN TRANSITIONS ========== */
.screen { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fadeUp { 
  from { opacity: 0; transform: translateY(30px) scale(0.98); } 
  to { opacity: 1; transform: translateY(0) scale(1); } 
}

/* ========== HERO ICON FLOAT ========== */
.hero-icon { animation: floatY 3s ease-in-out infinite; }
.stage-item-icon { animation: floatY 3s ease-in-out infinite; }
@keyframes floatY { 
  0%, 100% { transform: translateY(0); } 
  50% { transform: translateY(-10px); } 
}

/* ========== TYPOGRAPHY & STATS ========== */
.hero-version { font-size: 1.8rem; display: inline; color: var(--accent); text-shadow: 0 0 10px rgba(245,158,11,0.5); }
.hero-title { font-size: 2.5rem; font-weight: 800; background: linear-gradient(135deg, #60a5fa, #10b981); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-subtitle { font-size: 1.4rem; color: var(--text-muted); }

.stat-card { 
  background: var(--panel-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: 1rem;
  transition: transform 0.3s, box-shadow 0.3s; 
}
.stat-card:hover { 
  transform: translateY(-5px); 
  box-shadow: 0 8px 20px rgba(59,130,246,0.2); 
  border-color: var(--primary);
}
.stat-item { padding: 1.5rem; text-align: center; }
.stat-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.stat-value { font-size: 2rem; font-weight: bold; color: var(--primary); }

/* ========== BUTTONS ========== */
.btn { 
  position: relative; overflow: hidden; 
  background: rgba(30, 41, 59, 0.8); backdrop-filter: blur(5px);
  border: 1px solid var(--glass-border); color: var(--text-main);
  transition: all 0.3s;
}
.btn-primary { 
  background: linear-gradient(135deg, #2563eb, #1d4ed8); 
  border: none;
  box-shadow: 0 4px 10px rgba(59,130,246,0.4);
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transform: translateX(-100%) skewX(-15deg); transition: transform 0.6s;
}
.btn:hover::after { transform: translateX(100%) skewX(-15deg); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(59,130,246,0.4); }
.btn:active { transform: translateY(0) scale(0.97); }

/* ========== STAGE LIST ========== */
.stage-list { display: flex; flex-direction: column; gap: 1rem; }
.stage-item {
  background: var(--panel-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: 1rem;
  padding: 1.25rem; cursor: pointer; 
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s, border-color 0.4s;
  position: relative; overflow: hidden;
  transform-style: preserve-3d;
}
.stage-item:hover { 
  transform: translateY(-6px) scale(1.02) rotateX(2deg); 
  border-color: var(--primary); 
  box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
}
.stage-item.locked { opacity: 0.4; background: #1e293b; cursor: not-allowed; }
.stage-item.locked:hover { transform: none; border-color: var(--glass-border); box-shadow: none; }
.stage-item.completed { border-color: var(--secondary); box-shadow: inset 0 0 10px rgba(16,185,129,0.2); }
.stage-item.completed::after { 
  content: '✓'; position: absolute; top: 1rem; right: 1rem; 
  font-size: 1.6rem; color: var(--secondary); z-index: 2; 
}

.stage-item[data-stage="discovery"] { background: linear-gradient(135deg, rgba(30,58,138,0.8), rgba(15,23,42,0.9)); }
.stage-item[data-stage="scope"]     { background: linear-gradient(135deg, rgba(6,95,70,0.8), rgba(15,23,42,0.9)); }
.stage-item[data-stage="gonogo"]    { background: linear-gradient(135deg, rgba(154,52,18,0.8), rgba(15,23,42,0.9)); }
.stage-item[data-stage="validate"]  { background: linear-gradient(135deg, rgba(91,33,182,0.8), rgba(15,23,42,0.9)); }
.stage-item[data-stage="business"]  { background: linear-gradient(135deg, rgba(7,89,133,0.8), rgba(15,23,42,0.9)); }
.stage-item[data-stage="negotiate"] { background: linear-gradient(135deg, rgba(133,77,14,0.8), rgba(15,23,42,0.9)); }

.stage-item-header, .level-dots { position: relative; z-index: 1; }
.stage-item-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.stage-item-icon { font-size: 2.5rem; }
.stage-item-info h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.2rem; }
.stage-item-info p { color: var(--text-muted); font-size: 0.9rem; }

/* ========== LEVEL DOTS ========== */
.level-dots { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.level-dot { width: 20px; height: 20px; border-radius: 4px; background: rgba(71,85,105,0.5); border: 1px solid rgba(255,255,255,0.1); transition: all 0.3s; transform: skewX(-10deg); }
.level-dot.done { background: var(--secondary); border-color: transparent; }
.level-dot.current { background: var(--primary); animation: pulseDot 1.5s infinite alternate; border-color: transparent; }
@keyframes pulseDot { 
  0% { transform: skewX(-10deg) scale(1); opacity: 1; } 
  100% { transform: skewX(-10deg) scale(1.1); opacity: 0.7; } 
}

/* ========== GAME HUD TOPBAR ========== */
.game-topbar {
  background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(16px);
  padding: 1rem; box-shadow: 0 5px 15px rgba(0,0,0,0.4);
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--glass-border);
  border-radius: 0 0 1.5rem 1.5rem;
  margin-bottom: 1rem;
}
.game-topbar-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.8rem; }
.game-progress-label { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.game-stage-name { font-size: 1rem; font-weight: 800; color: var(--primary); }
.progress-bar { height: 8px; background: rgba(0,0,0,0.5); border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px; transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== VISUAL NOVEL LAYOUT ========== */
.game-content { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1.5rem; }
.level-header { text-align: center; margin-bottom: 0.5rem; }
.level-subtitle { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }

.npc-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: transparent; border: none; padding: 0; margin-bottom: -2rem; z-index: 2; position: relative;
}
.npc-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid var(--primary);
  box-shadow: 0 0 15px rgba(59,130,246,0.5);
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
  position: relative; overflow: hidden;
}
.npc-avatar-img { opacity: 0; position: absolute; }
.npc-avatar::before { content: '👤'; position: absolute; }
.npc-info { background: rgba(15,23,42,0.8); padding: 0.3rem 1rem; border-radius: 2rem; border: 1px solid var(--glass-border); margin-top: 0.5rem; }
.npc-name { font-size: 1rem; font-weight: 800; color: var(--primary); margin-bottom: 0.1rem; }
.npc-title { color: var(--text-muted); font-size: 0.75rem; }

.scenario-card { 
  background: var(--panel-bg); backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border); border-radius: 1.2rem; 
  padding: 2rem 1.5rem 1.5rem; position: relative; z-index: 1;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.scenario-card::before {
  content: ''; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  border-width: 0 12px 12px 12px; border-style: solid;
  border-color: transparent transparent var(--glass-border) transparent;
}
.scenario-card::after {
  content: ''; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  border-width: 0 10px 10px 10px; border-style: solid;
  border-color: transparent transparent rgba(15,23,42,0.9) transparent;
}
.scenario-text { color: var(--text-main); font-size: 1.05rem; line-height: 1.8; }

/* ========== CHOICES ========== */
.game-choices-bar {
  background: rgba(11, 18, 32, 0.9); backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border); padding: 1.5rem 1rem;
  border-radius: 1.5rem 1.5rem 0 0;
}
.choices-title { font-size: 0.8rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 2px; }
.choices-list { display: flex; flex-direction: column; gap: 0.8rem; }
.choice-btn {
  display: flex; align-items: center; gap: 1rem;
  background: rgba(30, 41, 59, 0.5); border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 1rem; padding: 1rem; cursor: pointer; text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); color: var(--text-main);
  font-size: 0.95rem; line-height: 1.5;
}
.choice-btn:hover { 
  background: rgba(59, 130, 246, 0.15); border-color: var(--primary); 
  transform: translateX(8px); box-shadow: 0 4px 10px rgba(59,130,246,0.2);
}
.choice-letter {
  min-width: 32px; height: 32px; border-radius: 8px;
  background: rgba(15,23,42,0.8); border: 1px solid var(--glass-border);
  color: var(--primary); font-weight: 800; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.3s;
}
.choice-btn:hover .choice-letter { background: var(--primary); color: #fff; }
.choice-text { flex: 1; }

.choice-btn.selected { background: rgba(59, 130, 246, 0.25); border-color: #60a5fa; box-shadow: 0 0 10px rgba(59,130,246,0.4); }
.choice-btn.correct  { border-color: var(--secondary) !important; background: rgba(16,185,129,0.2) !important; box-shadow: 0 0 10px rgba(16,185,129,0.4) !important; }
.choice-btn.wrong    { border-color: #ef4444 !important; background: rgba(239,68,68,0.2) !important; box-shadow: 0 0 10px rgba(239,68,68,0.4) !important; }

/* ========== RESULT SCREEN ========== */
.result-wrap { padding-top: 2rem; position: relative; }
.result-hero { text-align: center; margin-bottom: 2rem; position: relative; z-index: 10; }
.result-icon { font-size: 5rem; margin-bottom: 1rem; animation: floatY 3s ease-in-out infinite; }
.result-title { font-size: 2.2rem; font-weight: 800; background: linear-gradient(135deg, #60a5fa, #10b981); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.result-icon:not(.wrong)::after {
  content: ''; position: fixed; top: -50vh; left: 0; width: 100vw; height: 200vh;
  pointer-events: none; z-index: 1;
  background-image: 
    radial-gradient(circle, var(--secondary) 6px, transparent 7px),
    radial-gradient(circle, var(--primary) 5px, transparent 6px),
    radial-gradient(circle, var(--accent) 7px, transparent 8px),
    radial-gradient(circle, #8b5cf6 5px, transparent 6px);
  background-size: 150px 150px, 200px 200px, 120px 120px, 180px 180px;
  background-position: 0 0, 50px 50px, 100px 100px, 30px 120px;
  animation: confettiFall 4s linear infinite;
}
@keyframes confettiFall {
  0% { transform: translateY(-50vh) rotate(0deg); }
  100% { transform: translateY(50vh) rotate(360deg); }
}

.result-title.wrong { background: linear-gradient(135deg, #ef4444, #f97316); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.result-icon.wrong::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: rgba(239, 68, 68, 0.2);
  animation: screenRedFlash 0.6s ease-out forwards;
}
@keyframes screenRedFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.result-cards { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; position: relative; z-index: 10; }
.result-detail-card { 
  display: flex; align-items: flex-start; gap: 1rem; 
  background: var(--panel-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: 1rem; padding: 1.5rem;
}
.result-reward-card { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.4); box-shadow: 0 0 10px rgba(245,158,11,0.15); }
.reward-pts { font-size: 2rem; font-weight: 800; color: var(--accent); }

/* ========== VICTORY SCREEN ========== */
.victory-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, #1e3a8a 0%, var(--bg-dark) 100%);
  position: relative; overflow: hidden;
}
.victory-wrap::before {
  content: ''; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(59,130,246,0.15), transparent 45deg, rgba(16,185,129,0.15) 90deg, transparent 135deg);
  animation: spinRays 15s linear infinite; z-index: 0;
}
@keyframes spinRays { 100% { transform: rotate(360deg); } }
.victory-wrap > * { position: relative; z-index: 1; }
.victory-trophy { font-size: 7rem; margin-bottom: 1rem; animation: floatY 2s ease-in-out infinite; }
.victory-title { font-size: 3.5rem; font-weight: 900; margin-bottom: 0.5rem; background: linear-gradient(135deg, #f59e0b, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.victory-stats { display: flex; gap: 1.5rem; margin-bottom: 3rem; flex-wrap: wrap; justify-content: center; }
.victory-stat {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  background: var(--panel-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border);
  border-radius: 1.5rem; padding: 1.5rem 2rem; min-width: 120px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  transform-style: preserve-3d; transition: transform 0.5s;
}
.victory-stat:hover { transform: translateY(-10px) rotateX(10deg); box-shadow: 0 12px 25px rgba(59,130,246,0.3); border-color: var(--primary); }
.victory-stat-val { font-size: 2.5rem; font-weight: 800; background: linear-gradient(135deg, #60a5fa, #10b981); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* ========== RESPONSIVE ========== */
.hidden { display: none !important; }

@media (max-width: 768px) {
  .stat-card, .btn, .stage-item, .game-topbar, .scenario-card, .game-choices-bar, .result-detail-card, .victory-stat {
    backdrop-filter: none !important;
    background-color: rgba(15, 23, 42, 0.95) !important;
  }
  .hero-title { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1.2rem; }
  .victory-stats { flex-direction: column; gap: 1rem; width: 100%; padding: 0 2rem; }
  .victory-stat { width: 100%; }
  .game-content { padding: 0.5rem; }
  .scenario-card { padding: 1.5rem 1rem; }
}

@media (max-width: 480px) {
  .hero-icon { font-size: 4rem; }
  .hero-title { font-size: 1.8rem; }
  .stat-item { padding: 1rem; }
  .stat-icon { font-size: 1.5rem; }
  .stat-value { font-size: 1.5rem; }
  .choice-btn { padding: 0.8rem; font-size: 0.85rem; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
