/* ==========================================================================
   NEXUS STUDY — APPLE DESIGN SYSTEM & FLUID MOTION SPECIFICATION
   Baseado nas diretrizes da WWDC (Principles of Great Design & Designing Fluid Interfaces)
   Autor: Gabriel Ferreira (CBRO) | Stack: Pure CSS3, iOS Vibrancy & Spring Curves
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS (APPLE SYSTEM COLORS & MATERIALS)
   -------------------------------------------------------------------------- */
:root {
  /* Paleta Base OLED Apple Dark Mode */
  --apple-black: #000000;
  --apple-bg: #070709;
  --apple-surface: rgba(28, 28, 30, 0.72);
  --apple-surface-elevated: rgba(44, 44, 46, 0.78);
  --apple-surface-card: #1C1C1E;
  --apple-fill-secondary: rgba(120, 120, 128, 0.16);
  --apple-fill-tertiary: rgba(120, 120, 128, 0.24);

  /* Vidro & Bordas Especulares Apple */
  --glass-blur: blur(28px) saturate(190%);
  --glass-border: 1px solid rgba(255, 255, 255, 0.09);
  --glass-border-specular: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --glass-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);

  /* Cores de Sistema Apple (Vibrancy Pura) */
  --apple-blue: #0A84FF;
  --apple-blue-hover: #0071E3;
  --apple-green: #30D158;
  --apple-orange: #FF9F0A;
  --apple-red: #FF453A;
  --apple-purple: #BF5AF2;
  --apple-indigo: #5E5CE6;
  --apple-gold: #FFD60A;

  /* Gradientes de Sistema */
  --gradient-accent: linear-gradient(135deg, #0A84FF 0%, #5E5CE6 100%);
  --gradient-game-win: linear-gradient(135deg, #30D158 0%, #0A84FF 100%);
  --gradient-level-up: linear-gradient(135deg, #FF9F0A 0%, #FF453A 100%);

  /* Tipografia com Escala Óptica */
  --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Escala de Raios Apple Squircle */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --radius-pill: 9999px;

  /* Física de Mola Apple (Critically Damped & Bouncy) */
  --spring-default: cubic-bezier(0.16, 1, 0.3, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --spring-press: cubic-bezier(0, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE (KILL LATENCY & SMOOTH TOUCH)
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--apple-black);
  color: #FFFFFF;
  font-family: var(--font-system);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Response — kill latency: todo botão e card responde instantaneamente no toque */
button, .tab-btn, .ios-tab-item, .quiz-option, .cmd-pill, .notebook-card, .apple-pill-stat {
  touch-action: manipulation;
  cursor: pointer;
}

button:active, .tab-btn:active, .ios-tab-item:active, .quiz-option:active, .cmd-pill:active, .apple-pill-stat:active {
  transform: scale(0.96) !important;
  transition: transform 90ms var(--spring-press) !important;
}

/* Layout Geral */
.app-layout {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 0%, #111422 0%, #000000 65%);
}

/* --------------------------------------------------------------------------
   3. APPLE TOPBAR & DYNAMIC ISLAND HUD
   -------------------------------------------------------------------------- */
.topbar.apple-glass-nav {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--apple-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: var(--glass-border);
  box-shadow: var(--glass-border-specular);
  z-index: 500;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Cápsula de Caderno no Topo (Apple Pill Button) */
.apple-notebook-capsule {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--apple-fill-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  color: #FFFFFF;
  font-family: var(--font-system);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.2s var(--spring-default);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  max-width: 220px;
}
.apple-notebook-capsule:hover {
  background: var(--apple-fill-tertiary);
  border-color: rgba(255, 255, 255, 0.2);
}
.capsule-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.capsule-chevron {
  font-size: 0.75rem;
  opacity: 0.7;
}

.brand-text-desktop {
  display: flex;
  flex-direction: column;
}
.brand-text-desktop h1 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.brand-badge-apple {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--apple-blue);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Segmented Control Central no Desktop */
.apple-segmented-control {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}
.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--font-system);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s var(--spring-default);
}
.tab-btn:hover {
  color: #FFFFFF;
}
.tab-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Badge SRS */
.badge-srs-count {
  background: var(--apple-red);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

/* Dynamic Island HUD (Direita) */
.apple-dynamic-island {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mini Activity Rings SVG */
.apple-mini-rings {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rings-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-val {
  transition: stroke-dashoffset 0.6s var(--spring-default);
}

/* Pílulas de Status Apple (Streak & XP) */
.apple-pill-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--apple-fill-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #FFFFFF;
}
.xp-pill {
  position: relative;
  overflow: hidden;
  border-color: rgba(10, 132, 255, 0.3);
}
.xp-mini-track {
  width: 24px;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  margin-left: 2px;
  overflow: hidden;
}
.xp-mini-fill {
  height: 100%;
  background: var(--apple-blue);
  border-radius: var(--radius-pill);
  transition: width 0.4s var(--spring-default);
}

/* Cápsula do Pomodoro */
.apple-pomodoro-capsule {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-fill-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.8rem;
}
.pomo-timer {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
}
.btn-pomo-action {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 2px;
}
.btn-pomo-action:hover {
  color: #FFFFFF;
}
.pomo-audio-select {
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 0.78rem;
  outline: none;
  cursor: pointer;
}
.pomo-audio-select option {
  background: #1C1C1E;
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   4. CORPO PRINCIPAL (SIDEBAR APPLE & MAIN AREA)
   -------------------------------------------------------------------------- */
.main-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 58px);
  overflow: hidden;
  position: relative;
}

/* Sidebar estilo macOS / iPadOS Sheet */
.sidebar.apple-sheet {
  width: 290px;
  min-width: 290px;
  background: rgba(18, 18, 20, 0.82);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.35s var(--spring-default);
}
.sheet-drag-handle {
  display: none; /* Só visível no mobile bottom sheet */
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  margin: 10px auto 4px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}
.sidebar-header h2 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
}
.apple-btn-round {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--apple-fill-secondary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Busca */
.search-box-container {
  padding: 0 16px 12px;
}
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.4);
}
.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 7px 10px 7px 32px;
  color: #FFFFFF;
  font-family: var(--font-system);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s var(--spring-default);
}
.search-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.25);
}

