/* Reset i ogólne ustawienia */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Helvetica", "Arial", sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
  background-attachment: fixed;
  color: white;
  display: flex;
  flex-direction: column;
}

/* Rating container - hidden by default */
.rating {
  display: none;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.rating.show {
  display: flex;
}

.rating span {
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
}

.rating span:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.rating span.active {
  background: rgba(74, 222, 128, 0.3);
  border-color: rgba(74, 222, 128, 0.6);
  box-shadow: 0 0 20px rgba(74, 222, 128, 0.4);
}

/* Rating toggle button */
.rating-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.7);
}

.rating-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.rating-toggle::before {
  content: "⭐";
  font-size: 14px;
}

/* Answer container wrapper */
.answer-wrapper {
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  max-width: 70%;
}

/* Pasek górny */
#top-bar {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

#top-bar .logo img {
  height: 42px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

/* Główne okno chatu */
#main-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  max-height: calc(100vh - 70px);
}

/* Okno wiadomości */
#messege-box {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Styl wiadomości użytkownika */
.messege {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  align-self: flex-end;
  padding: 12px 18px;
  border-radius: 20px;
  border-top-right-radius: 4px;
  max-width: 70%;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  font-size: 15px;
  line-height: 1.5;
}

/* Styl odpowiedzi bota */
.anwser {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  align-self: flex-start;
  padding: 12px 18px;
  border-radius: 20px;
  border-top-left-radius: 4px;
  max-width: 70%;
  word-wrap: break-word;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  font-size: 15px;
  line-height: 1.5;
}

/* Pole do pisania */
#typing-box {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

.typing {
  flex: 1;
  padding: 14px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-right: 12px;
  color: #fff;
  font-size: 15px;
  transition: all 0.3s ease;
}

.typing:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.typing::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Ikona przycisku wysyłania */
#typing-box img {
  width: 40px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
  filter: brightness(0) invert(1);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

#typing-box img:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

#typing-box img:active {
  transform: scale(0.95);
}

/* Notification styling */
#notification {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2) !important;
  font-weight: 500;
}

/* Scrollbar stylizacja */
#messege-box::-webkit-scrollbar {
  width: 10px;
}

#messege-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

#messege-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

#messege-box::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
  background-clip: padding-box;
}

/* Animacje */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.messege,
.anwser {
  animation: fadeIn 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .messege,
  .anwser {
    max-width: 85%;
  }

  #messege-box {
    padding: 16px;
  }

  #typing-box {
    padding: 16px;
  }
}
