/* -------------------------------------------------------------
 * LeafBrowser Tools - Modern SaaS UI Design System
 * ------------------------------------------------------------- */

.leaf-tool-wrapper {
  max-width: 980px;
  margin: 0 auto 3.5rem auto;
  font-family: var(--leaf-font, -apple-system, BlinkMacSystemFont, sans-serif);
  color: var(--leaf-slate, #334155);
}

/* Glassmorphism Card Container */
.leaf-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--leaf-radius-lg, 24px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.05), 0 0 1px 1px rgba(226, 232, 240, 0.6);
  padding: 2.25rem;
  margin-bottom: 2.5rem;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.leaf-card:hover {
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(16, 185, 129, 0.2);
  border-color: rgba(167, 243, 208, 0.8);
}

/* Segmented Control / Toolbar */
.leaf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.leaf-modes-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 9999px;
  gap: 3px;
  border: 1px solid #e2e8f0;
}

.leaf-mode-btn,
button.leaf-mode-btn {
  border: none !important;
  background: transparent !important;
  padding: 8px 18px !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  border-radius: 9999px !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  user-select: none !important;
}

.leaf-mode-btn:hover,
button.leaf-mode-btn:hover {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
}

.leaf-mode-btn.active,
button.leaf-mode-btn.active {
  background: #ffffff !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  color: var(--leaf-primary, #059669) !important;
  font-weight: 700 !important;
}

/* Buttons */
.leaf-btn,
button.leaf-btn,
a.leaf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1.2;
}

.leaf-btn:active,
button.leaf-btn:active {
  transform: scale(0.98);
}

.leaf-btn-primary,
button.leaf-btn-primary {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3) !important;
}

.leaf-btn-primary:hover,
button.leaf-btn-primary:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%) !important;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.4) !important;
  transform: translateY(-1px);
}

.leaf-btn-secondary,
button.leaf-btn-secondary {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

.leaf-btn-secondary:hover,
button.leaf-btn-secondary:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  transform: translateY(-1px);
}

.leaf-btn-pause,
button.leaf-btn-pause {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35) !important;
}

.leaf-btn-pause:hover,
button.leaf-btn-pause:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45) !important;
  transform: translateY(-1px);
}

.leaf-btn-outline,
button.leaf-btn-outline {
  background: rgba(16, 185, 129, 0.06) !important;
  color: var(--leaf-primary, #059669) !important;
  border: 1px solid #a7f3d0 !important;
}

.leaf-btn-outline:hover,
button.leaf-btn-outline:hover {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  transform: translateY(-1px);
}

.leaf-btn-danger,
button.leaf-btn-danger {
  background-color: #fef2f2 !important;
  color: #dc2626 !important;
  border-color: #fecaca !important;
}

.leaf-btn-danger:hover,
button.leaf-btn-danger:hover {
  background-color: #fee2e2;
}

/* Modern Form Controls */
.leaf-input, .leaf-select, .leaf-textarea {
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.leaf-input:focus, .leaf-select:focus, .leaf-textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  background-color: #ffffff;
}

/* Stat Cards Grid */
.leaf-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}

.leaf-stat-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.15rem 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.leaf-stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #38bdf8);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.leaf-stat-box:hover {
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -4px rgba(15, 23, 42, 0.06);
}

.leaf-stat-box:hover::before {
  opacity: 1;
}

.leaf-stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.leaf-stat-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-top: 6px;
}

/* Results Callout Box */
.leaf-result-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #a7f3d0;
  border-radius: 16px;
  padding: 1.75rem 2rem;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: 0 8px 20px -4px rgba(16, 185, 129, 0.12);
}

.leaf-result-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #065f46;
  margin-bottom: 6px;
}

.leaf-result-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #047857;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Educational Content & FAQ */
.leaf-tool-content {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #e2e8f0;
}

.leaf-tool-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.leaf-tool-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.leaf-tool-content p, .leaf-tool-content li {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #475569;
}

.leaf-tool-content ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.leaf-tool-content li {
  margin-bottom: 0.5rem;
}

/* Modern FAQ Item */
.leaf-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 1rem;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
  transition: all 0.2s ease;
}

.leaf-faq-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
}

.leaf-faq-question,
button.leaf-faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: transparent !important;
  border: none !important;
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a !important;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.leaf-faq-question:hover,
button.leaf-faq-question:hover {
  background: #f8fafc !important;
  color: var(--leaf-primary, #059669) !important;
}

.leaf-faq-answer {
  padding: 0 1.5rem 1.25rem 1.5rem;
  color: #475569;
  font-size: 0.98rem;
  line-height: 1.7;
  display: none;
}

.leaf-faq-item.active {
  border-color: #a7f3d0;
  box-shadow: 0 6px 16px -2px rgba(16, 185, 129, 0.08);
}

.leaf-faq-item.active .leaf-faq-answer {
  display: block;
}

.leaf-faq-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.leaf-faq-item.active .leaf-faq-icon {
  transform: rotate(180deg);
  background: #ecfdf5;
  color: #059669;
}

/* Related Tools Banner */
.leaf-related-tools {
  margin-top: 3.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.75rem 2.25rem;
}

.leaf-related-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.25rem;
}

.leaf-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.leaf-related-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.leaf-related-pill:hover {
  background: #ecfdf5;
  border-color: #10b981;
  color: #059669;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}
