:root {
  --header-text-color: #485c6e;
  --color-grey-50: #f1f1f1;
  --color-grey-300: #a0a0a0;
  --color-grey-700: #505050;
}

body {
  font-family:
    "Satoshi",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
}

.active-passive-parent-container {
  background-color: var(--color-blue-500);
}

.main-content-wrapper {
  padding: 1.5rem;
}

.content-container {
  background-color: white;
  border: 1px solid var(--color-grey-50);
  box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.12);
  overflow: visible;
  border-radius: 0.5rem;
}

.header-title {
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  font-weight: 700;
  color: var(--header-text-color);
}

.header-desc {
  font-size: clamp(0.875rem, 1vw + 0.25rem, 1rem);
  font-weight: 400;
  color: var(--header-text-color);
}

.content-grid {
  display: flex;
  width: 100%;
  min-height: 500px;
  flex-direction: column;
}

.main-content {
  flex: 0 0 65%;
  /* 65% when both visible */
}

.separator {
  background-color: var(--color-grey-50);
  margin: auto;
  height: 95%;
  display: none;
  width: 0.15rem;
  margin: 0.5;
}

.input-section {
  width: 100%;
  padding: 0.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-grey-700);
  margin-bottom: 1rem;
}

.samples-container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.samples-label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.samples-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-btn {
  padding: 8px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  color: #666;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: fit-content;
}

.samples-dropdown {
  display: none;
  flex: 1;
}

/* ==========================================================================
   OUTPUT SECTION
   ========================================================================== */

.output-section {
  flex: 0 0 35%;
  /* 40% when visible */
  min-height: 100%;
  height: 570px;
  overflow-y: scroll;
  width: 100%;
  padding: 0.5rem;
}

.scrollable-container-hidden {
  overflow: auto;
  /* allow scrolling */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE 10+ */
}

.scrollable-container-hidden::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

.tool-output {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-grey-700);
}

.brand-logo {
  display: block;
  margin: 0 auto;
  max-width: 120px;
  width: 100%;
}

.bar-percentage {
  color: #fff;
  font-size: 0.85rem;
  padding-left: 6px;
}

.version-info {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 15px 0 5px 0;
  width: 100%;
}

.version-info .line {
  flex: 1;
  height: 1px;
  background: #ddd;
}

.result-explained {
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.metric-container {
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 10px;
  border-bottom: 1px solid #e9ecef;
  background-color: #f8f9fa;
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  font-size: 16px;
  font-weight: 500;
  color: #495057;
}

.indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.ai-generated {
  background-color: #dc3545;
}

.human-written {
  background-color: #007bff;
}

.metric-value {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
}

.sentences-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 10px;
  font-size: 16px;
  background-color: #f8f9fa;
}

.sentences-label {
  font-weight: 500;
  color: #495057;
}

.sentences-count {
  font-weight: 400;
}

.stats-pills {
  display: flex;
  margin-top: 15px;
  width: 100%;
  gap: 2px;
  margin: 12px 0;
  justify-content: space-evenly;
}

.stat-pill {
  border: 1px solid #e9ecef;
  border-radius: 20px;
  padding: 6px 4px;
  font-size: 0.8rem;
  font-weight: 500;
  flex: 1 1 auto;
  max-width: 108px;
  text-align: center;
  white-space: nowrap;
}

.toggle-section {
  margin-top: 10px;
  border-top: 1px solid #e9ecef;
}

.toggle-header {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 0;
  user-select: none;
}

.toggle-title {
  font-size: 16px;
  font-weight: 600;
  color: #495057;
}

.toggle-title::before {
  content: url("/assets/icons/toggle.php");
  margin-right: 8px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.toggle-section.open .toggle-title::before {
  transform: rotate(180deg);
}

.toggle-arrow {
  transition: transform 0.3s ease;
  font-size: 18px;
  color: #6c757d;
}

.toggle-arrow.expanded {
  transform: rotate(180deg);
}

.toggle-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.toggle-content.expanded {
  max-height: 200px;
}

.toggle-text {
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #6c757d;
}

.gauge-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-svg-wrapper {
  position: relative;
}

/* Paths */
.arc-path {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
  stroke: #ddd;
  /* greyish empty gauge */
}

.arc-red {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
  stroke: #c93f3f;
  stroke-dasharray: 0 1000;
  /* initially hidden */
}

.arc-blue {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
  stroke: #265baa;
  stroke-dasharray: 0 1000;
  /* initially hidden */
}

.pct-label {
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: hanging;
  fill: #222;
  font-size: 55px;
}

.gauge-afterText {
  text-align: center;
  margin: 5px 0;
  font-size: 16px;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 150%;
  color: #265baa;
}

.gauge-humanize {
  width: 80px;
  height: 18px;
  background: #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #666;
  margin: 10px auto;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.action-btns {
  height: 2.95rem;
  z-index: 1;
  margin: 5px 0;
}

#upload-doc-btn {
  border: 1px solid var(--color-grey-50);
  box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.12);
  width: 2.25rem;
  height: auto;
  background-color: white;
  color: #485c6e;
  transition: all 0.2s ease;
  cursor: pointer;
  border-radius: 0.5rem;
  /* rounded-lg */
  padding: 0.5rem;
  /* p-2 */
}

