@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

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

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

.container {
  animation: fadeInDown 0.6s ease-out forwards;
}

#support-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--bg-mantle);
  color: var(--text-secondary);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px var(--shadow-color);
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 9999;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

#support-toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#support-toast p {
  margin: 0;
}

#support-toast a {
  color: var(--button-text-color);
  background-color: var(--accent-tertiary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

#support-toast a:hover {
  background-color: var(--accent-tertiary-hover);
}

#support-toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 5px;
}

#support-toast-close:hover {
  color: var(--text-primary);
}

:root {
  --ctp-rosewater: #f5e0dc;
  --ctp-flamingo: #f2cdcd;
  --ctp-pink: #f5c2e7;
  --ctp-mauve: #cba6f7;
  --ctp-red: #f38ba8;
  --ctp-maroon: #eba0ac;
  --ctp-peach: #fab387;
  --ctp-yellow: #f9e2af;
  --ctp-green: #a6e3a1;
  --ctp-teal: #94e2d5;
  --ctp-sky: #89dceb;
  --ctp-sapphire: #74c7ec;
  --ctp-blue: #89b4fa;
  --ctp-lavender: #b4befe;
  --ctp-text: #cdd6f4;
  --ctp-subtext1: #bac2de;
  --ctp-subtext0: #a6adc8;
  --ctp-overlay2: #9399b2;
  --ctp-overlay1: #7f849c;
  --ctp-overlay0: #6c7086;
  --ctp-surface2: #585b70;
  --ctp-surface1: #45475a;
  --ctp-surface0: #313244;
  --ctp-base: #1e1e2e;
  --ctp-mantle: #181825;
  --ctp-crust: #11111b;
  --rp-base: #191724;
  --rp-surface: #1f1d2e;
  --rp-overlay: #26233a;
  --rp-muted: #6e6a86;
  --rp-subtle: #908caa;
  --rp-text: #e0def4;
  --rp-love: #eb6f92;
  --rp-gold: #f6c177;
  --rp-rose: #ebbcba;
  --rp-pine: #31748f;
  --rp-foam: #9ccfd8;
  --rp-iris: #c4a7e7;
  --rp-highlightLow: #21202e;
  --rp-highlightMed: #403d52;
  --rp-highlightHigh: #524f67;
  --bg-base: var(--ctp-base);
  --bg-mantle: var(--ctp-mantle);
  --bg-crust: var(--ctp-crust);
  --bg-surface: var(--ctp-surface0);
  --bg-surface-hover: var(--ctp-surface1);
  --text-primary: var(--ctp-text);
  --text-secondary: var(--ctp-subtext1);
  --text-tertiary: var(--ctp-subtext0);
  --text-placeholder: var(--ctp-overlay1);
  --border-color: var(--ctp-surface1);
  --border-color-strong: var(--ctp-surface2);
  --accent-primary: var(--rp-iris);
  --accent-primary-hover: var(--rp-rose);
  --accent-secondary: var(--rp-pine);
  --accent-secondary-hover: var(--rp-foam);
  --accent-tertiary: var(--ctp-sky);
  --accent-tertiary-hover: var(--ctp-sapphire);
  --text-highlight: var(--rp-gold);
  --error-color: var(--rp-love);
  --warning-color: var(--ctp-yellow);
  --success-color: var(--ctp-green);
  --info-color: var(--ctp-blue);
  --button-text-color: var(--rp-base);
  --input-focus-color: var(--accent-primary);
  --shadow-color: rgba(0, 0, 0, 0.2);
  --shadow-color-light: rgba(0, 0, 0, 0.1);
  --modal-bg: rgba(17, 17, 27, 0.8);
}

