/* ============================================================
   COURSES READER STYLES (KID-FRIENDLY & PRINT)
   ============================================================ */

/* 1. Kid-Friendly Screen Styles */
.kid-card {
  background: #fffae6;
  background-image: 
    linear-gradient(90deg, transparent 40px, rgba(239, 68, 68, 0.4) 40px, rgba(239, 68, 68, 0.4) 41px, transparent 41px),
    repeating-linear-gradient(transparent, transparent 30px, rgba(147, 197, 253, 0.5) 30px, rgba(147, 197, 253, 0.5) 31px);
  background-size: 100% 100%, 100% 32px;
  background-position: 0 0, 0 10px;
  border-radius: 12px;
  padding: 30px 24px 24px 60px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  color: #1e3a8a;
}

.kid-title {
  color: #1e3a8a;
  font-size: 1.6rem;
  font-weight: 900;
  border-bottom: 3px solid #1e3a8a;
  padding-bottom: 5px;
  margin-bottom: 20px;
  display: inline-block;
  letter-spacing: 0.5px;
}

.kid-practice-card {
  background: #f0fdf4;
  background-image: 
    linear-gradient(90deg, transparent 40px, rgba(239, 68, 68, 0.4) 40px, rgba(239, 68, 68, 0.4) 41px, transparent 41px),
    repeating-linear-gradient(transparent, transparent 30px, rgba(167, 243, 208, 0.5) 30px, rgba(167, 243, 208, 0.5) 31px);
}
.kid-practice-title {
  color: #065f46;
  font-size: 1.6rem;
  border-bottom: 3px solid #065f46;
  padding-bottom: 5px;
  margin-bottom: 25px;
  display: inline-block;
  font-weight: 900;
}

.kid-bubble {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #334155;
  font-weight: 800;
  font-size: 1.3rem;
  padding: 14px 30px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
  border: 3px solid #3b82f6;
  z-index: 9999;
  animation: floatUpFade 6s forwards, pulseBubble 2s infinite;
  pointer-events: none;
}

@keyframes pulseBubble {
  0% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
  100% { transform: translateX(-50%) scale(1); }
}