/* Hide text on small screens */
#upload-doc-btn span {
  display: none;
}

.header-action-btns {
  display: flex;
  gap: 0.5rem;
  height: 2.25rem;
}

.btn-primary {
  background: var(--color-primary-light);
  border: none;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--color-primary-dark);
}

.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.btn-loading-spinner {
  border: 1px solid #f3f4f6;
  border-top: 1px solid var(--color-primary-light);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

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

  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-secondary {
  border: 1px solid var(--color-grey-50);
  box-shadow: 0px 1px 6px rgba(0, 0, 0, 0.12);
  width: 2.25rem;
  height: auto;
  background-color: white;
  color: #485c6e;
  transition: all 0.2s ease;
  cursor: pointer;
  border-radius: 0.375rem;
  /* optional: subtle rounding */
}

/* Hover state */
.btn-secondary:hover:not(:disabled) {
  background-color: #f9fafb;
  /* light gray */
  box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.15);
  border-color: #e5e7eb;
  /* slightly darker border on hover */
}

/* Disabled state */
.btn-secondary:disabled {
  background-color: #f5f5f5;
  color: #a1a1aa;
  border-color: #e5e5e5;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}


.btn-secondary-loader {
  border: 2px solid #F1F1F1;
  border-top: 2px solid #485C6E;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

.btn-secondary:disabled .btn-secondary-loader {
  border-top-color: #A1A1AA;
}

.btn-secondary .btn-icon {
  display: flex;
  align-items: center;
}

.btn-secondary .btn-secondary-loader.d-none {
  display: none !important;
}

/* ==========================================================================
   INPUT TEXTAREA LIMIT
   ========================================================================== */

.input-group-custom {
  position: relative;
  height: 100%;
}

#text-content-textarea {
  position: relative;
  min-height: 450px;
  /* TODO Need To Fix This Logic */
  height: 450px;
  max-height: 450px;
  background: transparent;
  resize: none;
  z-index: 1;
}

.textarea-container {
  position: relative;
}

/* Remove Bootstrap focus border and shadow */
.form-control:focus {
  border-color: #ced4da;
  /* Default gray border */
  box-shadow: none;
  /* Remove the blue glow */
  outline: none;
  /* Remove default outline */
}

.form-control {
  border-bottom-left-radius: 0;
  /* square bottom-left */
  border-bottom-right-radius: 0;
  /* square bottom-right */
}

#text-content-textarea,
.backdrop {
  scrollbar-gutter: stable;
  /* always reserve scrollbar width */
}

.backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  overflow: hidden;
  padding: 0.375rem 0.75rem;
}

.highlights {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.highlight-text-red {
  color: #c93f3f;
  background-color: #f8e7e7;
  color: transparent;
  position: relative;
  overflow: hidden;
}

.highlight-text-blue {
  color: #265baa;
  background-color: #ebf6fa;
  color: transparent;
  position: relative;
  overflow: hidden;
}

.char-counter {
  position: absolute;
  bottom: calc(100% - 450px + 8px); /* 450px is the height of textara, please remember to update this too while updating textarea height*/
  right: 12px;
  font-size: 12px;
  color: #6b7280;
  background: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  z-index: 1;
}

.char-limit-warning {
  color: #f59e0b;
}

.char-limit-error {
  color: #ef4444;
}

/* ==========================================================================
   RESULT SECTIONS
   ========================================================================== */

/* For Firefox */
#results-container {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ==========================================================================
    RESPONSIVE DESIGN - BREAKPOINTS
    @media (max-width: 479px) {}
    @media (min-width: 480px) {}
    @media (min-width: 768px) {}
    @media (min-width: 1024px) {}
    @media (min-width: 1280px) {}
   ========================================================================== */

/* Small Mobiles */
@media (max-width: 479px) {
  /* smallest mobile devices */
}

/* Mobile Only */
@media (min-width: 480px) {
  /* All mobile devices */
}

/* Tablet and Up */
@media (max-width: 768px) {

  .metric-label,
  .metric-value,
  .sentences-info {
    font-size: 1rem;
  }

  .samples-dropdown {
    display: block;
  }

  .samples-label {
    display: none;
  }

  .samples-buttons {
    display: none;
  }

  .samples-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Desktop and Up */
@media (min-width: 1024px) {
  /* Desktop and larger */

  .content-grid {
    flex-direction: row;
    /* side-by-side for large screens */
  }

  .btn-primary {
    padding: 0.75rem 2rem;
  }

  #upload-doc-btn {
    border: none;
    box-shadow: none;
    width: auto;
    background-color: transparent;
    color: inherit;
    border-radius: 0;
    /* remove rounding */
    padding: 0;
    /* remove padding */
  }

  #upload-doc-btn span {
    display: inline;
  }

  .input-action-btns-container {
    flex-direction: row;
  }

  .long-bordered-btn {
    display: flex;
  }
}