.light-theme {
  --ctp-rosewater: #dc8a78;
  --ctp-flamingo: #dd7878;
  --ctp-pink: #ea76cb;
  --ctp-mauve: #8839ef;
  --ctp-red: #d20f39;
  --ctp-maroon: #e64553;
  --ctp-peach: #fe640b;
  --ctp-yellow: #df8e1d;
  --ctp-green: #40a02b;
  --ctp-teal: #179299;
  --ctp-sky: #04a5e5;
  --ctp-sapphire: #209fb5;
  --ctp-blue: #1e66f5;
  --ctp-lavender: #7287fd;
  --ctp-text: #4c4f69;
  --ctp-subtext1: #5c5f77;
  --ctp-subtext0: #6c6f85;
  --ctp-overlay2: #7c7f93;
  --ctp-overlay1: #8c8fa1;
  --ctp-overlay0: #9ca0b0;
  --ctp-surface2: #acb0be;
  --ctp-surface1: #bcc0cc;
  --ctp-surface0: #ccd0da;
  --ctp-base: #eff1f5;
  --ctp-mantle: #e6e9ef;
  --ctp-crust: #dce0e8;
  --rp-base: #faf4ed;
  --rp-surface: #fffaf3;
  --rp-overlay: #f2e9e1;
  --rp-muted: #9893a5;
  --rp-subtle: #797593;
  --rp-text: #575279;
  --rp-love: #b4637a;
  --rp-gold: #ea9d34;
  --rp-rose: #d7827e;
  --rp-pine: #286983;
  --rp-foam: #56949f;
  --rp-iris: #907aa9;
  --rp-highlightLow: #f4ede8;
  --rp-highlightMed: #dfdad9;
  --rp-highlightHigh: #cecacd;
  --bg-base: var(--ctp-base);
  --bg-mantle: var(--ctp-mantle);
  --bg-crust: var(--ctp-crust);
  --bg-surface: var(--ctp-surface0);
  --bg-surface-hover: var(--ctp-surface1);
  --text-primary: var(--ctp-text);
  --text-secondary: var(--ctp-subtext1);
  --text-tertiary: var(--ctp-subtext0);
  --text-placeholder: var(--ctp-overlay1);
  --border-color: var(--ctp-surface1);
  --border-color-strong: var(--ctp-surface2);
  --accent-primary: var(--rp-iris);
  --accent-primary-hover: var(--rp-rose);
  --accent-secondary: var(--rp-pine);
  --accent-secondary-hover: var(--rp-foam);
  --accent-tertiary: var(--ctp-sky);
  --accent-tertiary-hover: var(--ctp-sapphire);
  --text-highlight: var(--rp-gold);
  --error-color: var(--rp-love);
  --warning-color: var(--ctp-yellow);
  --success-color: var(--ctp-green);
  --info-color: var(--ctp-blue);
  --button-text-color: var(--rp-base);
  --input-focus-color: var(--accent-primary);
  --shadow-color: rgba(108, 112, 134, 0.15);
  --shadow-color-light: rgba(108, 112, 134, 0.1);
  --modal-bg: rgba(230, 233, 239, 0.8);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Noto Sans JP', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.25rem;
  margin: 0;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  width: 100%;
  max-width: 650px;
  margin: auto;
  padding: clamp(1.25rem, 4vw, 1.875rem);
  border-radius: 1.125rem;
  background-color: var(--bg-mantle);
  box-shadow: 0 0.5rem 1.5625rem var(--shadow-color);
  transition: background-color 0.3s ease;
}

.source-shop-btn {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  background: transparent;
  margin-top: 8px;
}

.source-shop-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--bg-surface);
}

.promo-banner {
  width: 100%;
  max-width: 650px;
  margin: 0 auto 1rem auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-tertiary);
  border-radius: 0.5rem;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  position: relative;
  transition: border-color 0.2s ease;
}

.promo-banner:hover {
  border-left-color: var(--accent-primary);
}

.promo-banner::before {
  display: none;
}

.promo-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.promo-icon {
  font-size: 1rem;
  animation: none;
}

.promo-text {
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  font-weight: 400;
}

.promo-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.promo-buttons {
  display: flex;
  gap: 0.5rem;
}

.promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.promo-btn-api {
  background: var(--accent-tertiary);
  color: var(--button-text-color);
}

.promo-btn-api:hover {
  background: var(--accent-tertiary-hover);
}

