: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;
}

.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;
  width: 100%;
}

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

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

.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;
}

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

.stats-pills {
  display: flex;
  margin-top: 15px;
  width: 100%;
  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; /* allow shrinking and growing */
  max-width: 108px; /* crucial: allows flex item to shrink below content width */
  text-align: center; /* makes pills look balanced */
  white-space: nowrap; /* prevent wrapping text inside pill */
}

.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;
  align-items: center;
  position: relative;
}

.toggle-title::before {
  content: url("/assets/icons/toggle.svg");
  display: inline-block;
  position: absolute;
  top: -2px;
  transition: transform 0.3s ease;
}

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

.toggle-title-text {
  padding-left: 15px;
}

.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;
}

.info-language-detection {
  position: relative;
  margin: 7px 0;
}

.info-language-detection-mobile {
  display: flex;
  margin: 4px;
}

.info-language-detection-desktop {
  display: none;
  margin: 4px 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;
}

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

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

.char-counter {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 12px;
  color: #6b7280;
  background: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  z-index: 1;
  border: 1px solid #e5e7eb;
}

.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 */
  }

  .info-language-detection-mobile {
    display: none;
  }
  .info-language-detection-desktop {
    display: flex;
    align-items: center;
    margin: 8px 0;
  }

  .info-language-detection-text::before {
    content: url("/tools/ai-detector/svg/info.svg");
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
  }

  .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;
  }
}
