/* ========== СИСТЕМА ПОДСКАЗОК (TIPS SYSTEM) ========== */

/* Основной контейнер подсказки */
.tip-container {
  position: fixed;
  z-index: 1060;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
  border-radius: 20px;
  box-shadow:
    0 20px 60px rgba(102, 126, 234, 0.25),
    0 0 1px rgba(102, 126, 234, 0.5);
  padding: 0;
  max-width: 520px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  animation: tipSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(102, 126, 234, 0.2);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.tip-container:hover {
  box-shadow:
    0 25px 70px rgba(102, 126, 234, 0.35),
    0 0 2px rgba(102, 126, 234, 0.7);
  transform: translateY(-4px);
}

/* ===== ПОЗИЦИОНИРОВАНИЕ ===== */
.tip-container.bottom-right {
  bottom: 28px;
  right: 28px;
}

.tip-container.bottom-left {
  bottom: 28px;
  left: 28px;
}

.tip-container.top-right {
  top: 28px;
  right: 28px;
}

.tip-container.top-left {
  top: 28px;
  left: 28px;
}

/* ===== КОНТЕЙНЕР АНИМАЦИИ (LOTTIE) ===== */
.tip-lottie-container {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
}

/* Декоративный фон с анимацией */
.tip-lottie-container::before {
  content: "";
  position: absolute;
  width: 300%;
  height: 300%;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    );
  animation: tipBgShift 8s ease-in-out infinite;
  pointer-events: none;
}

/* Декоративные точки */
.tip-lottie-container::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px
  );
  background-size: 40px 40px;
  animation: tipBgMove 20s linear infinite;
  pointer-events: none;
}

.tip-lottie-container dotlottie-wc {
  width: 160px;
  height: 160px;
  z-index: 2;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

/* Fallback для анимации */
.tip-lottie-fallback {
  font-size: 80px;
  z-index: 2;
  animation: tipEmojiPulse 2s ease-in-out infinite;
}

/* ===== КОНТЕЙНЕР КОНТЕНТА ===== */
.tip-content {
  flex-grow: 1;
  padding: 28px 28px 16px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.5),
    rgba(248, 249, 255, 0.3)
  );
}

/* ===== ЗАГОЛОВОК ===== */
.tip-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.4px;
  line-height: 1.3;
}

.tip-title::before {
  content: "✨";
  font-size: 20px;
  display: inline-block;
  animation: tipTitlePulse 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

/* ===== ТЕКСТ ===== */
.tip-text {
  font-size: 0.7rem;
  color: #555;
  line-height: 1.65;
  margin: 0 0 18px 0;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* ===== КНОПКИ ===== */
.tip-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.tip-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tip-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
}

.tip-btn:hover::before {
  left: 100%;
}

.tip-btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.45);
  position: relative;
  z-index: 1;
}

.tip-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

.tip-btn-primary:active {
  transform: translateY(-1px);
}

.tip-btn-secondary {
  background: rgba(102, 126, 234, 0.12);
  color: #667eea;
  border: 2px solid rgba(102, 126, 234, 0.3);
  position: relative;
  z-index: 1;
}

.tip-btn-secondary:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: rgba(102, 126, 234, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

.tip-btn-secondary:active {
  transform: translateY(-1px);
}

/* ===== КНОПКА ЗАКРЫТИЯ ===== */
.tip-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(102, 126, 234, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  color: #667eea;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  font-weight: 300;
}

.tip-close:hover {
  background: rgba(102, 126, 234, 0.2);
  color: #764ba2;
  transform: rotate(90deg) scale(1.1);
}

.tip-close:active {
  transform: rotate(90deg) scale(0.95);
}

/* ===== АНИМАЦИИ ===== */
@keyframes tipSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9) rotateX(-10deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
  }
}

@keyframes tipSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
  }
  100% {
    opacity: 0;
    transform: translateY(30px) scale(0.9) rotateX(-10deg);
  }
}

@keyframes tipBgMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(40px, 40px);
  }
}

@keyframes tipBgShift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(20px, 20px);
  }
}

@keyframes tipTitlePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

@keyframes tipEmojiPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.tip-container.closing {
  animation: tipSlideOut 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .tip-container {
    max-width: 85vw;
    margin: 0 auto;
  }

  .tip-container.bottom-right,
  .tip-container.bottom-left,
  .tip-container.top-right,
  .tip-container.top-left {
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
    top: auto !important;
  }

  .tip-lottie-container dotlottie-wc {
    width: 130px;
    height: 130px;
  }

  .tip-content {
    padding: 20px 20px 20px 16px;
  }

  .tip-title {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .tip-text {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
  }

  .tip-btn {
    padding: 9px 14px;
    font-size: 12px;
  }

  .tip-close {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .tip-container {
    max-width: 90vw;
    display: flex;
    flex-direction: column;
  }

  .tip-lottie-container {
    width: 100%;
    height: 140px;
    border-radius: 20px 20px 0 0;
  }

  .tip-lottie-container dotlottie-wc {
    width: 110px;
    height: 110px;
  }

  .tip-content {
    padding: 18px 16px 16px 16px;
  }

  .tip-title {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .tip-text {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .tip-actions {
    gap: 8px;
  }

  .tip-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 11px;
  }

  .tip-close {
    width: 30px;
    height: 30px;
    font-size: 18px;
    top: 10px;
    right: 10px;
  }
}

/* ===== ТЕМНЫЙ РЕЖИМ ===== */
@media (prefers-color-scheme: dark) {
  .tip-container {
    background: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    border-color: rgba(102, 126, 234, 0.3);
  }

  .tip-content {
    background: linear-gradient(
      to bottom,
      rgba(30, 30, 46, 0.8),
      rgba(42, 42, 62, 0.5)
    );
  }

  .tip-title {
    color: #e8e8ff;
  }

  .tip-text {
    color: #b0b0d0;
  }

  .tip-close {
    background: rgba(102, 126, 234, 0.15);
    color: #a0b0ff;
  }

  .tip-close:hover {
    background: rgba(102, 126, 234, 0.25);
    color: #c0d0ff;
  }

  .tip-btn-secondary {
    background: rgba(102, 126, 234, 0.15);
    color: #a0b0ff;
    border-color: rgba(102, 126, 234, 0.4);
  }

  .tip-btn-secondary:hover {
    background: rgba(102, 126, 234, 0.25);
    border-color: rgba(102, 126, 234, 0.6);
  }
}

/* ===== РЕДУКЦИЯ ДВИЖЕНИЯ ===== */
@media (prefers-reduced-motion: reduce) {
  .tip-container,
  .tip-btn,
  .tip-close,
  .tip-title::before,
  .tip-lottie-fallback {
    animation: none !important;
    transition: none !important;
  }

  .tip-container:hover {
    transform: none;
  }

  .tip-btn:hover,
  .tip-close:hover {
    transform: none;
  }
}

/* ===== ПЕЧАТЬ ===== */
@media print {
  .tip-container {
    display: none !important;
  }
}