/* Lista de Cadernos */
.notebooks-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notebook-item, .notebook-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.18s var(--spring-default);
}
.notebook-item:hover, .notebook-card:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}
.notebook-item.active, .notebook-card.active {
  background: var(--apple-blue);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
}
.notebook-item.active .nb-meta, .notebook-card.active .nb-meta, .notebook-meta {
  color: rgba(255, 255, 255, 0.8);
}
.nb-icon, .notebook-icon {
  font-size: 1.15rem;
}
.nb-info, .notebook-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.nb-title, .notebook-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-meta, .notebook-meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}
.active-notebook-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.active-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 600;
}
.active-notebook-info strong {
  font-size: 0.82rem;
  color: var(--apple-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sources-count {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------------
   5. ÁREA DE CONTEÚDO PRINCIPAL (TABS)
   -------------------------------------------------------------------------- */
.content-area {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  position: relative;
}

.tab-content {
  display: none;
  min-height: 100%;
  animation: appleTabEnter 0.28s var(--spring-default);
}
.tab-content.active {
  display: block;
}

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

/* --------------------------------------------------------------------------
   6. ABA 1: CHAT JÚLIA FEYNMAN
   -------------------------------------------------------------------------- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 20px 20px;
}

.chat-header-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.chat-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-julia-apple {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4);
}
.avatar-ring-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid var(--apple-blue);
  opacity: 0.4;
  animation: pulseRing 2s infinite var(--spring-default);
}
@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.1); opacity: 0.1; }
}
.chat-title-group h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.chat-title-group .subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

.apple-pill-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cmd-pill {
  background: var(--apple-fill-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  transition: all 0.18s var(--spring-default);
}
.cmd-pill:hover {
  background: var(--apple-fill-tertiary);
  color: #FFFFFF;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 12px 0 20px;
}
.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: appleMessagePop 0.25s var(--spring-default);
}
@keyframes appleMessagePop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-assistant {
  align-self: flex-start;
}
.msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-accent);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.msg-content {
  background: var(--apple-surface-card);
  border: var(--glass-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}
.msg-user .msg-content {
  background: var(--apple-blue);
  color: #FFFFFF;
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.3);
}

/* Dock de Input estilo Mensagens Apple */
.apple-input-dock {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(30, 30, 32, 0.85);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 6px 10px 6px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), var(--glass-border-specular);
}
.btn-mic {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.btn-mic:hover {
  color: #FFFFFF;
}
.btn-mic svg {
  width: 18px;
  height: 18px;
}
#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #FFFFFF;
  font-family: var(--font-system);
  font-size: 0.95rem;
  line-height: 1.4;
  resize: none;
  max-height: 120px;
  padding: 6px 0;
}
.btn-send-apple {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--apple-blue);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.4);
  margin-bottom: 2px;
}
.btn-send-apple svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   7. ABA 2: SIMULADO GAMIFICADO (APPLE ARCADE / DUOLINGO STYLE)
   -------------------------------------------------------------------------- */
