/* The Tool Nest - Global Modern Styling */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --accent-color: #0d9488;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

/* Navbar */
.navbar-custom {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 0.85rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff !important;
}

.navbar-brand span.logo-icon {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.1rem;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: #cbd5e1 !important;
  transition: color 0.2s ease;
  padding: 0.5rem 0.85rem !important;
  border-radius: 6px;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.08);
}

/* Breadcrumbs */
.breadcrumb-nav {
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
}

.breadcrumb-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.875rem;
  gap: 0.5rem;
}

.breadcrumb-nav a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.breadcrumb-nav .separator {
  color: var(--text-muted);
}

.breadcrumb-nav .current {
  color: var(--text-muted);
  font-weight: 500;
}

/* Tool Container & Cards */
.tool-header {
  margin-bottom: 2rem;
}

.tool-header h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-dark);
  font-size: 2.1rem;
}

.tool-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background-color: var(--primary-light);
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.card-tool {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.card-tool:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.tool-workspace {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2.5rem;
}

/* Result Box */
.result-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
}

.result-box.highlight-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #bbf7d0;
}

.result-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #0369a1;
  margin-bottom: 0.5rem;
}

.result-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0c4a6e;
  word-break: break-word;
}

.result-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Quick Action Chips & Buttons */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.preset-chip {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: #334155;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.preset-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

.btn-swap {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-swap:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.btn-copy {
  background: white;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-copy:hover {
  background: #f8fafc;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Form Controls */
.form-label {
  font-weight: 600;
  font-size: 0.925rem;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 0.95rem;
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn-primary-custom {
  background-color: var(--primary-color);
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-primary-custom:hover {
  background-color: var(--primary-hover);
  color: white;
}

.btn-primary-custom:active {
  transform: scale(0.98);
}

/* Guide & Article Content */
.guide-section {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.25rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2.5rem;
}

.guide-section h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
}

.guide-section h3 {
  font-weight: 600;
  font-size: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.guide-section p, .guide-section li {
  color: #334155;
  line-height: 1.7;
  font-size: 1rem;
}

.reference-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.reference-table th {
  background-color: #f1f5f9;
  color: #1e293b;
  font-weight: 600;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.reference-table td {
  padding: 0.75rem 1rem;
  font-size: 0.925rem;
  border-bottom: 1px solid var(--border-color);
  color: #334155;
}

.reference-table tr:last-child td {
  border-bottom: none;
}

.reference-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.formula-card {
  background-color: #f8fafc;
  border-left: 4px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.formula-card code {
  color: #1e293b;
  font-weight: 600;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.4rem;
}

/* FAQ Section */
.faq-accordion .accordion-item {
  border: 1px solid var(--border-color);
  border-radius: 10px !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-accordion .accordion-button {
  font-weight: 600;
  color: var(--text-dark);
  background-color: #ffffff;
  padding: 1.1rem 1.25rem;
  font-size: 1rem;
}

.faq-accordion .accordion-button:not(.collapsed) {
  background-color: var(--primary-light);
  color: var(--primary-color);
  box-shadow: none;
}

.faq-accordion .accordion-body {
  color: #334155;
  line-height: 1.7;
  padding: 1.25rem;
  background: #ffffff;
}

/* Related Tools */
.related-tools-section {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.related-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #ffffff;
  padding: 1.25rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
  border-color: #cbd5e1;
  color: inherit;
}

.related-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

.related-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  flex-grow: 1;
}

.related-card .action-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Footer */
.footer-custom {
  background-color: #0f172a;
  color: #94a3b8;
  padding-top: 3.5rem;
  padding-bottom: 2rem;
  border-top: 1px solid #1e293b;
  font-size: 0.925rem;
}

.footer-custom h5 {
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.footer-custom ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-custom ul li {
  margin-bottom: 0.65rem;
}

.footer-custom a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-custom a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Toast */
.toast-feedback {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
  z-index: 9999;
  animation: slideUp 0.2s ease;
}

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