/* Buttons */
.button-group {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  position: relative;
}
.button-ghost {
  border-radius: 6px;
  padding: 8px 12px 8px 12px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 60ms ease;
}
.button-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}
.button-ghost:active {
  background: rgba(0, 0, 0, 0.06);
  transform: translateY(0.5px);
}
.button-ghost:focus { outline: none; }
.button-ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.35);
}
.icon-translate {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  overflow: visible;
  aspect-ratio: 1;
}
.label-secondary {
  color: #52525b;
  text-align: left;
  font-family: "Inter-Medium", sans-serif;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.08px;
  font-weight: 500;
  position: relative;
}
.icon-time {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  overflow: visible;
  aspect-ratio: 1;
}
.button-primary {
  background: #ff6c37;
  border-radius: 8px;
  padding: 8px 12px 8px 12px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 64px;
  position: relative;
  box-shadow: 0px 1px 12px 0px rgba(255, 108, 55, 0.44);
  cursor: pointer;
  transition: box-shadow 140ms ease, transform 60ms ease, filter 140ms ease;
}
.button-primary:hover { filter: brightness(1.02); }
.button-primary:active { transform: translateY(0.5px); }
.button-primary:focus { outline: none; }
.button-primary:focus-visible {
  outline: none;
  /* White inner stroke + outside orange focus ring + keep existing glow */
  box-shadow:
    0 0 0 2px #ffffff inset,
    0 0 0 2px rgba(255, 108, 55, 0.85),
    0px 1px 12px 0px rgba(255, 108, 55, 0.44);
}
.label-primary {
  color: #ffffff;
  text-align: left;
  font-family: "Inter-Bold", sans-serif;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.08px;
  font-weight: 700;
  position: relative;
}
.button-secondary {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 8px 12px 8px 12px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 60ms ease;
}
.button-secondary:hover { background: rgba(0, 0, 0, 0.06); }
.button-secondary:active { background: rgba(0, 0, 0, 0.08); transform: translateY(0.5px); }
.button-secondary:focus { outline: none; }
.button-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.35);
}
.icon-share {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  overflow: visible;
  aspect-ratio: 1;
}

/* Segment control */
.segment-contol {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  padding: 2px;
  display: inline-flex; /* shrink to content */
  flex-direction: row;
  gap: 2px;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto; /* do not stretch */
  height: 40px;
  width: auto;
  position: relative;
}
.tab-active {
  background: #ffffff;
  border-radius: 6px;
  padding: 8px 12px 8px 12px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  flex-shrink: 0;
  flex: 0 0 auto; /* keep size by content */
  position: relative;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
.tab-default {
  border-radius: 6px;
  padding: 8px 12px 8px 12px;
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  flex: 0 0 auto; /* keep size by content */
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}
.tab-default:hover { background: rgba(255,255,255,0.6); }
.tab-default:focus { outline: none; }
.tab-default:focus-visible { box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.35); }
.tab-active:focus { outline: none; }
.tab-active:focus-visible { box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.35); }
.label-secondary2 {}
.icon-time2 {}

