.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: #504104; /* темный золотой */
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(18, 11, 4, 0.2);
  z-index: 1000;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
}

.auth-buttons {
  display: flex;
  gap: 15px;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  background: url('../images/bar-bg.jpg') no-repeat center center fixed;
  background-size: cover;
  position: relative;
  overflow: hidden; /* Запрещаем прокрутку */
  height: 100vh; /* Фиксированная высота */
  height: 100dvh;
  width: 100vw; /* Фиксированная ширина */
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(144, 140, 124, 0.3); /* светло-бежевый с прозрачностью */
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
}

.site-header,
.auth-buttons,
.logo,
.btn-login {
  position: relative;
  z-index: 1;
}


/* Затемнение поверх фона, но под контентом 
body::before {
  content: "";
  position: fixed;  фиксируем на весь экран 
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 0;  позади всего контента 
}
*/


.btn-login {
  background-color: #643309;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  /* Создаем скошенные углы */
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
}

/* Объединяем все эффекты при наведении в один селектор */
.btn-login:hover {
  background-color: #7d420f;
  transform: translateX(5px);
  box-shadow: inset 400px 0 0 0 #93a346;
  animation: pulse 1s infinite;
}

.btn-login:active {
  transform: translateX(2px) translateY(2px);
}

/* Добавляем подсветку края */
.btn-login::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

/* Исправляем анимацию pulse */
@keyframes pulse {
  0% { transform: scale(1) translateX(5px); }
  50% { transform: scale(1.05) translateX(5px); }
  100% { transform: scale(1) translateX(5px); }
}

/* Анимация подпрыгивания логотипа */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Анимация плавания окна чата */
@keyframes float {
  0% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -52%); }
  100% { transform: translate(-50%, -50%); }
}

/* Удалён проблемный мобильный блок — возвращаем поведение по умолчанию для десктопа */

/* Стили для окна чата */
.chat-window {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 45vw;
  height: calc(80px + 4rem); /* увеличили высоту */
  background: rgba(80, 65, 4, 0.95);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(18, 11, 4, 0.3);
  z-index: 1000;
  border: 2px solid rgba(255, 255, 255, 0.1);
  animation: float 3s ease-in-out infinite;
  overflow: hidden;
  padding: 30px;
  transition: height 0.3s ease-out, width 0.3s ease-out;
}

.chat-window.expanded {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  transform: none;
  border-radius: 50px;
  animation: none;
}

/* Desktop expand behavior */
.chat-window.expanded {
  height: calc(600px + 4rem);
  width: 70vw;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  animation: none;
}

.chat-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between; /* Changed from center to space-between */
  height: 100%;
  gap: 15px;
}

.chat-messages {
  flex: 1;
  height: calc(100% - 160px); /* Adjusted height to account for title and input */
  overflow-y: auto;
  width: 100%;
}

.chat-title {
  color: #ffffff;
  margin: 0 0 15px 0;
  font-size: 2.5rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', sans-serif;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header h3 {
  color: #ffffff;
  margin: 0;
  font-size: 1.1rem;
}

.minimize-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 5px;
}

.chat-body {
  padding: 10px;
  height: calc(100% - 50px); /* Учитываем высоту header */
}

.chat-messages {
  display: none;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  padding-right: 10px;
}

/* Стили для скроллбара */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(147, 163, 70, 0.5);
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 163, 70, 0.7);
}

.chat-messages.visible {
  display: flex;
  opacity: 1;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
  font-size: 1.1rem;
  animation: messageAppear 0.3s ease-out;
}

.user-message {
  background: rgba(147, 163, 70, 0.3);
  color: #ffffff;
  align-self: flex-end;
}

.ai-message {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  align-self: flex-start;
}

.chat-input {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 90%;
  margin-top: auto; /* Push input to bottom */
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.chat-input input:focus {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.chat-input input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
}

.send-btn {
  background: #93a346;
  border: none;
  border-radius: 15px;
  color: #ffffff;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.send-btn:hover {
  background: #7d420f;
  transform: scale(1.05);
}

.send-btn:active {
  transform: scale(0.95);
}

/* --- Адаптив для телефона --- */
@media (max-width: 768px) {
  .site-header {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .chat-window {
    width: 95vw;
    height: 70vh; /* чтобы не упиралось в края */
    height: 70dvh; /* чтобы не упиралось в края */
    border-radius: 20px;
    padding: 15px;
  }

  .chat-window.expanded {
    top: 0;
    left: 0;
    right: 0;
    bottom: 10dvh;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    padding: 10px;
  }

  .chat-window.expanded .chat-content {
    height: 100%;
    padding: 50px 12px 70px; /* место под инпут */
    gap: 10px;
  }

  .chat-window.expanded .chat-messages {
    flex: 1;
    height: auto;
    max-height: calc(100vh - 180px); /* учитываем хедер и инпут */
    max-height: calc(100dvh - 180px); /* учитываем хедер и инпут */
    padding-right: 6px;
  }

  .chat-input {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    padding: 8px;
    border-radius: 15px;
    gap: 8px;
  }

  .chat-input input {
    font-size: 1rem;
    padding: 10px 14px;
  }

  .send-btn {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .chat-title {
    font-size: 1.6rem;
  }
}
