/* -------------- ЧАТ КНОПКА --------------- */

.chat-button {
  position: fixed;
  bottom: 15px;
  left: 15px;
  z-index: 1000;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.5s ease;
  display: flex;
  align-items: center;
}

.chat-button.hidden {
  opacity: 0;
  transform: scale(0.8) translateX(-20px);
  pointer-events: none;
}

.chat-button__content {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border-radius: 40px;
  padding: 8px 15px 8px 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 2;
  transition: transform 0.3s ease;
}

/* Градиентная рамка - сине-фиолетовая */
.chat-button__border {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 42px;
  background: linear-gradient(
    90deg,
    #667eea 0%,
    #764ba2 25%,
    #667eea 50%,
    #764ba2 75%,
    #667eea 100%
  );
  background-size: 200% 100%;
  animation: border-gradient 3s linear infinite;
  z-index: 1;
  opacity: 0.9;
}

.chat-button__container {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Внешнее кольцо - сине-фиолетовый конусный градиент (ВРАЩАЕТСЯ) */
.chat-button__outer-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #667eea 0%,
    #764ba2 25%,
    #667eea 50%,
    #764ba2 75%,
    #667eea 100%
  );
  animation: rotate-gradient 4s linear infinite;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Внутренний круг - БЕЛЫЙ */
