/* TypingTales Custom Styles */

/* Character styling */
.char-base {
  color: #6b7280;
  transition: color 0.15s ease;
}

.char-correct {
  color: #10b981;
  font-weight: 600;
}

.char-incorrect {
  color: #ef4444;
  text-decoration: underline;
  font-weight: 600;
}

.char-current {
  color: #8b5cf6;
  font-weight: 700;
  background-color: #ede9fe;
  border-radius: 2px;
  animation: cursor-blink 0.8s ease-in-out infinite alternate;
}

@keyframes cursor-blink {
  from { background-color: #ede9fe; }
  to { background-color: #ddd6fe; }
}

/* Custom scrollbar for typing area */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glass panel effect */
.glass-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

/* 3D button effect */
.btn-3d {
  transform: translateY(0);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

.btn-3d:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.btn-3d:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

/* Confetti animation for completion */
@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: 0;
  z-index: 100;
  animation: confetti-fall 3s ease-in-out forwards;
}

/* Focus overlay */
.focus-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  border-radius: inherit;
}

/* Print styles */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}

.print-only { display: none; }

/* Certificate styles */
.certificate-border {
  border: 8px solid #F59E0B;
  background: linear-gradient(135deg, #fefce8, #ffffff);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.certificate-ribbon {
  position: absolute;
  width: 96px;
  height: 96px;
  background: #F59E0B;
  transform: rotate(45deg);
}

.certificate-ribbon-tl { top: -48px; left: -48px; }
.certificate-ribbon-tr { top: -48px; right: -48px; }
.certificate-ribbon-bl { bottom: -48px; left: -48px; }
.certificate-ribbon-br { bottom: -48px; right: -48px; }

/* Level badges */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
}

.level-beginner { background: #fef3c7; color: #92400e; }
.level-explorer { background: #dbeafe; color: #1e40af; }
.level-adventurer { background: #ede9fe; color: #5b21b6; }
.level-hero { background: #fce7f3; color: #9d174d; }
.level-champion { background: #d1fae5; color: #065f46; }
.level-legend { background: #fef08a; color: #713f12; }

/* XP bar */
.xp-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #A855F7, #EC4899);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* Animations */
@keyframes float-up {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-50px); opacity: 0; }
}

.float-up {
  animation: float-up 1s ease-out forwards;
}

@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.pop-in {
  animation: pop-in 0.3s ease-out forwards;
}