.promo-btn-source {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.promo-btn-source:hover {
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.promo-close {
  position: absolute;
  top: 50%;
  left: 0.5rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.promo-close:hover {
  color: var(--text-primary);
}

@media (max-width: 680px) {
  .promo-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  .promo-close {
    top: 0.5rem;
    right: 0.5rem;
    transform: none;
  }
}

.source-shop-btn i {
  margin-right: 6px;
}

.menu {
  margin-bottom: 1.5625rem;
  border-bottom: none;
  padding-bottom: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  overflow-x: hidden;
}

.menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  background-color: var(--bg-surface);
  display: inline-block;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.menu a:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-hover);
  box-shadow: 0 0.125rem 0.3125rem var(--shadow-color-light);
}

.menu a.active {
  color: var(--button-text-color);
  background-color: var(--accent-primary);
  border-bottom: none;
  box-shadow: 0 0.1875rem 0.5rem var(--shadow-color);
}

.header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  text-align: center;
}

.header-icon {
  width: clamp(2rem, 6vw, 2.5rem);
  height: clamp(2rem, 6vw, 2.5rem);
  margin-right: 0.75rem;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  /* Added from tiktok-video-downloader styles just in case */
}

h1 {
  color: var(--accent-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 700;
  margin: 0;
}

.tool-description {
  text-align: center;
  margin-bottom: 1.875rem;
}

.tool-description h2 {
  color: var(--text-secondary);
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 400;
  margin: 0 0 0.5rem 0;
}

.api-link {
  color: var(--text-tertiary);
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  margin-top: 0.625rem;
}

.api-link a {
  color: var(--accent-tertiary);
  text-decoration: none;
}

.api-link a:hover {
  color: var(--accent-tertiary-hover);
  text-decoration: underline;
}

.input-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 0.9375rem;
  width: 100%;
}

.input-group {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  position: relative;
  background-color: var(--bg-surface);
  border-radius: 0.75rem;
  border: 1.5px solid var(--border-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.input-group:focus-within {
  border-color: var(--input-focus-color);
  box-shadow: 0 0 0 3px rgba(var(--input-focus-color-rgb), 0.3);
}

.input-group .icon-prefix {
  position: absolute;
  left: 0.9375rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 1.1em;
  pointer-events: none;
}

.input-group input[type="text"] {
  flex-grow: 1;
  width: 100%;
  min-width: 0;
  padding: 0.875rem 0.9375rem 0.875rem 2.8125rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: clamp(0.875rem, 2vw, 1rem);
  outline: none;
}

.input-group input[type="text"]::placeholder {
  color: var(--text-placeholder);
  opacity: 1;
}

.paste-button {
  background-color: transparent;
  color: var(--text-tertiary);
  border: none;
  border-left: 1.5px solid var(--border-color);
  padding: 0 0.9375rem;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  align-self: stretch;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.paste-button:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-secondary);
}

#fetchButton {
  background-color: var(--accent-primary);
  color: var(--button-text-color);
  border: none;
  padding: 0.875rem 1.5625rem;
  cursor: pointer;
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 500;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

#fetchButton:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
}

#fetchButton:active {
  transform: translateY(0);
}

#fetchButton:disabled {
  background-color: var(--ctp-overlay0);
  cursor: not-allowed;
  transform: none;
}

#turnstile-container {
  display: flex;
  justify-content: center;
  margin-bottom: 0.9375rem;
  width: 100%;
}

.cooldown-timer {
  margin-top: 0.3125rem;
  margin-bottom: 0.9375rem;
  color: var(--warning-color);
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  font-weight: 500;
  text-align: center;
}

.results-area {
  background-color: var(--bg-crust);
  border-radius: 0.9375rem;
  padding: 1.5625rem;
  margin-top: 1.5625rem;
  min-height: 7.5rem;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
  border: 1px solid var(--border-color);
}

#loadingIndicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  color: var(--text-secondary);
  transition: opacity 0.3s ease;
}

#loadingIndicator span {
  font-size: 0.9em;
}

#initialMessage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 4.375rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: clamp(0.875rem, 2vw, 1rem);
}

#errorMessage {
  text-align: center;
}

#errorText {
  font-weight: 500;
  margin-top: -0.625rem;
}

#resultsContent {
  opacity: 0;
  transition: opacity 0.5s ease 0.1s;
  visibility: hidden;
}

#resultsContent.visible {
  opacity: 1;
  visibility: visible;
}

.results-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5625rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.3125rem;
}

