/* ==========================================================================
   Freelance Rate vs. Retainer Calculator - Custom Stylesheet
   Tailored for High-RPM Passive Monetization & Exceptional UI/UX
   ========================================================================== */

:root {
  --brand-primary: #059669; /* Emerald 600 */
  --brand-primary-light: #10b981; /* Emerald 500 */
  --brand-primary-dark: #047857; /* Emerald 700 */
  --brand-accent: #6366f1; /* Indigo 500 */
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

/* Custom Range Slider Track & Thumb */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--brand-primary);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
  cursor: grab;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.45);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--brand-primary);
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
  cursor: grab;
}

input[type="range"]:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 3px;
}

/* Clean numeric inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Semantic AdSense Placeholders */
.adsense-placeholder {
  background: repeating-linear-gradient(
    45deg,
    #f8fafc,
    #f8fafc 10px,
    #f1f5f9 10px,
    #f1f5f9 20px
  );
  border: 1.5px dashed #cbd5e1;
  transition: border-color 0.2s ease;
}

.adsense-placeholder:hover {
  border-color: #94a3b8;
}

/* Rate Health Diagnostic Glows */
.health-badge-good {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.health-badge-warning {
  background-color: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.health-badge-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Modal styling for Privacy / Terms / Embed */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

/* FAQ Details/Summary Accordion */
details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
details[open] summary svg {
  transform: rotate(180deg);
}

/* Mobile Navigation Drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(85vw, 340px);
  background-color: #ffffff;
  box-shadow: -4px 0 25px rgba(15, 23, 42, 0.15);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-nav-drawer.active {
  transform: translateX(0);
}

/* Enforce desktop suppression of mobile drawer */
@media (min-width: 768px) {
  .mobile-nav-drawer,
  .mobile-nav-backdrop,
  #mobileDrawer,
  #mobileDrawerBackdrop {
    display: none !important;
  }
}

/* Google AdSense Optimization & Zero-CLS Layout */
.adsense-slot {
  width: 100%;
  margin: 1.5rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  clear: both;
}

.adsense-card {
  width: 100%;
  max-width: 56rem;
  min-height: 90px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.adsbygoogle {
  display: block !important;
  margin: 0 auto;
  max-width: 100%;
}

/* ==========================================================================
   Dark Mode Overrides - High Contrast Typography & Surfaces
   ========================================================================== */
html.dark body {
  background-color: #020617;
  color: #f1f5f9;
}

/* Typography High Contrast */
html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4,
html.dark h5,
html.dark h6 {
  color: #f8fafc !important;
}

html.dark p {
  color: #cbd5e1 !important;
}

html.dark .text-slate-900 {
  color: #ffffff !important;
}

html.dark .text-slate-800 {
  color: #f1f5f9 !important;
}

html.dark .text-slate-700 {
  color: #e2e8f0 !important;
}

html.dark .text-slate-600 {
  color: #cbd5e1 !important;
}

html.dark .text-slate-500 {
  color: #94a3b8 !important;
}

html.dark .text-slate-400 {
  color: #94a3b8 !important;
}

html.dark strong {
  color: #ffffff !important;
}

/* Card Surfaces & Borders */
html.dark .bg-white {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html.dark .bg-slate-50 {
  background-color: #0b1329 !important;
}

html.dark .bg-slate-100 {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
}

html.dark .border-slate-50,
html.dark .border-slate-100,
html.dark .border-slate-200 {
  border-color: #1e293b !important;
}

html.dark .border-slate-300 {
  border-color: #334155 !important;
}

/* Inputs, Selects & Sliders */
html.dark input[type="text"],
html.dark input[type="number"],
html.dark select {
  background-color: #1e293b !important;
  color: #ffffff !important;
  border-color: #334155 !important;
}

html.dark input[type="text"]::placeholder,
html.dark input[type="number"]::placeholder {
  color: #64748b !important;
}

html.dark select option {
  background-color: #0f172a !important;
  color: #ffffff !important;
}

html.dark input[type="range"] {
  background: #334155;
}

/* Presets & Buttons */
html.dark [data-preset],
html.dark .preset-btn {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

html.dark [data-preset]:hover,
html.dark .preset-btn:hover {
  background-color: #334155 !important;
  color: #ffffff !important;
}

html.dark .adsense-card {
  background-color: #0f172a;
  border-color: #1e293b;
}

html.dark .adsense-placeholder {
  background: repeating-linear-gradient(
    45deg,
    #0f172a,
    #0f172a 10px,
    #1e293b 10px,
    #1e293b 20px
  );
  border-color: #334155;
}

html.dark .mobile-nav-drawer {
  background-color: #0f172a;
  color: #f8fafc;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.5);
}

/* Rate Health Badges in Dark Mode */
html.dark .health-badge-good {
  background-color: rgba(6, 95, 70, 0.25);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

html.dark .health-badge-warning {
  background-color: rgba(146, 64, 14, 0.25);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.4);
}

html.dark .health-badge-danger {
  background-color: rgba(153, 27, 27, 0.25);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Tables in Dark Mode */
html.dark table th {
  color: #94a3b8 !important;
  border-color: #1e293b !important;
}

html.dark table td {
  color: #e2e8f0 !important;
  border-color: #1e293b !important;
}

html.dark table tr:hover {
  background-color: rgba(30, 41, 59, 0.5) !important;
}

/* Modals */
html.dark .modal-overlay > div {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

/* Print Optimization */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    padding: 0 !important;
  }

  .no-print,
  .adsense-placeholder,
  aside[role="region"],
  button,
  .toast-notification,
  .modal-overlay,
  .mobile-nav-backdrop,
  .mobile-nav-drawer,
  #faqSection {
    display: none !important;
  }
}