.apple-game-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px;
}
.quiz-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.quiz-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--apple-blue);
  text-transform: uppercase;
}
.quiz-header-bar h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Card Principal da Questão */
.apple-game-card {
  background: var(--apple-surface-card);
  border: var(--glass-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), var(--glass-border-specular);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  transition: transform 0.2s var(--spring-default);
}

/* Shake de Erro Apple Spring */
.apple-shake {
  animation: appleSpringShake 0.4s var(--spring-bounce);
}
@keyframes appleSpringShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* HUD Superior do Simulado */
.quiz-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.quiz-progress-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quiz-prog-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}
.quiz-track-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.quiz-fill-bar {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-pill);
  transition: width 0.4s var(--spring-default);
}
.quiz-combo-badge {
  background: linear-gradient(135deg, #FF9F0A, #FF453A);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(255, 69, 58, 0.4);
  animation: popCombo 0.3s var(--spring-bounce);
}
@keyframes popCombo {
  0% { transform: scale(0.7); }
  100% { transform: scale(1); }
}

.quiz-question-body p {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.5;
  color: #FFFFFF;
  letter-spacing: -0.015em;
}

/* Opções de Resposta como Botões Táteis Físicos */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: all 0.18s var(--spring-default);
}
.quiz-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}
.opt-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.opt-text {
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

/* Estados de Resposta (Acerto & Erro) */
.quiz-option.selected-correct {
  background: rgba(48, 209, 88, 0.18) !important;
  border-color: var(--apple-green) !important;
  box-shadow: 0 0 16px rgba(48, 209, 88, 0.3) !important;
}
.quiz-option.selected-correct .opt-letter {
  background: var(--apple-green);
  color: #000;
}
.quiz-option.selected-wrong {
  background: rgba(255, 69, 58, 0.18) !important;
  border-color: var(--apple-red) !important;
  box-shadow: 0 0 16px rgba(255, 69, 58, 0.3) !important;
}
.quiz-option.selected-wrong .opt-letter {
  background: var(--apple-red);
  color: #fff;
}

/* Card de Feedback */
.apple-feedback-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: var(--glass-border);
}
.feedback-badge {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.feedback-badge.correct { color: var(--apple-green); }
.feedback-badge.wrong { color: var(--apple-red); }
.apple-btn-feynman {
  margin-top: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--apple-purple), var(--apple-blue));
  border: none;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(191, 90, 242, 0.35);
}

.quiz-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: var(--glass-border);
  padding-top: 16px;
}
.quiz-nav-btns {
  display: flex;
  gap: 8px;
}
.apple-btn-primary {
  background: var(--apple-blue);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.35);
}
.apple-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-weight: 600;
  font-size: 0.85rem;
}
.apple-btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   8. ABA 7: PROGRESSO & GAME CENTER (APPLE FITNESS STYLE)
   -------------------------------------------------------------------------- */
