/* === ОБЩИЕ === */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  overflow: hidden;
  color: #333;
  user-select: none;
}

/* === ПРОГРЕСС-БАР === */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.3);
  z-index: 1000;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff);
  width: 0%;
  transition: width 0.4s ease;
  border-radius: 0 3px 3px 0;
}

/* === СЛАЙДЫ === */
.slides-container {
  width: 100vw;
  height: calc(100vh - 70px);
  position: relative;
  overflow: hidden;
}
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  padding: 20px;
}
.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}
.slide.exit-left {
  opacity: 0;
  transform: translateX(-60px);
}
.slide-content {
  max-width: 700px;
  width: 100%;
  text-align: center;
}

/* === ТИТУЛЬНЫЙ СЛАЙД === */
.title-slide h1 {
  font-size: 2.8rem;
  color: white;
  text-shadow: 0 3px 12px rgba(0,0,0,0.25);
  margin-bottom: 10px;
}
.title-slide .subtitle {
  font-size: 1.3rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 30px;
}
.big-emoji {
  font-size: 5rem;
  margin-bottom: 15px;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.decoration-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 20px 0;
}
.deco-item {
  font-size: 2.5rem;
  animation: float 3s ease-in-out infinite;
}
.deco-item:nth-child(2) { animation-delay: 0.5s; }
.deco-item:nth-child(3) { animation-delay: 1s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}
.hint-text {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  margin-top: 15px;
}

/* === СЛАЙД-ЭМОДЗИ И ЗАГОЛОВКИ === */
.slide-emoji {
  font-size: 3.5rem;
  margin-bottom: 10px;
}
h2 {
  font-size: 2rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  margin-bottom: 15px;
}