#avatar {
  width: clamp(5.625rem, 20vw, 7.5rem);
  height: clamp(5.625rem, 20vw, 7.5rem);
  border-radius: 50%;
  border: 3px solid var(--border-color-strong);
  box-shadow: 0 0.25rem 0.625rem var(--shadow-color-light);
  margin-bottom: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  object-fit: cover;
  display: block;
}

#avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0.375rem 0.9375rem var(--shadow-color);
}

#downloadButton,
#viewStoriesButton {
  background-color: var(--accent-secondary);
  color: var(--button-text-color);
  border: none;
  padding: 0.5rem 0.9375rem;
  border-radius: 0.625rem;
  cursor: pointer;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  justify-content: center;
  text-decoration: none;
  line-height: 1.2;
  width: 100%;
  max-width: 12.5rem;
}

#downloadButton:hover,
#viewStoriesButton:hover {
  background-color: var(--accent-secondary-hover);
  transform: translateY(-1px);
}

#downloadButton i,
#viewStoriesButton i {
  font-size: 0.9em;
}

.results-card {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.results-header {
  padding-bottom: 0;
  margin-bottom: 0;
}

.results-header #resultNickname {
  color: var(--text-highlight);
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 700;
  margin: 0 0 0.1875rem 0;
  word-break: break-word;
}

.results-header #resultUsername {
  color: var(--text-secondary);
  font-size: clamp(0.875rem, 2vw, 1rem);
  margin: 0 0 0.5rem 0;
}

.results-header #resultRegion {
  color: var(--text-secondary);
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.results-bio {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background-color: var(--bg-surface);
  padding: 0.75rem 0.9375rem;
  border-radius: 0.5rem;
}

.bio-link {
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  color: var(--accent-tertiary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  transition: color 0.2s ease;
}

.bio-link:hover {
  color: var(--accent-tertiary-hover);
  text-decoration: underline;
}

.bio-link i {
  font-size: 0.9em;
}

#resultLanguageP {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: var(--text-secondary);
  margin: -0.625rem 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#resultLanguageP i {
  color: var(--text-tertiary);
  width: 1rem;
  text-align: center;
}

#resultLanguageP strong {
  color: var(--text-primary);
  font-weight: 500;
}

.results-stats h4,
.results-details h4 {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03125rem;
  margin: 0 0 0.625rem 0;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3125rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
}

.stat-item {
  background-color: var(--bg-surface);
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 4.375rem;
}

.stat-item .stat-value {
  display: block;
  font-weight: 700;
  color: var(--accent-primary);
  font-size: clamp(1rem, 3vw, 1.2rem);
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: normal;
  min-width: 0;
}

.stat-item .stat-label {
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
}

.stat-item .stat-label i {
  font-size: 0.9em;
  color: var(--text-tertiary);
}

.results-details {
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  color: var(--text-secondary);
}

.results-details p {
  margin: 0.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.results-details i {
  color: var(--text-tertiary);
  width: 1rem;
  text-align: center;
}

.results-details strong {
  color: var(--text-primary);
  margin-left: 0.25rem;
  font-weight: 500;
}

.result-list {
  background-color: var(--bg-surface);
  border-radius: 0.5rem;
  padding: 0.9375rem;
  margin-top: 1.25rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding: 0.625rem 0;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--text-secondary);
}

.result-value {
  font-weight: 700;
  color: var(--text-primary);
}

#showFollowingBtn {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: 0.625rem;
  cursor: pointer;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  width: 100%;
  margin-top: 1.25rem;
  transition: all 0.2s ease;
}

#showFollowingBtn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}

.faq-section {
  margin-top: 2.1875rem;
  text-align: left;
  padding: 1.25rem;
  background-color: var(--bg-crust);
  border-radius: 0.9375rem;
  border: 1px solid var(--border-color);
}

.faq-section h2 {
  color: var(--accent-secondary);
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  margin: 0 0 0.9375rem 0;
  font-weight: 700;
}

.faq-section ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.faq-section li {
  margin: 0.75rem 0;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  align-items: start;
  gap: 0.625rem;
}

.faq-section li::before {
  content: "\f05a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--accent-secondary);
  font-size: 0.9em;
  padding-top: 0.125rem;
}

.faq-section strong {
  color: var(--text-primary);
  font-weight: 500;
}