.apple-game-center {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card do Perfil do Jogador */
.dash-player-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--apple-surface-card);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.player-avatar-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD60A, #FF9F0A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 6px 18px rgba(255, 159, 10, 0.4);
  flex-shrink: 0;
}
.player-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.player-top-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-level-badge {
  background: var(--apple-blue);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.player-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.player-xp-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-xp-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.player-xp-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: var(--radius-pill);
  transition: width 0.5s var(--spring-default);
}
.player-xp-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
.apple-btn-obsidian {
  background: linear-gradient(135deg, #5E5CE6, #BF5AF2);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(94, 92, 230, 0.35);
  white-space: nowrap;
}

/* Card dos Anéis de Atividade Apple */
.dash-rings-card {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: var(--apple-surface-card);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rings-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rings-sub {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}
.rings-layout-flex {
  display: flex;
  align-items: center;
  gap: 28px;
}
.big-rings-wrapper {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}
.big-rings-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.rings-legend-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ring-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ring-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-red { background: var(--apple-red); box-shadow: 0 0 8px rgba(255, 69, 58, 0.5); }
.dot-green { background: var(--apple-green); box-shadow: 0 0 8px rgba(48, 209, 88, 0.5); }
.dot-blue { background: var(--apple-blue); box-shadow: 0 0 8px rgba(10, 132, 255, 0.5); }
.ring-legend-item strong {
  font-size: 0.85rem;
  display: block;
}
.ring-meta-val {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

/* KPIs Grid */
.dash-kpis-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.apple-card {
  background: var(--apple-surface-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 14px;
}
.kpi-icon {
  font-size: 1.3rem;
  margin-bottom: 6px;
  display: block;
}
.kpi-val {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.kpi-label {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* Heatmap Apple Minimalista */
.heatmap-card {
  padding: 20px 22px;
}
.heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.heatmap-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}
.legend-box {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.legend-box.level-0 { background: rgba(255, 255, 255, 0.05); }
.legend-box.level-1 { background: rgba(48, 209, 88, 0.35); }
.legend-box.level-2 { background: rgba(48, 209, 88, 0.65); }
.legend-box.level-3 { background: var(--apple-green); }

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 5px;
}
.heatmap-day {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.15s var(--spring-default);
}
.heatmap-day:hover {
  transform: scale(1.15);
}
.heatmap-day.level-1 { background: rgba(48, 209, 88, 0.35); }
.heatmap-day.level-2 { background: rgba(48, 209, 88, 0.65); }
.heatmap-day.level-3 { background: var(--apple-green); box-shadow: 0 0 6px rgba(48, 209, 88, 0.4); }

/* --------------------------------------------------------------------------
   9. POPUPS & GAMIFICATION FX (XP FLOATING & LEVEL UP)
   -------------------------------------------------------------------------- */
.xp-floating-pill {
  position: fixed;
  transform: translate(-50%, -100%);
  background: var(--gradient-level-up);
  color: #FFFFFF;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  box-shadow: 0 6px 18px rgba(255, 69, 58, 0.4);
  pointer-events: none;
  z-index: 10000;
  animation: floatUpFade 1.2s var(--spring-default) forwards;
}
@keyframes floatUpFade {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -18px) scale(1.1); }
  80% { opacity: 1; transform: translate(-50%, -35px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50px) scale(0.9); }
}

/* Modal de Level Up */
.apple-levelup-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: appleFadeIn 0.3s var(--spring-default);
}
.apple-levelup-card {
  background: #1C1C1E;
  border: var(--glass-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), var(--glass-border-specular);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  animation: appleCardBounce 0.45s var(--spring-bounce);
}
@keyframes appleCardBounce {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.levelup-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--apple-gold);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.levelup-stars {
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.apple-levelup-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.levelup-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--apple-blue);
  margin-bottom: 10px;
}
.levelup-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 20px;
}
.levelup-btn {
  width: 100%;
}

/* Partículas de Confete */
.apple-confetti-particle {
  position: fixed;
  top: -10px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  z-index: 9998;
  pointer-events: none;
  animation: confettiFall 2.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* --------------------------------------------------------------------------
   10. FLASHCARDS SRS & MAPA MENTAL
   -------------------------------------------------------------------------- */
.apple-srs-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px;
}
.srs-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.srs-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--apple-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.srs-header-bar h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.srs-card-container {
  perspective: 1200px;
  margin-bottom: 24px;
}
.apple-3d-card {
  width: 100%;
  min-height: 280px;
  background: var(--apple-surface-card);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-border-specular);
  border-radius: var(--radius-lg);
  position: relative;
  transition: transform 0.5s var(--spring-default);
  transform-style: preserve-3d;
}
.srs-face {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.srs-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.06em;
}
.srs-question-body, .srs-answer-body {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 20px 0;
}
.btn-flip-apple {
  align-self: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.88rem;
}
.srs-actions-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.apple-btn-action {
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 0.75rem;
  color: #FFFFFF;
}
.btn-srs-again { background: rgba(255, 69, 58, 0.25); color: var(--apple-red); border: 1px solid var(--apple-red); }
.btn-srs-hard { background: rgba(255, 159, 10, 0.25); color: var(--apple-orange); border: 1px solid var(--apple-orange); }
.btn-srs-good { background: rgba(10, 132, 255, 0.25); color: var(--apple-blue); border: 1px solid var(--apple-blue); }
.btn-srs-easy { background: rgba(48, 209, 88, 0.25); color: var(--apple-green); border: 1px solid var(--apple-green); }

