/* Base styles */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-bottom: 0; /* Override Pico CSS padding */
  font-family: "Roboto", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

/* Layout containers */
main.container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
  padding-block: 0;
  max-width: 600px;
}

.chat-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.messages-wrapper {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-top: auto;
  padding-top: 1rem;
}

/* Form and input styles */
.form-wrapper {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #f0f0f0;
  padding: 1rem;
  border-top: 1px solid #eee;
  z-index: 1000;
}

.form-wrapper .container {
  max-width: 600px;
  margin: 0 auto;
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  grid-area: footer;
  width: 100%;
  margin-top: 0.25rem;
  min-height: 1.5rem;
}

button[type="submit"] {
  padding: 0.5rem 1rem;
  min-width: unset;
  width: auto;
  font-size: 1.2rem;
}

button[type="submit"] .button-text {
  display: none;
}

button[type="submit"]::after {
  content: "➤";
  font-size: 1.2rem;
}

#chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "input button"
    "footer footer";
  gap: 0.5rem;
  width: 100%;
}

#chat-form input {
  grid-area: input;
  margin: 0;
}

#chat-form button {
  grid-area: button;
  margin: 0;
}

/* Message styles */
.message {
  max-width: 70%;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.assistant {
  background-color: #7b00ff;
  align-self: flex-start;
  border: 1px solid #ccc;
  color: white;
  font-family: "VT323", monospace;
  font-variant-ligatures: none;
  font-variant-caps: none;
  font-variant-numeric: none;
  line-height: 0.95;
  font-weight: 400;
  font-style: normal;
  font-size: 1.2rem;
}

.user {
  background-color: #ffda45;
  color: #333;
  align-self: flex-end;
}

.important-info {
  max-width: 100%;
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
  margin: 1rem 0;
  text-align: center;
}

.dummy.important-info {
  padding: 1rem;
}

#warning-message {
  width: 100%;
  max-width: 100%;
  position: relative;
}

#warning-message span:first-child {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
}

#warning-message span:first-child::before {
  content: "⚠️";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.3s ease;
}

#warning-message span:first-child::after {
  content: "🚩";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#warning-message:hover span:first-child::before {
  opacity: 0;
}

#warning-message:hover span:first-child::after {
  opacity: 1;
}

/* Loading animation */
.loading {
  font-style: italic;
  color: gray;
  background-color: #eedeff;
}

.loading span {
  margin-right: 4px;
}

.loading .dot {
  display: inline-block;
  animation: bounce 1s infinite;
  margin-left: 1px;
}

.loading .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading .dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Typing indicator */
.typing {
  visibility: hidden;
}

.typing::after {
  content: '▋';
  display: inline-block;
  color: white;
  margin-left: 2px;
}

.typing.done::after {
  display: none;
}

/* Image animations */
.assistant img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 2px solid white;
  margin-top: 0.5rem;
}

.assistant img.animate-reveal {
  animation: reveal-lines 3s linear;
}

/* Utility classes */
.muted {
  color: gray;
}

.small {
  font-size: 0.5rem;
}

.centered {
  text-align: center;
}

.powered-by {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.char-count {
  font-size: 0.8rem;
  color: #666;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 90%;
  width: 400px;
  transform: translateY(-20px);
  transition: transform 0.2s ease-out;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal h3 {
  margin-top: 0;
  color: #333;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

.modal-actions button {
  margin: 0;
  min-width: unset;
  padding: 0.5rem 1rem;
}

.modal-actions button.secondary {
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
}

.modal-actions button.secondary:hover {
  background-color: #e0e0e0;
}

/* Preloader styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
}

.preloader.hide {
  opacity: 0;
  pointer-events: none;
}

.preloader-content {
  text-align: center;
}

.preloader-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #7b00ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* Link styles */
.restart-chat {
  color: #666;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.restart-chat:hover {
  background-color: #f0f0f0;
  color: #333;
}

.dummy.important-info .restart-chat {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 0.8rem;
  background-color: #856404;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.dummy.important-info .restart-chat:hover {
  background-color: #6a5003;
}

/* Animations */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes reveal-lines {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

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

/* Responsive styles */
@media (max-width: 600px) {
  .message {
    max-width: 90%;
  }
} 