/* Система подсказок "СамаяЗанятая" */

.samosan-tutorial {
  position: fixed;
  z-index: 10000;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  color: white;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  animation: tutorialSlideIn 0.5s ease-out;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.samosan-tutorial.bottom-right {
  bottom: 30px;
  right: 30px;
}

.samosan-tutorial.center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.samosan-tutorial.near-element {
  /* Позиционируется динамически рядом с целевым элементом */
}

/* Персонаж СамаяЗанятая */
.samosan-character {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  animation: characterBreathe 3s ease-in-out infinite;
  border: 4px solid rgba(255, 255, 255, 0.3);
}

.samosan-character::before {
  content: "🤖";
  font-size: 40px;
  animation: characterBlink 4s ease-in-out infinite;
}

/* Шапка-ушанка для персонажа */
.samosan-character::after {
  content: "🧢";
  position: absolute;
  top: -15px;
  font-size: 30px;
  animation: hatWiggle 2s ease-in-out infinite;
}

/* Настроения персонажа */
.samosan-character.friendly::before {
  content: "😊";
}
.samosan-character.encouraging::before {
  content: "💪";
}
.samosan-character.motivating::before {
  content: "🚀";
}
.samosan-character.playful::before {
  content: "😄";
}
.samosan-character.concerned::before {
  content: "🤔";
}
.samosan-character.celebrating::before {
  content: "🎉";
}

/* Заголовок подсказки */
.samosan-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 15px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Текст сообщения */
.samosan-message {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: center;
  opacity: 0.95;
}

/* Кнопки действий */
.samosan-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.samosan-btn {
  padding: 12px 20px;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  min-width: 120px;
  text-align: center;
}

.samosan-btn.btn-primary {
  background: rgba(255, 255, 255, 0.9);
  color: #667eea;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.samosan-btn.btn-primary:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

.samosan-btn.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.samosan-btn.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

/* Кнопка закрытия */
.samosan-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.samosan-close:hover {
  color: white;
}

/* Анимации появления */
@keyframes tutorialSlideIn {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tutorialSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-50px) scale(0.8);
  }
}

/* Анимации персонажа */
@keyframes characterBreathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes characterBlink {
  0%,
  90%,
  100% {
    opacity: 1;
  }
  95% {
    opacity: 0.3;
  }
}

@keyframes hatWiggle {
  0%,
  100% {
    transform: rotate(-5deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

/* Анимации указателей */
.tutorial-pointer {
  position: absolute;
  z-index: 9999;
  pointer-events: none;
}

.tutorial-arrow {
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 20px solid #667eea;
  animation: arrowBounce 1s ease-in-out infinite;
}

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

/* Подсветка элементов */
.tutorial-highlight {
  position: relative;
  z-index: 9998;
}

.tutorial-highlight::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, #667eea, #764ba2);
  border-radius: 10px;
  z-index: -1;
  animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.02);
  }
}

/* Конфетти для празднования */
.tutorial-confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #667eea;
  animation: confettiFall 3s linear infinite;
}

.confetti-piece:nth-child(2n) {
  background: #764ba2;
}
.confetti-piece:nth-child(3n) {
  background: #4facfe;
}
.confetti-piece:nth-child(4n) {
  background: #00f2fe;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .samosan-tutorial {
    max-width: 90%;
    margin: 0 5%;
    bottom: 20px;
    right: 5%;
    left: 5%;
  }

  .samosan-buttons {
    flex-direction: column;
  }

  .samosan-btn {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
  .samosan-tutorial {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Специальные эффекты */
.tutorial-shake {
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

.tutorial-glow {
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
  }
  to {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.9);
  }
}