.chat-button__inner-circle {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #667eea;
  box-shadow: 
    0 3px 10px rgba(102, 126, 234, 0.2),
    inset 0 0 10px rgba(102, 126, 234, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Логотип - синий цвет */
.chat-button__logo {
  width: 16px;
  height: 16px;
  color: #667eea;
  transition: transform 0.3s ease, color 0.3s ease;
}

/* ТЕКСТ - видим по умолчанию */
.chat-button__text {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    font-size: 11px;
    padding-right: 5px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
    display: block;
    animation: text-reveal 0.5s 0.3s ease-out forwards;
    text-align: center;
}

/* Анимация появления текста */
@keyframes text-reveal {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== МЕДИА-ЗАПРОСЫ ===== */

/* 120px и выше - минимальный размер */
@media (min-width: 120px) {
  .chat-button {
    bottom: 2px;
    left: 2px;
  }
  
  .chat-button__text {
    font-size: 10px;
    padding-right: 3px;
  }
  
  .chat-button__content {
    padding: 6px 12px 6px 6px;
    gap: 6px;
  }
  
  .chat-button__container {
    width: 45px;
    height: 45px;
  }
  
  .chat-button__inner-circle {
    width: 28px;
    height: 28px;
  }
  
  .chat-button__logo {
    width: 14px;
    height: 14px;
  }
}

/* 200px и выше */
@media (min-width: 200px) {
  .chat-button {
    bottom: 3px;
    left: 3px;
  }
  
  .chat-button__text {
    font-size: 10px;
  }
  
  .chat-button__content {
    padding: 7px 14px 7px 7px;
    gap: 7px;
  }
}

/* 300px и выше */
@media (min-width: 300px) {
  .chat-button {
    bottom: 5px;
    left: 5px;
  }
  
  .chat-button__container {
    width: 55px;
    height: 55px;
  }
  
  .chat-button__inner-circle {
    width: 35px;
    height: 35px;
    border-width: 2.5px;
  }
  
  .chat-button__logo {
    width: 18px;
    height: 18px;
  }
  
  .chat-button__content {
    padding: 9px 18px 9px 9px;
    gap: 10px;
  }
  
  .chat-button__border {
    border-radius: 45px;
  }
  
  .chat-button__text {
    font-size: 16px;
    opacity: 0.9;
  }
}

/* 400px и выше */
@media (min-width: 400px) {
  .chat-button {
    bottom: 10px;
    left: 10px;
  }
  
  .chat-button__container {
    width: 60px;
    height: 60px;
  }
  
  .chat-button__inner-circle {
    width: 38px;
    height: 38px;
    border-width: 3px;
  }
  
  .chat-button__logo {
    width: 20px;
    height: 20px;
  }
  
  .chat-button__content {
    padding: 10px 22px 10px 10px;
    gap: 12px;
    border-radius: 45px;
  }
  
  .chat-button__border {
    border-radius: 48px;
  }
  
  .chat-button__text {
    font-size: 18px;
    opacity: 1;
  }
}

/* 500px и выше */
@media (min-width: 500px) {
  .chat-button {
    bottom: 15px;
    left: 15px;
  }
  
  .chat-button__container {
    width: 70px;
    height: 70px;
  }
  
  .chat-button__inner-circle {
    width: 45px;
    height: 45px;
    border-width: 3px;
    box-shadow: 
      0 4px 15px rgba(102, 126, 234, 0.25),
      inset 0 0 15px rgba(102, 126, 234, 0.1);
  }
  
  .chat-button__logo {
    width: 22px;
    height: 22px;
  }
  
  .chat-button__content {
    padding: 12px 25px 12px 12px;
    gap: 15px;
    border-radius: 50px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.18);
  }
  
  .chat-button__border {
    border-radius: 53px;
  }
  
  .chat-button__text {
    font-size: 18px;
    padding-right: 8px;
  }
}

/* 600px и выше */
@media (min-width: 600px) {
  .chat-button {
    bottom: 15px;
    left: 15px;
    margin-bottom: 50px;
  }
  
  .chat-button__container {
    width: 80px;
    height: 80px;
  }
  
  .chat-button__inner-circle {
    width: 50px;
    height: 50px;
    border-width: 4px;
    box-shadow: 
      0 5px 20px rgba(102, 126, 234, 0.3),
      inset 0 0 20px rgba(102, 126, 234, 0.15);
  }
  
  .chat-button__logo {
    width: 24px;
    height: 24px;
  }
  
  .chat-button__content {
    padding: 15px 30px 15px 15px;
    gap: 18px;
    border-radius: 55px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  }
  
  .chat-button__border {
    border-radius: 58px;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
  }
  
  .chat-button__text {
    font-size: 18px;
    font-weight: 700;
    padding-right: 10px;
  }
  
  /* Улучшенные анимации для больших экранов */
  .chat-button:hover .chat-button__content {
    transform: scale(1.08);
  }
  
  .chat-button:hover .chat-button__text {
    transform: translateX(8px);
    color: #667eea;
  }
}

/* 768px и выше */
@media (min-width: 750px) {
  .chat-button__container {
    width: 85px;
    height: 85px;
  }
  
  .chat-button__inner-circle {
    width: 55px;
    height: 55px;
  }
  
  .chat-button__logo {
    width: 26px;
    height: 26px;
  }
  
  .chat-button__text {
    font-size: 20px;
  }
}

/* 900px и выше */
@media (min-width: 900px) {
  .chat-button {
    bottom: 15px;
    left: 15px;
  }
  
  .chat-button__container {
    width: 90px;
    height: 90px;
  }
  
  .chat-button__inner-circle {
    width: 58px;
    height: 58px;
  }
  
  .chat-button__logo {
    width: 28px;
    height: 28px;
  }
  
  .chat-button__content {
    padding: 18px 35px 18px 18px;
  }
  
  .chat-button__text {
    font-size: 20px;
  }
}

/* 1200px и выше */
@media (min-width: 1200px) {
  .chat-button {
    bottom: 20px;
    left: 20px;
  }
  
  .chat-button__container {
    width: 100px;
    height: 100px;
  }
  
  .chat-button__inner-circle {
    width: 60px;
    height: 60px;
  }
  
  .chat-button__logo {
    width: 30px;
    height: 30px;
  }
  
  .chat-button__content {
    padding: 20px 40px 20px 20px;
  }
  
  .chat-button__text {
    font-size: 25px;
  }
}

/* Очень маленькие экраны (до 120px) - адаптируем еще сильнее */
@media (max-width: 119px) {
  .chat-button {
    bottom: 1px;
    left: 1px;
  }
  
  .chat-button__text {
    font-size: 9px;
    white-space: normal;
    line-height: 1.2;
  }
  
  .chat-button__content {
    padding: 5px 8px 5px 5px;
    gap: 4px;
  }
  
  .chat-button__container {
    width: 40px;
    height: 40px;
  }
  
  .chat-button__inner-circle {
    width: 25px;
    height: 25px;
    border-width: 1.5px;
  }
  
  .chat-button__logo {
    width: 12px;
    height: 12px;
  }
}

/* Анимации остаются без изменений */
@keyframes rotate-gradient {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes border-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Ховер эффекты */
.chat-button:hover .chat-button__inner-circle {
  transform: scale(1.1);
  box-shadow: 
    0 8px 25px rgba(102, 126, 234, 0.4),
    inset 0 0 15px rgba(102, 126, 234, 0.2);
  border-color: #764ba2;
}

.chat-button:hover .chat-button__logo {
  color: #764ba2;
  transform: scale(1.1);
}