@keyframes floatUpFade {
  0% { opacity: 0; bottom: 0px; }
  10% { opacity: 1; bottom: 25px; }
  85% { opacity: 1; bottom: 25px; }
  100% { opacity: 0; bottom: 10px; visibility: hidden; }
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.kid-list-item {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 15px;
  border-radius: 12px;
}
.kid-list-text {
  flex: 1;
}
.kid-list-main-text {
  font-size: 1.3rem;
  line-height: 1.5;
  font-weight: 900;
  color: #1e3a8a;
  margin-bottom: 2px;
}
.course-subtitle {
  font-size: 1rem;
  color: #4b5563;
  display: block;
  font-weight: bold;
}
.course-subtitle.italic {
  font-style: italic;
  font-weight: normal;
  color: #6b7280;
}
.kid-list-example-text {
  font-size: 1.1rem;
  font-style: italic;
  color: #1e40af;
  margin-left: 10px;
  border-left: 3px solid #60a5fa;
  padding-left: 10px;
  margin-top: 5px;
}
.kid-list-emoji {
  font-size: 3rem;
  text-align: center;
  min-width: 60px;
}

.text-highlighted {
  color: #f59e0b !important;
  background-color: rgba(253, 230, 138, 0.4);
  border-radius: 6px;
  padding: 0 4px;
  transition: all 0.2s ease;
}

.kid-answer-box {
  margin-top: 10px;
  padding: 12px;
  background: #fdf2f8;
  border: 2px dashed #f472b6;
  border-radius: 8px;
  color: #be185d;
  font-size: 1.1rem;
  display: none;
  animation: fadeIn 0.3s ease;
}
.kid-answer-box.visible {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.kid-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #1e3a8a;
}
/* ==================================================
   👨‍🏫 TEACHER WHITEBOARD (CURSOS)
   ================================================== */
.teacher-wb-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.95); z-index: 10000;
  display: flex; flex-direction: column;
  backdrop-filter: blur(5px);
}
.teacher-wb-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; background: #0f172a; color: white; border-bottom: 1px solid #334155;
}
.teacher-wb-header h2 { font-size: 1.2rem; margin: 0; display: flex; align-items: center; gap: 8px; }
.teacher-wb-body {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  padding: 15px; gap: 15px;
}
.teacher-wb-video-container {
  flex: 1; position: relative; background: #000; border-radius: 12px;
  overflow: hidden; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.course-video-wrapper {
  width: 100%; max-width: 800px; aspect-ratio: 16 / 9; background: #000;
  border-radius: 16px; box-shadow: 0 15px 30px rgba(0,0,0,0.2);
  overflow: hidden; z-index: 2; position: relative;
  transition: max-width 0.25s ease;
}
.course-video-wrapper.large { max-width: 1160px; }
.teacher-wb-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 10; touch-action: none;
}
.teacher-wb-canvas.hidden { pointer-events: none; opacity: 0; }
.whiteboard-draw-canvas.pass-through { pointer-events: none; }
.teacher-wb-toolbar {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%); z-index: 20;
  background: rgba(255, 255, 255, 0.9); padding: 10px; border-radius: 30px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
}
.color-dot:hover {
  transform: scale(1.1);
}
.color-dot.active {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3b82f6;
}
.teacher-wb-notepad {
  height: 150px; background: white; border-radius: 12px;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
}
.teacher-wb-video-input-area {
  display: flex; gap: 10px; padding: 10px; background: #1e293b; border-radius: 8px;
}
.teacher-wb-video-input-area input {
  flex: 1; padding: 8px 12px; border-radius: 6px; border: 1px solid #475569;
  background: #0f172a; color: white; font-size: 0.95rem; outline: none;
}
.teacher-wb-video-input-area input:focus { border-color: #3b82f6; }
.teacher-wb-video-input-area button {
  padding: 8px 16px; background: #3b82f6; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 5px;
}
.teacher-wb-video-input-area button:hover { background: #2563eb; }

/* ==================================================
   🖨️ PRINT STYLES - "FORMATO DE ESCUELA" (Blanco y Negro)
   ================================================== */
@media print {
  /* Fondo blanco y texto negro para todo */
  body, .course-content-container, .kid-card, .kid-practice-card {
    background: #fff !important;
    color: #000 !important;
  }

  /* Ocultar elementos innecesarios y distractores */
  .top-bar, .kid-bubble, .kid-list-emoji, .kid-exercise-emoji, 
  .level-emoji, .kid-answer-box, button, .material-symbols-rounded,
  .no-print {
    display: none !important;
  }

  /* Contenedores de tarjeta (eliminar sombras y bordes gruesos) */
  .kid-card, .kid-practice-card {
    border: none !important;
    border-bottom: 2px solid #000 !important;
    box-shadow: none !important;
    margin-bottom: 20px !important;
    padding: 10px 0 !important;
    border-radius: 0 !important;
  }

  /* Reducir tamaño de letra para economizar papel */
  .kid-title, .kid-practice-title {
    font-size: 1.2rem !important;
    color: #000 !important;
    text-shadow: none !important;
    background: transparent !important;
    margin-bottom: 10px !important;
    text-align: left !important;
    border-bottom: 1px solid #ccc !important;
  }

  .kid-list-main-text {
    font-size: 1rem !important;
    font-weight: bold !important;
    color: #000 !important;
  }

  .kid-list-example-text, .kid-exercise-text {
    font-size: 0.95rem !important;
    color: #000 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Adaptar el input para que parezca una línea para escribir a lápiz */
  .kid-input {
    border: none !important;
    border-bottom: 1px solid #000 !important;
    background: transparent !important;
    color: transparent !important; /* Si escribió algo, no se imprime */
    border-radius: 0 !important;
    width: 100px !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  /* Adaptar subtítulos */
  .course-subtitle {
    font-size: 0.8rem !important;
    color: #444 !important;
  }

  /* Tablas para imprimir */
  .kid-table {
    border-collapse: collapse !important;
  }
  .kid-table th, .kid-table td {
    border: 1px solid #000 !important;
    color: #000 !important;
    font-size: 0.95rem !important;
    padding: 6px !important;
  }
  .kid-table th {
    background: #f0f0f0 !important;
  }
}
.kid-table th {
  background: #bfdbfe;
  color: #1e3a8a;
  padding: 10px 14px;
  text-align: left;
  font-size: 1.2rem;
  font-weight: bold;
  border-bottom: 2px solid #1e3a8a;
}
.kid-table td {
  padding: 10px 14px;
  font-size: 1.1rem;
  color: #1e3a8a;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.85);
}

.kid-exercise-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.75);
  padding: 12px 16px;
  border-radius: 12px;
}
.kid-exercise-text {
  font-size: 1.3rem;
  font-weight: bold;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.kid-exercise-num {
  color: #6ee7b7;
  font-weight: 900;
  background: rgba(16, 185, 129, 0.2);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1rem;
}
.kid-input {
  background: rgba(255,255,255,0.8);
  border: 2px dashed #059669;
  border-radius: 8px;
  color: #065f46;
  width: 120px;
  font-size: 1.2rem;
  text-align: center;
  outline: none;
  padding: 4px;
  transition: all 0.2s;
  font-weight: 900;
}
.kid-input:focus {
  background: #fff;
  border-style: solid;
}
.kid-exercise-emoji {
  font-size: 2.5rem;
}

/* Print Button FAB (Floating Action Button) */
.fab-print-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #2563eb;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  border: 3px solid #fff;
  cursor: pointer;
  z-index: 1000;
  transition: transform 0.2s;
}
.fab-print-btn:hover {
  transform: scale(1.1);
}
.fab-print-btn .material-symbols-rounded {
  /* Hide all UI elements, navigation, sidebars, buttons, etc. */
  .no-print, .sidebar, .top-bar, .admin-btn, .home-buttons, .top-bar-left, .top-bar-right, .fab-print-btn, button, .fab-btn, .course-print-header {
    display: none !important;
  }
  
  /* Reset background and colors to pure black & white, standard font */
  body, html, #app-container, .course-content-container, .screen {
    background: #fff !important;
    color: #000 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    font-family: "Times New Roman", Times, serif !important;
  }
  
  /* Homework Header Layout - School Worksheet Style */
  .course-content-container::before {
    content: "Nombre: _____________________________________   Fecha: _______________";
    display: block;
    margin-bottom: 20px;
    font-size: 12pt;
    font-family: Arial, Helvetica, sans-serif !important;
    font-weight: bold;
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
  }

  /* Basic container reset */
  .course-content-container {
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Formatting Cards to look like printed paper sections */
  .kid-card, .kid-practice-card {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 25px !important;
    page-break-inside: avoid;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  
  .kid-title, .kid-practice-title {
    color: #000 !important;
    border-bottom: 1px solid #000 !important;
    font-size: 14pt !important;
    font-weight: bold !important;
    padding-bottom: 5px !important;
    margin-bottom: 10px !important;
    background: transparent !important;
    text-shadow: none !important;
    text-align: left !important;
  }

  /* Hide ALL emojis completely */
  .kid-list-emoji, .kid-exercise-emoji, .level-emoji {
    display: none !important;
  }

  /* List Items / Vocab */
  .kid-list-item {
    background: transparent !important;
    border: none !important;
    padding: 2px 0 !important;
    box-shadow: none !important;
    margin-bottom: 5px !important;
  }
  .kid-list-main-text {
    font-size: 11pt !important;
    font-weight: bold !important;
    color: #000 !important;
    display: inline-block !important;
  }
  .kid-list-example-text {
    font-size: 10pt !important;
    color: #333 !important;
    border-left: 1px solid #000 !important;
    padding-left: 10px !important;
    margin-top: 2px !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* Tables */
  .kid-table {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    margin-top: 15px !important;
    width: 100% !important;
    border-collapse: collapse !important;
  }
  .kid-table th {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    font-size: 11pt !important;
    padding: 5px !important;
  }
  .kid-table td {
    background: transparent !important;
    color: #000 !important;
    border: 1px solid #000 !important;
    font-size: 11pt !important;
    padding: 5px !important;
  }

  /* Exercises */
  .kid-exercise-row {
    background: transparent !important;
    border: none !important;
    padding: 3px 0 !important;
    margin-bottom: 10px !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  .kid-exercise-text {
    font-size: 11pt !important;
    color: #000 !important;
  }
  .kid-exercise-num {
    background: transparent !important;
    color: #000 !important;
    border: none !important;
    font-size: 11pt !important;
    padding: 0 !important;
    margin-right: 5px !important;
  }
  .kid-input {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px dashed #000 !important;
    color: transparent !important; /* Hide text if user typed something */
    width: 150px !important;
    border-radius: 0 !important;
    height: 20px !important;
    font-size: 11pt !important;
  }
  
  ::-webkit-scrollbar {
    display: none;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .course-content-container {
    padding: 10px !important;
    width: 100% !important;
  }
  .kid-card, .kid-practice-card {
    padding: 15px;
    margin-bottom: 15px;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .kid-title { font-size: 1.5rem; }
  .kid-practice-title { font-size: 1.5rem; padding: 10px; }
  .kid-list-main-text { font-size: 1.3rem; }
  .kid-list-example-text { font-size: 1.1rem; padding: 10px; }
  .kid-exercise-text { font-size: 1.2rem; }
  .kid-input { width: 90px; font-size: 1rem; }
  .kid-table th, .kid-table td { font-size: 1rem; padding: 8px; }
}