@media (max-width: 768px) and (min-height: 1024px) {
  /* Target tablet portrait */
}

/* Large Desktop and Up */
@media (min-width: 1280px) {
  /* Large desktop and larger */
}

/* =======================
   ORIENTATION BREAKPOINTS
   ======================= */

/* Initial state: collapsed */

.highlight-sentence {
  background-color: #fff3cd;
  border-left: 3px solid #ffc107;
  padding: 2px 4px;
  margin: 2px 0;
  border-radius: 3px;
  animation: highlight-pulse 0.3s ease-in-out;
}

@keyframes highlight-pulse {
  0% {
    background-color: #fff3cd;
  }

  50% {
    background-color: #ffeaa7;
  }

  100% {
    background-color: #fff3cd;
  }
}










/* ==========================================================================
   SOURCES/LINKS SECTION
   ========================================================================== */
/* .sources-section.open { */
.sources-section {
  width: 100%;
  background: #FBFBFD;
  border: 1px solid #F1F1F1;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sources-header {
  padding: 12px 18px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.2s ease;
  background: #F8F9FA;

}

.sources-header:hover {
  background-color: #f8fafc;
}

.sources-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sources-icon {
  width: 20px;
  height: 20px;
  color: #265BAA;
}

.sources-title {
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.sources-count-badge {
  /* background: linear-gradient(135deg, #3b82f6, #1d4ed8); */
  background: #265BAA;
  color: white;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.sources-toggle {
  width: 20px;
  height: 20px;
  color: #64748b;
  transition: transform 0.3s ease;
}

.sources-toggle.expanded {
  transform: rotate(180deg);
}

.sources-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.sources-content.expanded {
  height: 400px;
  max-height: 600px;
  overflow-y: auto;
}

.sources-grid {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.source-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s ease;
  position: relative;
}

.source-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.source-text {
  font-size: 14px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 12px;
}

.source-link-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.link-icon {
  width: 16px;
  height: 16px;
  color: #64748b;
  flex-shrink: 0;
}

.source-link {
  color: #3b82f6;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
  /* max-width: calc(100% - 80px); */
  width: 0;
}

.source-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.copy-btn {
  background: #e2e8f0;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
  font-size: 12px;
}

.copy-btn:hover {
  background: #cbd5e1;
  color: #475569;
}

.copy-btn.copied {
  background: #dcfce7;
  color: #16a34a;
}

.no-sources {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}

.no-sources-icon {
  width: 48px;
  height: 48px;
  color: #cbd5e1;
  margin: 0 auto 16px;
}

.match-percentage {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .sources-header {
      padding: 14px 16px;
  }

  .sources-title {
      font-size: 15px;
  }

  .sources-grid {
      padding: 16px;
      gap: 12px;
  }

  .source-card {
      padding: 14px;
  }

  .source-text {
      font-size: 13px;
      padding: 10px;
      margin-bottom: 10px;
  }

  .source-link {
      font-size: 12px;
  }

  .sources-count-badge {
      font-size: 11px;
      padding: 3px 8px;
  }
}

@media (max-width: 480px) {
  .sources-title-container {
      gap: 8px;
  }

  .sources-icon {
      width: 18px;
      height: 18px;
  }

  .sources-toggle {
      width: 18px;
      height: 18px;
  }

  .source-link-container {
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
  }

  .copy-btn {
      align-self: flex-end;
  }
}