/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  background: linear-gradient(135deg, #f1c032 0%, #e4a527 100%);
  min-height: 100vh;
  color: #202020;
}

#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section styles */
.section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Login styles */
.login-container {
  background: #ffffff;
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  margin: 0 auto;
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-header h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #f1c032 0%, #e4a527 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-header p {
  color: #707070;
  font-size: 16px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #202020;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #eaeaea;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #f1c032;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-height: 48px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #f1c032 0%, #e4a527 100%);
  color: #202020;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(241, 192, 50, 0.3);
}

.btn-secondary {
  background: #fafafa;
  color: #707070;
  border: 1px solid #eaeaea;
}

.btn-secondary:hover {
  background: #f4f4f4;
}

.btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Error message */
.error-message {
  background: #fa6464;
  color: #ffffff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 16px;
  border: 1px solid #de3737;
}

/* Chat styles */
.chat-container {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eaeaea;
  background: #fafafa;
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info span {
  font-weight: 500;
  color: #202020;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  margin-bottom: 12px;
}

.message-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 80%;
}

.user-message .message-content {
  flex-direction: row-reverse;
  margin-left: auto;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.ai-message .message-avatar {
  background: linear-gradient(135deg, #f1c032 0%, #e4a527 100%);
  color: #202020;
}

.user-message .message-avatar {
  background: #eaeaea;
  color: #707070;
}

.message-text {
  background: #fafafa;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: #202020;
  font-size: 14px;
}

.user-message .message-text {
  background: linear-gradient(135deg, #f1c032 0%, #e4a527 100%);
  color: #202020;
}

.chat-input {
  padding: 16px 20px;
  border-top: 1px solid #eaeaea;
  background: #fafafa;
}

.input-container {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#message-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #eaeaea;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 120px;
  min-height: 44px;
  transition: border-color 0.3s ease;
  background: #ffffff;
  color: #202020;
}

#message-input:focus {
  outline: none;
  border-color: #f1c032;
}

#send-btn {
  flex-shrink: 0;
  width: 100px;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f1c032 0%, #e4a527 100%);
  color: #202020;
}

#send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(241, 192, 50, 0.3);
}

#send-btn .btn-text {
  font-size: 16px;
}

/* Common Questions Badges */
.common-questions {
  padding: 12px 16px;
  border-top: 1px solid #eaeaea;
  background: #fafafa;
}

.badges-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: #bababa #f4f4f4;
}

.badges-container::-webkit-scrollbar {
  height: 3px;
}

.badges-container::-webkit-scrollbar-track {
  background: #f4f4f4;
  border-radius: 2px;
}

.badges-container::-webkit-scrollbar-thumb {
  background: #bababa;
  border-radius: 2px;
}

.badges-container::-webkit-scrollbar-thumb:hover {
  background: #a5a5a5;
}

.question-badge {
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #202020;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.question-badge:hover {
  background: linear-gradient(135deg, #f1c032 0%, #e4a527 100%);
  color: #202020;
  border-color: #f1c032;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(241, 192, 50, 0.2);
}

.question-badge:active {
  transform: translateY(0);
}

/* Responsive design */
@media (max-width: 768px) {
  .section {
    padding: 12px;
  }

  .login-container {
    padding: 24px;
  }

  .chat-container {
    height: 92vh;
    border-radius: 12px;
  }

  .chat-header {
    padding: 12px 16px;
  }

  .chat-messages {
    padding: 14px 16px;
    gap: 12px;
  }

  .chat-input {
    padding: 12px 16px;
  }

  .message-content {
    max-width: 92%;
  }

  .message-text {
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
  }

  .input-container {
    gap: 6px;
  }

  #message-input {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 40px;
  }

  #send-btn {
    width: 80px;
    height: 40px;
    padding: 0 12px;
  }

  #send-btn .btn-text {
    font-size: 14px;
  }

  .common-questions {
    padding: 8px 12px;
  }

  .badges-container {
    gap: 6px;
  }

  .question-badge {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 14px;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .section {
    padding: 8px;
  }

  .chat-container {
    height: 94vh;
    border-radius: 8px;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .chat-messages {
    padding: 12px 12px;
    gap: 10px;
  }

  .chat-input {
    padding: 10px 12px;
  }

  .message-content {
    max-width: 95%;
  }

  .message-text {
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
  }

  .input-container {
    gap: 4px;
  }

  #message-input {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 36px;
  }

  #send-btn {
    width: 70px;
    height: 36px;
    padding: 0 10px;
  }

  #send-btn .btn-text {
    font-size: 13px;
  }

  .common-questions {
    padding: 6px 10px;
  }

  .badges-container {
    gap: 4px;
  }

  .question-badge {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 12px;
  }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f4f4f4;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #bababa;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a5a5a5;
}
