/* =========================================================
   fragCihan Tool System
   Apple-style interactive tools, dark-mode compatible.
   ========================================================= */

.fc-tool-section {
  padding: 4rem 1rem;
}

.fc-tool-shell {
  max-width: 80rem;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2.75rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.fc-tool-header {
  display: grid;
  gap: 1.5rem;
  padding: 2rem;
}

.fc-tool-kicker {
  display: inline-flex;
  width: fit-content;
  min-height: 2rem;
  align-items: center;
  border-radius: 999px;
  padding: 0 0.9rem;
  background: #f5f5f7;
  color: #0071e3;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.fc-tool-title {
  max-width: 12ch;
  margin: 1rem 0 0;
  color: #1d1d1f;
  font-size: clamp(2.2rem, 5.2vw, 4.8rem);
  line-height: 0.93;
  letter-spacing: -0.075em;
  font-weight: 850;
  text-wrap: balance;
}

.fc-tool-copy {
  max-width: 42rem;
  margin: 1.1rem 0 0;
  color: #6e6e73;
  font-size: 1rem;
  line-height: 1.75;
}

.fc-tool-body {
  display: grid;
  gap: 1rem;
  padding: 0 2rem 2rem;
}

.fc-tool-card {
  border-radius: 2rem;
  background: #f5f5f7;
  padding: 1.35rem;
}

.fc-tool-question {
  color: #1d1d1f;
  font-size: clamp(1.45rem, 3vw, 2.35rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
  font-weight: 800;
  text-wrap: balance;
}

.fc-tool-subcopy {
  margin-top: 0.75rem;
  color: #6e6e73;
  font-size: 0.95rem;
  line-height: 1.65;
}

.fc-tool-options {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.fc-tool-option,
.fc-tool-input,
.fc-tool-select {
  min-height: 3.15rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 1.25rem;
  background: #ffffff;
  color: #1d1d1f;
  padding: 0 1rem;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: left;
  transition:
    transform 550ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 550ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 550ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 550ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fc-tool-option {
  cursor: pointer;
}

.fc-tool-input,
.fc-tool-select {
  width: 100%;
}

.fc-tool-option:hover,
.fc-tool-option.is-selected {
  transform: translateY(-2px) scale(1.01);
  border-color: rgba(0, 113, 227, 0.25);
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 113, 227, 0.12);
}

.fc-tool-option.is-selected {
  color: #0071e3;
}

.fc-tool-grid {
  display: grid;
  gap: 1rem;
}

.fc-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.fc-tool-btn {
  display: inline-flex;
  min-height: 3.2rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0 1.35rem;
  font-size: 0.98rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 550ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 550ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fc-tool-btn:hover {
  transform: translateY(-2px) scale(1.015);
}

.fc-tool-btn-primary {
  background: #0071e3;
  color: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 113, 227, 0.22);
}

.fc-tool-btn-secondary {
  background: #ffffff;
  color: #1d1d1f;
}

.fc-tool-result {
  display: none;
  border-radius: 2rem;
  background: #1d1d1f;
  color: #ffffff;
  padding: 1.5rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

.fc-tool-result.is-visible {
  display: block;
  animation: fcToolResultIn 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

.fc-tool-result-kicker {
  color: #f2b759;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.fc-tool-result-title {
  margin-top: 0.75rem;
  color: #ffffff;
  font-size: clamp(1.65rem, 3.5vw, 2.9rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
  font-weight: 850;
  text-wrap: balance;
}

.fc-tool-result-copy {
  margin-top: 1rem;
  color: rgba(255,255,255,0.72);
  font-size: 1rem;
  line-height: 1.75;
}

.fc-tool-metrics {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.fc-tool-metric {
  border-radius: 1.35rem;
  background: rgba(255,255,255,0.08);
  padding: 1rem;
  border: 1px solid rgba(255,255,255,0.08);
}

.fc-tool-metric-label {
  color: rgba(255,255,255,0.48);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.fc-tool-metric-value {
  margin-top: 0.35rem;
  color: #ffffff;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-weight: 850;
}

.fc-tool-note {
  margin-top: 1rem;
  color: #86868b;
  font-size: 0.82rem;
  line-height: 1.6;
}

.fc-tool-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.fc-tool-mini-link {
  display: inline-flex;
  min-height: 2.65rem;
  align-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  color: #ffffff;
  padding: 0 1rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 750;
}

@media (min-width: 768px) {
  .fc-tool-header {
    grid-template-columns: 0.95fr 1.05fr;
    align-items: end;
    padding: 2.5rem;
  }

  .fc-tool-body {
    grid-template-columns: 1fr 1fr;
    padding: 0 2.5rem 2.5rem;
  }

  .fc-tool-options.fc-tool-options-2,
  .fc-tool-grid.fc-tool-grid-2,
  .fc-tool-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fc-tool-options.fc-tool-options-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fc-tool-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .fc-tool-section {
    padding: 3rem 1rem;
  }

  .fc-tool-shell {
    border-radius: 2rem;
  }

  .fc-tool-header,
  .fc-tool-body {
    padding: 1.25rem;
  }

  .fc-tool-title {
    max-width: 11ch;
  }

  .fc-tool-card,
  .fc-tool-result {
    border-radius: 1.55rem;
    padding: 1.15rem;
  }

  .fc-tool-btn,
  .fc-tool-option {
    width: 100%;
  }
}

/* Dark mode */
html[data-theme="dark"] .fc-tool-shell {
  background: rgba(17, 18, 20, 0.88) !important;
  border-color: rgba(255,255,255,0.10) !important;
  box-shadow: 0 30px 90px rgba(0,0,0,0.42) !important;
}

html[data-theme="dark"] .fc-tool-card,
html[data-theme="dark"] .fc-tool-kicker {
  background: rgba(255,255,255,0.075) !important;
}

html[data-theme="dark"] .fc-tool-title,
html[data-theme="dark"] .fc-tool-question {
  color: #f5f5f7 !important;
}

html[data-theme="dark"] .fc-tool-copy,
html[data-theme="dark"] .fc-tool-subcopy,
html[data-theme="dark"] .fc-tool-note {
  color: #a1a1a6 !important;
}

html[data-theme="dark"] .fc-tool-option,
html[data-theme="dark"] .fc-tool-input,
html[data-theme="dark"] .fc-tool-select,
html[data-theme="dark"] .fc-tool-btn-secondary {
  background: rgba(255,255,255,0.075) !important;
  color: #f5f5f7 !important;
  border-color: rgba(255,255,255,0.10) !important;
}

html[data-theme="dark"] .fc-tool-option:hover,
html[data-theme="dark"] .fc-tool-option.is-selected {
  background: rgba(255,255,255,0.11) !important;
  border-color: rgba(41,151,255,0.32) !important;
  color: #2997ff !important;
}

html[data-theme="dark"] .fc-tool-result {
  background: #000000 !important;
  border: 1px solid rgba(255,255,255,0.10);
}