.srs-table-container {
  overflow-x: auto;
}
.srs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.srs-table th, .srs-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.srs-table th {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}

/* Mapa Mental */
.mapa-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px 20px;
}
.mapa-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.apple-glass-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--apple-fill-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
}
.btn-mapa-ctrl {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 0.9rem;
  padding: 4px 8px;
}
.mindmap-canvas-container {
  flex: 1;
  background: #09090C;
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.mindmap-svg-canvas {
  width: 100%;
  height: 100%;
}
.apple-glass-pop {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 28, 30, 0.92);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--glass-shadow);
  z-index: 100;
}

/* --------------------------------------------------------------------------
   11. iOS BOTTOM NAVIGATION BAR (FIXED ON MOBILE <= 768px)
   -------------------------------------------------------------------------- */
.ios-bottom-bar {
  display: none; /* Oculto no desktop */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: rgba(18, 18, 20, 0.88);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: var(--glass-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  z-index: 900;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ios-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-system);
  position: relative;
  padding: 6px 12px;
  flex: 1;
  transition: all 0.2s var(--spring-default);
}
.ios-tab-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s var(--spring-bounce);
}
.ios-tab-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.ios-tab-item.active {
  color: var(--apple-blue);
}
.ios-tab-item.active .ios-tab-icon {
  transform: scale(1.12);
}
.ios-tab-item.active .ios-tab-label {
  font-weight: 700;
}
.ios-tab-badge {
  position: absolute;
  top: 4px;
  right: 18px;
  background: var(--apple-red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--glass-blur);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.apple-modal-box {
  background: #1C1C1E;
  border: var(--glass-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), var(--glass-border-specular);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 440px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
}
.apple-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #FFFFFF;
  font-family: var(--font-system);
  font-size: 0.95rem;
  margin-top: 8px;
  outline: none;
}
.apple-input:focus {
  border-color: var(--apple-blue);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   12. RESPONSIVIDADE MOBILE APPLE (SMARTPHONES <= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Topbar enxuta */
  .topbar.apple-glass-nav {
    height: 52px;
    padding: 0 12px;
  }
  .brand-text-desktop, .apple-segmented-control {
    display: none !important;
  }
  .apple-notebook-capsule {
    max-width: 170px;
    padding: 5px 10px;
    font-size: 0.8rem;
  }
  .capsule-title {
    max-width: 110px;
  }

  /* Exibir a Bottom Bar do iOS */
  .ios-bottom-bar {
    display: flex !important;
  }

  /* Área de Conteúdo dá espaço para a Bottom Bar */
  .main-body {
    height: calc(100vh - 52px - 60px);
    height: calc(100dvh - 52px - 60px);
  }

  /* Sidebar vira um Apple Bottom Sheet Deslizante */
  .sidebar.apple-sheet {
    position: fixed !important;
    top: auto !important;
    bottom: -100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    height: 75vh !important;
    border-radius: 28px 28px 0 0 !important;
    border-right: none !important;
    border-top: var(--glass-border) !important;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.8) !important;
    z-index: 1000 !important;
    transition: bottom 0.35s var(--spring-default) !important;
  }
  .sidebar.apple-sheet.mobile-open {
    bottom: 0 !important;
  }
  .sheet-drag-handle {
    display: block !important;
  }

  /* Backdrop */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 950;
    opacity: 0;
    transition: opacity 0.3s var(--spring-default);
  }
  .sidebar-backdrop.active {
    display: block !important;
    opacity: 1 !important;
  }

  /* Ajustes de Padding das Telas no Mobile */
  .chat-container, .apple-game-container, .apple-srs-container, .apple-game-center {
    padding: 14px 12px 24px !important;
  }
  .apple-game-card {
    padding: 18px 16px !important;
  }
  .dash-kpis-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .rings-layout-flex {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 16px !important;
  }
  .ring-legend-item {
    justify-content: center !important;
  }
  .heatmap-grid {
    grid-template-columns: repeat(10, 1fr) !important;
  }
  .dash-player-card {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .apple-btn-obsidian {
    width: 100% !important;
    text-align: center !important;
  }
}


