/* Shared styles for all tools */
:root {
  --bg: #fafafa;
  --text: #222222;
  --primary: #005286;
  --secondary: #e4f0f7;
  --accent: #0084a8;
}

::selection {
  color: white;
  background: salmon;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 80px;
}

.firm-name {
  color: var(--primary);
  font-family: "Cinzel", serif;
  letter-spacing: 0.04em;
}

.brand-serif {
  font-family: "Cinzel", serif;
  letter-spacing: 0.04em;
}

.serif {
  font-family: "Cinzel", serif;
  letter-spacing: 0.02em;
}

.highlight {
  color: var(--accent);
  font-weight: 600;
}

.glass {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
  .glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(255, 255, 255, 0.95);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  will-change: transform, opacity;
}

.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

.link-underline {
  position: relative;
}

.link-underline:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.25s ease;
}

.link-underline:hover:after {
  width: 100%;
}

.chinmay-link {
  background: linear-gradient(90deg, #a855f7, #ec4899, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  background-size: 200% auto;
  transition: background-position 0.5s ease;
}

.chinmay-link:hover {
  background-position: right center;
}

/* Tool specific styles */
.tool-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.calculator-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 132, 168, 0.1);
}

.input-field:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--secondary);
}

.result-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 2rem;
  border-radius: 1rem;
  margin-top: 2rem;
  box-shadow: 0 10px 15px -3px rgba(0, 82, 134, 0.3);
}

.result-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.result-label {
  font-size: 0.875rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-box {
  background: var(--secondary);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.info-box-icon {
  color: var(--accent);
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.step-box {
  background: white;
  border: 2px solid var(--secondary);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s;
}

.step-box:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 82, 134, 0.1);
}

.step-number {
  background: var(--primary);
  color: white;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--secondary);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 82, 134, 0.15);
  background: white;
  color: var(--primary);
  border-radius: 9999px;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.filter-chip:hover,
.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.tool-card-hidden {
  display: none !important;
}

.tool-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tool-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 132, 168, 0.12);
  color: var(--primary);
  border-radius: 9999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.tool-status-badge.muted {
  background: rgba(0, 0, 0, 0.06);
  color: #475569;
}

.quick-pick-card {
  display: block;
  text-decoration: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.95) 0%, rgba(228, 240, 247, 0.8) 100%);
  border: 1px solid rgba(0, 82, 134, 0.12);
  border-radius: 1rem;
  padding: 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-pick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 82, 134, 0.35);
  box-shadow: 0 14px 24px rgba(0, 60, 100, 0.14);
}

.quick-pick-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(0, 132, 168, 0.12);
  color: var(--primary);
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quick-pick-title {
  margin-top: 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.quick-pick-copy {
  margin-top: 0.55rem;
  margin-bottom: 0.85rem;
  color: #445a6a;
  font-size: 0.92rem;
  line-height: 1.5;
}

.quick-pick-link {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
}

.trust-note {
  margin-top: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(0, 82, 134, 0.12);
  background: rgba(228, 240, 247, 0.7);
  color: #33546a;
  font-size: 0.83rem;
  line-height: 1.45;
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading state */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border: 2px solid var(--primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive table */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.data-table th {
  background: var(--secondary);
  color: var(--primary);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
}

.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.data-table tr:hover {
  background: var(--secondary);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #6b7280;
  transition: color 0.2s;
}

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

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  .glass {
    background: white;
    border: 1px solid #e5e7eb;
  }
}

/* WhatsApp button */
a[href^="https://wa.me"] {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: white !important;
  transition: all 0.3s ease;
}
a[href^="https://wa.me"]:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

/* Dropdown navigation */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 82, 134, 0.15);
  border: 1px solid rgba(0, 82, 134, 0.08);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform: translateX(-50%) translateY(-4px);
  z-index: 999;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
.nav-dropdown-trigger .chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.nav-dropdown:hover .nav-dropdown-trigger .chevron {
  transform: rotate(180deg);
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  background: var(--secondary);
  color: var(--primary);
}
.nav-dropdown-item.active-sub {
  color: var(--primary);
  font-weight: 600;
  background: var(--secondary);
}
.nav-dropdown-divider {
  height: 1px;
  background: rgba(0, 82, 134, 0.08);
  margin: 4px 8px;
}
/* Mobile accordion for dropdown */
.mobile-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.mobile-dropdown-content {
  display: none;
  padding-left: 1rem;
  margin-top: 0.5rem;
  border-left: 2px solid var(--secondary);
}
.mobile-dropdown-content.open {
  display: block;
}
.mobile-dropdown-content a {
  display: block;
  padding: 6px 0;
  font-size: 0.875rem;
  color: #4B5563;
  text-decoration: none;
}
.mobile-dropdown-content a:hover {
  color: var(--primary);
}

/* Override tel/mailto colour in dark CTA bands */
.cta-dark a[href^="tel:"],
.cta-dark a[href^="mailto:"] {
  color: white !important;
  font-weight: 600;
}
.cta-dark a[href^="tel:"]:hover,
.cta-dark a[href^="mailto:"]:hover {
  color: rgba(255,255,255,0.82) !important;
}
