@font-face {
  font-family: "Gordita";
  src: url("./fonts/Gordita-Regular.woff2") format("woff2"),
       url("./fonts/Gordita-Regular.woff") format("woff"),
       url("./fonts/Gordita-Regular.ttf") format("truetype"),
       url("./fonts/Gordita-Regular.eot");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gordita";
  src: url("./fonts/Gordita-Medium.woff2") format("woff2"),
       url("./fonts/Gordita-Medium.woff") format("woff"),
       url("./fonts/Gordita-Medium.ttf") format("truetype"),
       url("./fonts/Gordita-Medium.eot");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gordita";
  src: url("./fonts/Gordita-Bold.woff2") format("woff2"),
       url("./fonts/Gordita-Bold.woff") format("woff"),
       url("./fonts/Gordita-Bold.ttf") format("truetype"),
       url("./fonts/Gordita-Bold.eot");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Gordita", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #ffffff; /* default white background */
}

.aga-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start; /* start near top */
  justify-content: center;
  padding: 16px 24px 40px; /* minimal top spacing */
}

.aga-shell {
  width: 100%;
  max-width: 1180px; /* slightly wider base card */
}

.aga-card {
  background-color: #ffffff;
  border-radius: 28px;
  padding: 56px 80px 56px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.24);
}

.aga-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.aga-card-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: transparent;
  background-image: url("./assets/robot.svg");
  background-size: 24px 24px; /* smaller than container to avoid clipping */
  background-position: center;
  background-repeat: no-repeat;
}

.aga-card-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.aga-chat-block {
  margin: 0 auto;
  max-width: 860px; /* wider inner content */
  border-radius: 12px; /* shared radius with user box */
  border: 1px solid #2563eb; /* blue border for assistant */
  padding: 14px 26px 16px;
  background-color: #ffffff;
}

.aga-secondary-block {
  margin-top: 32px;
}

.aga-assistant-label {
  display: inline-block;
  margin-bottom: 8px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
}

.aga-user-label {
  color: #111827;
}

.aga-assistant-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #111827;
}

.aga-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.aga-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background-color: #9ca3af;
  animation: aga-typing-bounce 1.2s infinite ease-in-out;
}

.aga-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.aga-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes aga-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.aga-middle-row {
  display: flex;
  flex-direction: row; /* pill + button on same row */
  align-items: center;
  justify-content: flex-end; /* align user row to the right like chat */
  gap: 16px;
  margin-top: 26px;
  max-width: 860px; /* align with wider assistant width */
  margin-left: auto;
  margin-right: auto;
}

.aga-user-input-block {
  flex: 0 1 580px; /* slightly wider user bubble within wider card */
  min-width: 0;
  max-width: 580px;
  border-radius: 12px; /* same as assistant box */
  padding: 14px 26px 16px; /* match assistant box spacing */
  border: 1px solid #111827; /* dark/black border for user */
  background-color: #ffffff;
  overflow: visible; /* let inner content breathe, no clipping at edges */
}

.aga-user-input-input {
  width: 100%;
  box-sizing: border-box;
  border: none;
  outline: none;
  margin-top: 4px; /* small gap below label */
  padding: 0; /* rely on outer block padding so text isn't cut on sides */
  font-size: 14px;
  text-align: left;
  color: #111827;
  background-color: transparent; /* no inner pill to get clipped */
  border-radius: 0;
}

.aga-user-input-input:disabled {
  background-color: transparent;
  cursor: not-allowed;
}

.aga-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aga-btn-ghost {
  background-color: transparent;
  color: #2563eb;
  border-color: #2563eb;
}

.aga-btn-primary {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.45); /* stronger glow like reference */
}

.aga-btn-primary::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  background-image: url("./assets/white-arrow.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Edit button: blue pill with white pen icon */
.aga-edit-btn {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
  padding-inline: 18px 18px;
}

.aga-edit-btn::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  background-image: url("./assets/white-edit.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.is-hidden {
  display: none !important;
}

.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.aga-footer-row {
  margin-top: 32px;
  display: flex;
  justify-content: flex-start;
  max-width: 860px; /* match wider content width */
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 900px) {
  .aga-page {
    align-items: flex-start;
  }

  .aga-card {
    padding: 20px 16px 24px;
    border-radius: 22px;
  }

  .aga-user-input-block {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .aga-shell {
    max-width: 100%;
  }

  .aga-chat-block,
  .aga-middle-row {
    max-width: 100%;
  }

  .aga-middle-row {
    flex-direction: row;      /* row with wrapping: input first line, buttons second */
    align-items: center;
    justify-content: flex-end; /* right-align user row on mobile as well */
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .aga-user-input-block {
    flex: 1 1 100%;          /* input takes full width on its own line */
    max-width: 100%;
  }

  /* Buttons sit on the next wrapped line, aligned to the right */
  .aga-middle-row .aga-btn {
    margin-top: 4px;
  }

  .aga-btn-primary {
    align-self: auto;       /* rely on flex + margins above */
  }
}

/* User sent message block (non-editable) - matches aga-middle-row pattern */
.aga-user-sent-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end; /* align user row to the right like chat */
  gap: 16px;
  margin-top: 26px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.aga-user-sent-block .aga-user-input-block {
  flex: 0 1 580px;
  min-width: 0;
  max-width: 580px;
  border-radius: 12px;
  padding: 14px 26px 16px;
  border: 1px solid #111827; /* dark/black border for user */
  background-color: #ffffff;
  overflow: visible;
}

.aga-user-sent-text {
  margin: 4px 0 0;
  padding: 0;
  font-size: 14px;
  text-align: left;
  color: #111827;
  line-height: 1.5;
  word-wrap: break-word;
}