/* ==========================================================================
   SIDEBAR NOTEBOOK ITEM (Garantia de layout e hover Apple)
   ========================================================================== */
.notebook-item, .notebook-card {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 10px 12px !important;
  border-radius: var(--radius-sm) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  color: rgba(255, 255, 255, 0.85) !important;
  cursor: pointer !important;
  transition: all 0.2s var(--spring-default) !important;
  text-decoration: none !important;
}

.notebook-item:hover, .notebook-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
}

.notebook-item.active, .notebook-card.active {
  background: var(--apple-blue) !important;
  color: #FFFFFF !important;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35) !important;
}

.nb-icon, .notebook-icon {
  font-size: 1.15rem !important;
  flex-shrink: 0 !important;
}

.nb-info, .notebook-info {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  flex: 1 !important;
}

.nb-title, .notebook-title {
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #FFFFFF !important;
}

.nb-meta, .notebook-meta {
  font-size: 0.72rem !important;
  color: rgba(255, 255, 255, 0.5) !important;
  margin-top: 2px !important;
}

.notebook-item.active .nb-meta, .notebook-card.active .notebook-meta {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* ==========================================================================
   PODCAST APPLE MUSIC STYLE (Player de Áudio & Animação de Ondas)
   ========================================================================== */
.podcast-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 36px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.podcast-card.apple-music-card {
  width: 100%;
  background: linear-gradient(160deg, rgba(32, 32, 36, 0.88), rgba(18, 18, 20, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.podcast-artwork.apple-artwork {
  width: 140px;
  height: 140px;
  border-radius: 26px;
  background: radial-gradient(circle at 30% 30%, #5E5CE6, #0A84FF 65%, #0040DD);
  box-shadow: 0 16px 36px rgba(10, 132, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 24px;
}

.sound-waves {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 44px;
}

.sound-waves span {
  display: block;
  width: 4px;
  height: 12px;
  background: #FFFFFF;
  border-radius: 4px;
  transition: height 0.2s ease;
}

.sound-waves.playing span:nth-child(1) { animation: appleSoundWave 1.2s infinite ease-in-out alternate; }
.sound-waves.playing span:nth-child(2) { animation: appleSoundWave 1.4s 0.2s infinite ease-in-out alternate; }
.sound-waves.playing span:nth-child(3) { animation: appleSoundWave 1.1s 0.4s infinite ease-in-out alternate; }
.sound-waves.playing span:nth-child(4) { animation: appleSoundWave 1.5s 0.1s infinite ease-in-out alternate; }
.sound-waves.playing span:nth-child(5) { animation: appleSoundWave 1.3s 0.3s infinite ease-in-out alternate; }

@keyframes appleSoundWave {
  0% { height: 8px; opacity: 0.5; }
  50% { height: 38px; opacity: 1; }
  100% { height: 16px; opacity: 0.8; }
}

.podcast-badge-type {
  position: absolute;
  bottom: 8px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 6px;
}

.podcast-meta {
  margin-bottom: 24px;
}

.podcast-meta h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.podcast-meta p {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 500px;
  line-height: 1.45;
  margin: 0 auto;
}

.audio-player-wrapper {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.scrubber-container.apple-scrubber {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

#current-time, #duration-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  min-width: 44px;
}

#seek-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
  cursor: pointer;
  accent-color: var(--apple-blue);
}

#seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.15s ease;
}

#seek-bar::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

.player-controls.apple-player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
}

.speed-selector {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.speed-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.speed-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.main-audio-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.btn-circle-small {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--spring-default);
}

.btn-circle-small:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.08);
}

.btn-circle-play.apple-play-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 255, 255, 0.35);
  transition: all 0.2s var(--spring-default);
}

