/* ═══════════════════════════════════════════
   EXPLORADOR — Componentes
   Botões, cards, forms, chips, progress bars
   ═══════════════════════════════════════════ */

/* ── Botões ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--color-gold);
  color: #1a1200;
}

.btn-primary:hover {
  background: #e8b800;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,197,66,.3);
}

.btn-secondary {
  background: var(--color-teal);
  color: #0a1a18;
}

.btn-secondary:hover {
  background: #25b8a5;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--color-border);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.05);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--color-coral);
  color: white;
}

.btn-danger:hover {
  background: #e8637a;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 14px 28px;
  font-size: var(--font-size-base);
}

.btn-full {
  width: 100%;
}

/* ── Chips / Tags ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: .03em;
}

.chip-purple {
  background: rgba(167,139,250,.15);
  color: var(--color-purple);
  border: 1px solid rgba(167,139,250,.3);
}

.chip-teal {
  background: rgba(45,212,191,.15);
  color: var(--color-teal);
  border: 1px solid rgba(45,212,191,.3);
}

.chip-gold {
  background: rgba(245,197,66,.15);
  color: var(--color-gold);
  border: 1px solid rgba(245,197,66,.3);
}

.chip-coral {
  background: rgba(251,113,133,.15);
  color: var(--color-coral);
  border: 1px solid rgba(251,113,133,.3);
}

.chip-blue {
  background: rgba(96,165,250,.15);
  color: var(--color-blue);
  border: 1px solid rgba(96,165,250,.3);
}

.chip-gray {
  background: rgba(255,255,255,.07);
  color: var(--text-secondary);
  border: 1px solid var(--color-border);
}

/* ── Cards ── */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.card-sm {
  padding: var(--space-md);
  border-radius: var(--radius-sm);
}

.card-title {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: var(--space-md);
}

/* ── Mission Card ── */
.mission-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.mission-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.mission-card.math::before   { background: var(--color-blue); }
.mission-card.port::before   { background: var(--color-teal); }
.mission-card.sci::before    { background: var(--color-purple); }
.mission-card.hist::before   { background: var(--color-coral); }
.mission-card.geo::before    { background: var(--color-gold); }
.mission-card.bonus::before  { background: var(--color-gold); }
.mission-card.main::before   { background: var(--color-gold); }

.mission-card:hover {
  border-color: rgba(255,255,255,.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mission-card.locked {
  opacity: .5;
  cursor: not-allowed;
}

.mission-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.mission-card.done {
  border-color: rgba(52,211,153,.3);
}

.mission-card .card-subject {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.mission-card .card-title-text {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: var(--space-sm);
}

.mission-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mission-card .card-bncc {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.mission-card .card-status {
  font-size: 11px;
  font-weight: 700;
}

/* ── Progress Bar ── */
.progress-item {
  margin-bottom: 10px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.progress-subject { color: var(--text-secondary); }
.progress-value   { color: var(--text-primary); font-weight: 700; }

.progress-track {
  height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 6px;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.progress-note {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

/* ── Avatar ── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.avatar-gradient-purple {
  background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
}

.avatar-gradient-teal {
  background: linear-gradient(135deg, var(--color-teal), #0d9488);
}

.avatar-gradient-gold {
  background: linear-gradient(135deg, var(--color-gold), #e8a000);
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

/* ── Chat Bubbles (tutor) ── */
.chat-bubble {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.chat-bubble.tutor { align-items: flex-start; }
.chat-bubble.child { align-items: flex-end; justify-content: flex-end; }

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.tutor-avatar {
  background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
}

.child-avatar {
  background: linear-gradient(135deg, var(--color-teal), #0d9488);
  font-weight: 800;
  font-size: 13px;
  color: white;
}

.chat-text {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 520px;
}

.tutor .chat-text {
  background: rgba(167,139,250,.1);
  border: 1px solid rgba(167,139,250,.2);
  border-radius: 0 12px 12px 12px;
}

.child .chat-text {
  background: rgba(45,212,191,.1);
  border: 1px solid rgba(45,212,191,.2);
  border-radius: 12px 0 12px 12px;
  max-width: 400px;
}

/* ── Voice Bar ── */
.voice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.voice-bar:hover {
  background: rgba(255,255,255,.07);
}

.voice-bar.recording {
  border-color: var(--color-coral);
  background: rgba(251,113,133,.08);
}

.voice-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-coral);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.voice-icon:hover { transform: scale(1.1); }

.voice-waves {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.wave-bar {
  width: 3px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { height: 8px;  animation-delay: 0s; }
.wave-bar:nth-child(2) { height: 16px; animation-delay: .1s; }
.wave-bar:nth-child(3) { height: 12px; animation-delay: .2s; }
.wave-bar:nth-child(4) { height: 20px; animation-delay: .15s; }
.wave-bar:nth-child(5) { height: 10px; animation-delay: .3s; }
.wave-bar:nth-child(6) { height: 14px; animation-delay: .05s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50%       { transform: scaleY(.4); }
}

.voice-bar.recording .wave-bar { background: var(--color-coral); }

.voice-hint { font-size: 12px; color: var(--text-muted); }

/* ── Formulários ── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 2px rgba(45,212,191,.15);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238892aa' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-coral);
  margin-top: 4px;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Milestones / Conquistas ── */
.milestone-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.milestone-item:last-child { border-bottom: none; }

.milestone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.milestone-text  { font-size: 12px; color: var(--text-primary); line-height: 1.4; }
.milestone-when  { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Week Chart ── */
.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  margin-top: var(--space-sm);
}

.week-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.week-bar-fill {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.week-day {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Status Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  background: var(--color-coral);
  color: white;
}

/* ── Loading Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-md) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ── Animações globais ── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

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