/* Past article card */
.past_article_card {
  border-radius: 100px;
  border-style: solid;
  border-color: #f0f0f0;
  border-width: 1px;
  padding: 20px 24px 20px 24px;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  align-self: stretch;
  flex-shrink: 0;
  position: relative;
  overflow: hidden; /* keep inner hover icon inside rounded pill */
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.past_article_card:hover {
  background: #ffffff;
  border-color: #e6e6e6;
}
.card-fav-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  position: relative;
  object-fit: cover;
  aspect-ratio: 1;
}
.card-title-container {
  display: flex;
  flex-direction: column;
  gap: 0px;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 1;
  min-width: 0; /* allow text to shrink within flex, enable ellipsis */
  position: relative;
}
.card-title {
  color: #000000;
  text-align: left;
  font-family: "Poppins-Regular", sans-serif;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.48px;
  font-weight: 400;
  position: relative;
  align-self: stretch;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.card-link {
  color: #52525b;
  text-align: left;
  font-family: "Inter-Regular", sans-serif;
  font-size: 14px;
  line-height: 16px;
  font-weight: 400;
  position: relative;
  align-self: stretch;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Hover arrow indicator on past article card */
.past-article-arrow {
  margin-left: auto;
  margin-right: 6px; /* keep inside rounded edge */
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 140ms ease, background-color 140ms ease;
}
.past-article-arrow-icon {
  width: 24px;
  height: 24px;
  display: block;
}
.past_article_card:hover .past-article-arrow { opacity: 1; }
.past-article-arrow:hover { background: rgba(0,0,0,0.08); }

/* Extracted from up_components.css */
.section-content {
  background: linear-gradient(
    180deg,
    rgba(255, 177, 88, 1) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  border-radius: 28px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 0px;
  align-items: flex-start;
  justify-content: flex-start;
  align-self: stretch;
  flex-shrink: 0;
  height: 150px;
  position: relative;
}

/* Subtle shake animation to indicate invalid input */
@keyframes section-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.section-content.shake {
  animation: section-shake 400ms cubic-bezier(.36,.07,.19,.97);
  will-change: transform;
}

/* Snackbar (moved from Snackbar/style.css) */
.snackbar,
.snackbar * {
  box-sizing: border-box;
}
.snackbar {
  background: #52525b;
  border-radius: 100px;
  padding: 20px 32px 20px 32px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  max-width: 800px;
  position: relative;
}
.snackbar-title {
  color: #ffffff;
  text-align: left;
  font-family: "Poppins-Regular", sans-serif;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.16px;
  font-weight: 400;
  position: relative;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.snackbar-description {
  color: #ffffff;
  text-align: left;
  font-family: "Inter-Regular", sans-serif;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.16px;
  font-weight: 400;
  opacity: 0.64;
  position: relative;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* Loading States */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

.loading-spinner-primary {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 108, 55, 0.3);
  border-top: 2px solid #ff6c37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

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

/* Progress Bar removed */

/* Disabled Button States */

/* Tooltip */
.tooltip,
.tooltip * { box-sizing: border-box; }
.tooltip {
  background: #52525b;
  border-radius: 12px;
  padding: 8px 12px 8px 12px;
  display: inline-block;
  align-items: center;
  min-width: 128px;
  max-width: 256px;
  width: 256px;
  position: relative;
}
.tooltip .snackbar-description {
  color: #ffffff;
  text-align: left;
  font-family: "Inter-Regular", sans-serif;
  font-size: 14px;
  line-height: 16px;
  letter-spacing: -0.16px;
  font-weight: 400;
  opacity: 0.64;
  position: relative;
  align-self: auto;
  flex: none;
  white-space: normal;
  display: block;
  overflow: visible;
  text-overflow: unset;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.tooltip-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 10;
}
.tooltip-wrapper:hover .tooltip-bubble { display: block; }

/* Centered arrow pointing up (tooltip below icon) */
.tooltip-bubble::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #52525b;
  border-radius: 2px;
}
.button-primary:disabled,
.button-primary.disabled {
  background: #707070;
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
  transform: none;
  pointer-events: none;
}

.button-primary:disabled .label-primary,
.button-primary.disabled .label-primary {
  color: rgba(255, 255, 255, 0.6);
}

.button-secondary:disabled,
.button-secondary.disabled {
  background: rgba(0, 0, 0, 0.04);
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.button-secondary:disabled .label-secondary,
.button-secondary.disabled .label-secondary {
  color: rgba(82, 82, 123, 0.5);
}

.button-ghost:disabled,
.button-ghost.disabled {
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.button-ghost:disabled .label-secondary,
.button-ghost.disabled .label-secondary {
  color: rgba(82, 82, 123, 0.5);
}

/* Spinner icon inside primary button while loading */
.button-primary .spinner-icon {
  display: block;
  width: 24px;
  height: 24px;
}

/* Image Skeleton (results.html) */
.skeleton-svg {
  display: block;
  width: 100%;
  margin-bottom: 64px;
  opacity: 0.95;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

.loading-overlay .loading-spinner-primary {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* Smooth Transitions */
.fade-in {
  animation: fadeIn 300ms ease-out;
}

.fade-out {
  animation: fadeOut 300ms ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

.slide-up {
  animation: slideUp 400ms ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.scale-in {
  animation: scaleIn 200ms ease-out;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Conditional Visibility */
.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
  opacity: 0;
}

.visible {
  visibility: visible;
  opacity: 1;
  transition: opacity 300ms ease, visibility 300ms ease;
}

/* History Block Conditional Display */
.history-section {
  transition: opacity 300ms ease, transform 300ms ease;
}

.history-section.empty {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.history-section.has-articles {
  opacity: 1;
  transform: translateY(0);
}

/* Loading States for Input */
.input-loading {
  position: relative;
}

.input-loading::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 108, 55, 0.3);
  border-top: 2px solid #ff6c37;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Pulse Animation for Loading Elements */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Loading Text Animation */
.loading-text {
  position: relative;
}

.loading-text::after {
  content: '';
  animation: loading-dots 1.5s ease-in-out infinite;
}

@keyframes loading-dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Smooth State Transitions */
.state-transition {
  transition: all 300ms ease;
}

/* Processing States */
.processing {
  position: relative;
  overflow: hidden;
}

.processing::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 108, 55, 0.1), transparent);
  animation: processing-shimmer 2s ease-in-out infinite;
}

@keyframes processing-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* CSAT Widget */
.csat-widget,
.csat-widget * { box-sizing: border-box; }
.csat-widget {
  padding: 64px 0 88px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: flex-start;
  align-self: stretch;
  flex-shrink: 0;
  position: relative;
}
.results-label {
  color: #52525B;
  opacity: 0.44;
  text-align: center;
  font-family: "Poppins-Regular", sans-serif;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.48px;
  font-weight: 400;
  position: relative;
  align-self: stretch;
}
.stars-container {
  display: flex;
  flex-direction: row;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  height: auto;
  position: relative;
  overflow: visible;
}
.csat-star {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
}
.csat-star:focus { outline: none; }
.csat-star:focus-visible { box-shadow: 0 0 0 2px rgba(255, 108, 55, 0.35); border-radius: 6px; }
.csat-star img { display: block; width: 48px; height: 48px; }

/* Subtle hover bounce for stars */
@keyframes csat-hover-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.csat-star:hover img,
.csat-star:focus-visible img {
  animation: csat-hover-bounce 400ms ease-in-out ;
  will-change: transform;
}
.csat-star:active img {
  animation: none;
  transform: translateY(0);
}
/* Disable hover animation for disabled stars */
.csat-star[disabled] img { animation: none !important; transform: none !important; }