.feedback-section {
  margin-top: 2.1875rem;
  text-align: left;
  padding: 1.25rem;
  background-color: var(--bg-crust);
  border-radius: 0.9375rem;
  border: 1px solid var(--border-color);
}

.feedback-section h2 {
  color: var(--accent-primary);
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  margin: 0 0 0.9375rem 0;
  font-weight: 700;
}

.feedback-section p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

#feedbackMessage {
  width: 100%;
  min-height: 7.5rem;
  max-height: 18.75rem;
  padding: 0.75rem 0.9375rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.875rem, 2vw, 1rem);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
  outline: none;
  box-shadow: 0 0.125rem 0.3125rem var(--shadow-color-light);
}

#feedbackMessage::placeholder {
  color: var(--text-placeholder);
}

#feedbackMessage:focus {
  border-color: var(--input-focus-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-focus-color) 30%, transparent);
}

.feedback-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.9375rem;
  flex-wrap: wrap;
  gap: 0.625rem;
}

#charCount {
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  color: var(--text-secondary);
  margin: 0;
}

#submitFeedbackBtn {
  background-color: var(--accent-primary);
  color: var(--button-text-color);
  border: none;
  padding: 0.75rem 1.5625rem;
  cursor: pointer;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  font-weight: 500;
  border-radius: 0.75rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
  flex-shrink: 0;
}

#submitFeedbackBtn:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
}

#submitFeedbackBtn:active {
  transform: translateY(0);
}

#submitFeedbackBtn:disabled {
  background-color: var(--ctp-overlay0);
  cursor: not-allowed;
  transform: none;
}

.feedback-response {
  margin-top: 0.9375rem;
  padding: 0.75rem 0.9375rem;
  border-radius: 0.625rem;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  font-weight: 500;
  text-align: center;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feedback-response.success {
  background-color: color-mix(in srgb, var(--success-color) 15%, transparent);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.feedback-response.error {
  background-color: color-mix(in srgb, var(--error-color) 15%, transparent);
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

.credits {
  margin-top: 2.5rem;
  color: var(--text-tertiary);
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  text-align: center;
  line-height: 1.6;
}

.credits a {
  color: var(--accent-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.credits a:hover {
  color: var(--accent-tertiary-hover);
  text-decoration: underline;
}

.credits span {
  color: var(--error-color);
}

#kofi-widget-overlay {
  z-index: 10001 !important;
}

iframe[id^='kofiframe'] {
  border-radius: 0.625rem !important;
}

#themeToggle {
  position: fixed;
  top: 0.9375rem;
  right: 0.9375rem;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  z-index: 100;
}

#themeToggle:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  box-shadow: 0 0.125rem 0.3125rem var(--shadow-color-light);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--modal-bg);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.3s ease;
}

.toast-icon {
  color: var(--accent-primary);
  font-size: 1.6rem;
  animation: catWave 2.5s ease-in-out infinite;
}

@keyframes catWave {

  0%,
  100% {
    transform: rotate(0deg);
  }

  10% {
    transform: rotate(14deg);
  }

  20% {
    transform: rotate(-8deg);
  }

  30% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(10deg);
  }

  60% {
    transform: rotate(0deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  margin: 10% auto;
  display: block;
  width: 90%;
  max-width: 37.5rem;
  border-radius: 0.9375rem;
  animation: scaleUp 0.3s ease;
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

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

.close {
  position: absolute;
  top: 1.25rem;
  right: 2.1875rem;
  color: var(--bg-base);
  font-size: 2.8125rem;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  text-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.4);
}

.close:hover,
.close:focus {
  color: var(--text-secondary);
  text-decoration: none;
}

.modal-content-following {
  background-color: var(--bg-mantle);
  margin: 5% auto;
  padding: 1.5625rem;
  border-radius: 0.9375rem;
  max-width: 34.375rem;
  max-height: 85vh;
  overflow-y: auto;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 0.5rem 1.5625rem var(--shadow-color);
  animation: scaleUp 0.3s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--ctp-surface2) var(--bg-mantle);
}

.modal-content-following::-webkit-scrollbar {
  width: 0.5rem;
}

.modal-content-following::-webkit-scrollbar-track {
  background: var(--bg-mantle);
  border-radius: 0.25rem;
}

.modal-content-following::-webkit-scrollbar-thumb {
  background-color: var(--ctp-surface2);
  border-radius: 0.25rem;
  border: 2px solid var(--bg-mantle);
}

.modal-content-following::-webkit-scrollbar-thumb:hover {
  background-color: var(--ctp-overlay0);
}

.following-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 0.3125rem 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
  cursor: default;
}

.following-item:last-child {
  border-bottom: none;
}

.following-item:hover {
  background-color: var(--bg-surface);
}

.following-avatar {
  width: 2.8125rem;
  height: 2.8125rem;
  border-radius: 50%;
  margin-right: 0.9375rem;
  object-fit: cover;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.following-info {
  flex: 1;
  min-width: 0;
}

.following-username {
  font-weight: 500;
  color: var(--info-color);
  word-break: break-all;
  margin-bottom: 0.1875rem;
  display: block;
  font-size: clamp(0.85rem, 2vw, 0.95em);
}

.following-bio {
  font-size: clamp(0.75rem, 2vw, 0.85em);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.3;
}

.close-following {
  color: var(--text-tertiary);
  float: none;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 0.9375rem;
  right: 1.25rem;
  line-height: 1;
}

.close-following:hover {
  color: var(--error-color);
}

#loadingFollowing,
#endOfFollowing,
#followingPrivate {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-secondary);
  font-size: clamp(0.8rem, 2vw, 0.9em);
}

#loadingFollowing .loader {
  width: 1.875rem;
  height: 1.875rem;
  border: 3px solid var(--ctp-surface2);
  border-bottom-color: var(--accent-primary);
  border-radius: 50%;
  display: inline-block;
  animation: rotation 1s linear infinite;
  margin-bottom: 0.3125rem;
  vertical-align: middle;
  margin-right: 0.5rem;
}