/* === ИНФО-КАРТОЧКА === */
.info-card {
  background: white;
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  text-align: left;
  font-size: 1.05rem;
  line-height: 1.6;
}
.info-card p { margin-bottom: 6px; }
.info-card p:last-child { margin-bottom: 0; }
.info-card strong { color: #764ba2; }

/* === ДЕМО-ОКНО (общее) === */
.demo-window {
  background: #f0f0f0;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  margin: 15px auto;
  max-width: 320px;
  transition: transform 0.3s, opacity 0.3s;
}
.window-titlebar {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  cursor: grab;
  user-select: none;
}
.window-titlebar:active { cursor: grabbing; }
.window-title {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window-buttons {
  display: flex;
  gap: 4px;
}
.win-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.win-btn.minimize { background: #ffd93d; color: #333; }
.win-btn.minimize:hover { background: #ffcc00; transform: scale(1.1); }
.win-btn.maximize { background: #6bcb77; color: white; }
.win-btn.maximize:hover { background: #5ab86a; transform: scale(1.1); }
.win-btn.close { background: #ff6b6b; color: white; }
.win-btn.close:hover { background: #ee5a5a; transform: scale(1.1); }
.window-body {
  padding: 20px;
  font-size: 1rem;
  background: white;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === МАЛЕНЬКОЕ ДЕМО-ОКНО (для анимаций) === */
.animation-area {
  position: relative;
  height: 220px;
  margin: 10px auto;
  max-width: 350px;
}

/* === КНОПКА ДЕМО === */
.action-hint { margin-top: 10px; }
.demo-btn {
  background: white;
  color: #764ba2;
  border: none;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}
.demo-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.demo-btn:active { transform: scale(0.97); }

/* === ПАНЕЛЬ ЗАДАЧ МОК === */
.taskbar-mock {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  border-radius: 8px 8px 0 0;
  padding: 4px 12px;
  display: flex;
  gap: 8px;
}
.taskbar-item {
  width: 36px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.taskbar-item:hover { background: rgba(255,255,255,0.3); }
.taskbar-item.active { background: rgba(255,255,255,0.25); border-bottom: 2px solid #4d96ff; }

/* === АНИМАЦИЯ СВОРАЧИВАНИЯ === */
@keyframes minimizeAnim {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(0.3) translateY(40px); opacity: 0.6; }
  100% { transform: scale(0) translateY(120px); opacity: 0; }
}
@keyframes restoreAnim {
  0% { transform: scale(0) translateY(120px); opacity: 0; }
  40% { transform: scale(0.3) translateY(40px); opacity: 0.6; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes closeAnim {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}

.animate-minimize { animation: minimizeAnim 0.7s forwards ease-in-out; }
.animate-restore { animation: restoreAnim 0.7s forwards ease-in-out; }
.animate-close { animation: closeAnim 0.5s forwards ease-in-out; }
.hidden-window { opacity: 0; transform: scale(0) translateY(120px); pointer-events: none; }

/* === АННОТАЦИИ === */
.annotated { position: relative; }
.annotation {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.annotation-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff6b6b;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(255,107,107,0); }
}
.annotation-line {
  width: 30px;
  height: 2px;
  background: #ff6b6b;
}
.annotation-text {
  background: #ff6b6b;
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.ann-title { top: 50%; right: -140px; transform: translateY(-50%); }
.ann-min { top: 50%; left: -90px; transform: translateY(-50%); flex-direction: row-reverse; }
.ann-max { top: 50%; left: -100px; transform: translateY(-50%) translateX(-30px); flex-direction: row-reverse; }
.ann-close { top: 50%; left: -90px; transform: translateY(-50%) translateX(-58px); flex-direction: row-reverse; }

/* === ПЕРЕМЕЩАЕМОЕ ОКНО (внутри слайда) === */
.movable { position: relative; }

/* === ИЗМЕНЕНИЕ РАЗМЕРА === */
.resizable { position: relative; }
.resize-handle {
  position: absolute;
  background: transparent;
}
.rh-right {
  right: 0; top: 0; width: 8px; height: 100%;
  cursor: ew-resize;
}
.rh-bottom {
  bottom: 0; left: 0; width: 100%; height: 8px;
  cursor: ns-resize;
}
.rh-corner {
  right: 0; bottom: 0; width: 18px; height: 18px;
  cursor: nwse-resize;
}
.rh-corner::after {
  content: '';
  position: absolute;
  right: 3px; bottom: 3px;
  width: 10px; height: 10px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  border-radius: 0 0 2px 0;
}

/* === ПРЕДУПРЕЖДЕНИЕ === */
.warning-box {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  padding: 12px 18px;
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  text-align: left;
}
.warning-icon { font-size: 1.5rem; flex-shrink: 0; }

/* === ПОДСВЕТКА === */
.highlight-box {
  background: rgba(255,255,255,0.2);
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 12px;
  padding: 10px 16px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  color: white;
  font-size: 0.95rem;
}
.highlight-icon { font-size: 1.3rem; }

/* === КВИЗ === */
.quiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 650px;
  margin: 0 auto;
}
.quiz-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}
.quiz-card:hover { transform: translateY(-3px); }
.quiz-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}
.quiz-card p {
  font-size: 0.9rem;
  margin-bottom: 10px;
  font-weight: 600;
}
.quiz-options { display: flex; flex-direction: column; gap: 6px; }
.quiz-btn {
  background: #f0f0f0;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}
.quiz-btn:hover { border-color: #764ba2; background: #f5f0ff; }
.quiz-btn.correct { background: #d4edda; border-color: #28a745; color: #155724; }
.quiz-btn.wrong { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.quiz-btn:disabled { cursor: default; opacity: 0.8; }
.quiz-result {
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 22px;
}

/* === ИТОГОВЫЕ КАРТОЧКИ === */
.summary-cards {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.summary-card {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  animation: popIn 0.4s ease backwards;
}
.summary-card:nth-child(1) { animation-delay: 0.1s; }
.summary-card:nth-child(2) { animation-delay: 0.2s; }
.summary-card:nth-child(3) { animation-delay: 0.3s; }
.summary-card:nth-child(4) { animation-delay: 0.4s; }
.summary-card:nth-child(5) { animation-delay: 0.5s; }
.summary-icon { font-size: 1.8rem; }
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  80% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* === НАВИГАЦИЯ === */
.nav-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 500;
}
.nav-btn {
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  padding: 10px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}
.nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.35); transform: scale(1.05); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.slide-counter {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
}

/* === АДАПТИВ === */
@media (max-width: 600px) {
  .title-slide h1 { font-size: 1.8rem; }
  .big-emoji { font-size: 3.5rem; }
  h2 { font-size: 1.5rem; }
  .quiz-grid { grid-template-columns: 1fr; }
  .annotation { display: none; }
  .summary-cards { gap: 6px; }
  .summary-card { padding: 8px 10px; font-size: 0.75rem; }
  .summary-icon { font-size: 1.3rem; }
}