.btn-circle-play.apple-play-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 34px rgba(255, 255, 255, 0.5);
}

.btn-circle-play.apple-play-btn svg {
  width: 28px;
  height: 28px;
}

.apple-btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--apple-blue);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 16px;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.25);
  transition: all 0.2s ease;
}

.apple-btn-download:hover {
  background: rgba(10, 132, 255, 0.2);
  transform: translateY(-1px);
}

.podcast-footer {
  margin-top: 24px;
}

/* ==========================================================================
   FONTES & DEEP RESEARCH (Alimentar o Caderno Ativo)
   ========================================================================== */
.sources-container.apple-sources-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sources-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.sources-header p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.45;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}

.source-card.apple-card {
  background: rgba(28, 28, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: all 0.25s var(--spring-default);
}

.source-card.apple-card:hover {
  background: rgba(36, 36, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.source-icon {
  font-size: 2rem;
}

.source-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFFFFF;
}

.source-card p {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
}

.url-input-group {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.apple-input-field {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 9px 12px;
  color: #FFFFFF;
  font-size: 0.85rem;
  font-family: var(--font-system);
  outline: none;
  transition: all 0.2s ease;
}

.apple-input-field:focus {
  border-color: var(--apple-blue);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.25);
}

.status-hint {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.35;
}

.artifacts-box.apple-card {
  background: rgba(28, 28, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 22px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.artifacts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.artifact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  transition: all 0.2s ease;
}

.artifact-row:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.art-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(10, 132, 255, 0.15);
  color: var(--apple-blue);
}

/* ==========================================================================
   FLASHCARDS SRS (Spaced Repetition SM-2 & Apple 3D Card)
   ========================================================================== */
.srs-wrapper.apple-srs-container {
  max-width: 840px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.srs-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.srs-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--apple-indigo);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.srs-card-container {
  perspective: 1200px;
  width: 100%;
  min-height: 290px;
  display: flex;
  justify-content: center;
}

.srs-flashcard.apple-3d-card {
  position: relative;
  width: 100%;
  max-width: 640px;
  min-height: 290px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 24px;
}

.srs-flashcard.flipped {
  transform: rotateY(180deg);
}

.srs-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 24px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, rgba(32, 32, 36, 0.95), rgba(20, 20, 24, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}

.srs-back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, rgba(24, 30, 44, 0.98), rgba(16, 20, 30, 0.98));
  border-color: rgba(10, 132, 255, 0.28);
}

.srs-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
}

.srs-tag.answer-tag {
  color: var(--apple-green);
}

.srs-question-body {
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.5;
  color: #FFFFFF;
  margin: 18px 0;
}

.btn-flip-apple {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  align-self: center;
  transition: all 0.2s var(--spring-default);
}

.btn-flip-apple:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.02);
}

.srs-answer-body {
  font-size: 1.08rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.45;
}

.srs-explanation {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.45;
  margin: 10px 0;
}

.srs-actions-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.srs-btn.apple-btn-action {
  padding: 9px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-srs-again { background: rgba(255, 69, 58, 0.15); color: var(--apple-red); }
.btn-srs-hard  { background: rgba(255, 159, 10, 0.15); color: var(--apple-amber); }
.btn-srs-good  { background: rgba(48, 209, 88, 0.15); color: var(--apple-green); }
.btn-srs-easy  { background: rgba(10, 132, 255, 0.15); color: var(--apple-blue); }

.srs-all-cards-section.apple-card-panel {
  background: rgba(28, 28, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 22px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.srs-table-container {
  overflow-x: auto;
  margin-top: 14px;
}

.srs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.srs-table th {
  text-align: left;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.srs-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
}

/* ==========================================================================
   MODAL NOVO CADERNO (Apple Dialog Box)
   ========================================================================== */
.modal-backdrop.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-box.apple-modal-box {
  background: rgba(32, 32, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  width: 90%;
  max-width: 460px;
  padding: 28px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
}

.modal-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.modal-body label {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  display: block;
  margin-bottom: 8px;
}

.apple-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 14px;
  color: #FFFFFF;
  font-size: 0.92rem;
  font-family: var(--font-system);
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.apple-input:focus {
  border-color: var(--apple-blue);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.3);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