#followingPrivate {
  color: var(--warning-color);
  font-weight: 500;
}

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

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

@media (max-width: 680px) {
  #support-toast {
    left: 0.625rem;
    right: 0.625rem;
    bottom: 0.625rem;
    justify-content: space-between;
  }

  body {
    padding: 0.9375rem;
  }

  .container {
    padding: 1.25rem;
  }

  .menu {
    gap: 0.375rem;
  }

  .menu a {
    padding: 0.375rem 0.625rem;
  }

  .input-area {
    flex-direction: column;
  }

  #fetchButton {
    width: 100%;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 0.9375rem;
    text-align: center;
  }

  .avatar-section {
    padding-top: 0;
    align-items: center;
  }

  .avatar-section #downloadButton,
  .avatar-section #viewStoriesButton {
    width: auto;
    min-width: 9.375rem;
  }

  .results-card {
    text-align: center;
  }

  .results-header #resultRegion {
    justify-content: center;
  }

  #resultLanguageP {
    justify-content: center;
  }

  .results-details p {
    justify-content: center;
  }

  .stat-item {
    padding: 0.5rem 0.625rem;
  }

  #showFollowingBtn {
    align-self: center;
    width: 80%;
  }

  .modal-content {
    width: 95%;
    margin: 5% auto;
  }

  .modal-content-following {
    max-width: 95%;
    padding: 1.25rem;
  }

  .feedback-controls {
    flex-direction: column;
    align-items: stretch;
  }

  #submitFeedbackBtn {
    width: 100%;
  }
}

@media (max-width: 400px) {
  #support-toast p {
    font-size: 0.8rem;
  }

  .header-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.625rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  #avatar {
    width: 5.625rem;
    height: 5.625rem;
  }

  .following-item {
    padding: 0.625rem 0;
  }

  .following-avatar {
    width: 2.5rem;
    height: 2.5rem;
    margin-right: 0.625rem;
  }
}

/* Tooltip Styles */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-left: 5px;
  vertical-align: middle;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 220px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  text-align: center;
  border-radius: 8px;
  padding: 10px;
  position: absolute;
  z-index: 100;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 5px 15px var(--shadow-color);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: normal;
  pointer-events: none;
  line-height: 1.4;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--border-color) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip .tooltip-icon {
  color: var(--text-secondary);
  font-size: 0.9em;
  transition: color 0.2s ease;
}

.tooltip:hover .tooltip-icon {
  color: var(--accent-primary);
}