/* ============================================
   ElectricBillCalc.com - Main Stylesheet
   Theme: Deep Blue Electric / Modern American
   Primary: #2563eb | Accent: #1e40af
   Background: #f8fafc | Card: #ffffff
   Text: #1e293b | Muted: #64748b
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f8fafc;
  color: #1e293b;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #2563eb; text-decoration: none; transition: color 0.2s; }
a:hover { color: #1e40af; }
ul { list-style: none; }

/* === TYPOGRAPHY === */
h1 { font-size: 2.25rem; font-weight: 800; line-height: 1.2; color: #1e293b; }
h2 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; color: #1e293b; }
h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.4; color: #1e293b; }
h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: #1e293b; }
p { margin-bottom: 1rem; color: #475569; }
small { font-size: 0.875rem; color: #64748b; }

/* === CONTAINER === */
.container { max-width: 1200px; width: 92%; margin: 0 auto; }

/* === NAVIGATION === */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #2563eb !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.nav-logo:hover { color: #1e40af !important; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.nav-menu li a {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569 !important;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-menu li a:hover {
  background: #eff6ff;
  color: #2563eb !important;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #475569;
  padding: 0.5rem;
}

/* === HERO SECTION === */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #ffffff;
  padding: 3.5rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}
.hero h1 {
  color: #ffffff;
  font-size: 2.75rem;
  margin-bottom: 0.75rem;
}
.hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #ffffff;
  backdrop-filter: blur(4px);
  margin-bottom: 1rem;
}

/* === SECTION STYLES === */
.section { padding: 3rem 0; }
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 { margin-bottom: 0.5rem; }
.section-title p { max-width: 640px; margin: 0 auto; color: #64748b; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  line-height: 1.4;
}
.btn-primary {
  background: #2563eb;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(37,99,235,0.25);
}
.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37,99,235,0.35);
}
.btn-secondary {
  background: #ffffff;
  color: #2563eb !important;
  border: 2px solid #2563eb;
}
.btn-secondary:hover {
  background: #eff6ff;
  transform: translateY(-2px);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; }

/* === TABS === */
.tabs { margin: 1.5rem 0; }
.tab-nav {
  display: flex;
  gap: 0.25rem;
  background: #e2e8f0;
  padding: 0.35rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}
.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
}
.tab-btn.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.tab-btn:hover:not(.active) { color: #1e293b; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === CALCULATOR BOX (MANDATORY WRAPPER) === */
.calculator-box {
  padding: 2rem;
  border-radius: 12px;
  background: #ffffff;
  margin: 2rem 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
}

/* === FORM STYLES === */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.4rem;
}
.form-group select,
.form-group input[type="number"],
.form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #1e293b;
  transition: border-color 0.25s, box-shadow 0.25s;
  -webkit-appearance: none;
  appearance: none;
}
.form-group select:focus,
.form-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.calc-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 0.5rem;
}
.calc-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}
.calc-btn:active { transform: translateY(0); }

/* === RESULTS === */
.result-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #f0f9ff;
  border-radius: 12px;
  border-left: 4px solid #2563eb;
  display: none;
}
.result-box.show { display: block; }
.result-box h4 {
  color: #1e40af;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}
.result-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #e0f2fe;
  font-size: 0.95rem;
}
.result-item:last-child { border-bottom: none; }
.result-item .label { color: #475569; font-weight: 500; }
.result-item .value { font-weight: 700; color: #1e293b; }
.result-highlight {
  font-size: 2rem;
  font-weight: 800;
  color: #2563eb;
  text-align: center;
  padding: 1rem 0;
}
.result-note {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 0.5rem;
}

/* === TOOL CARDS GRID === */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.tool-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  border-color: #bfdbfe;
}
.tool-card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.tool-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.tool-card p {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
  flex: 1;
}
.tool-card .btn { align-self: flex-start; }

/* === ARTICLE / CONTENT STYLES === */
.content-article {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  line-height: 1.85;
}
.content-article p { margin-bottom: 1.25rem; }
.content-article h2 { margin-top: 2rem; margin-bottom: 1rem; }
.content-article h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; }
.content-article ul, .content-article ol { margin: 1rem 0; padding-left: 1.5rem; color: #475569; }
.content-article li { margin-bottom: 0.5rem; }
.content-article strong { color: #1e293b; }
.content-separator {
  text-align: center;
  color: #94a3b8;
  margin: 2rem 0;
  font-size: 1.2rem;
  letter-spacing: 0.5rem;
}

/* === FAQ === */
.faq-list { margin: 1.5rem 0; }
.faq-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-question {
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-question:hover { background: #f8fafc; }
.faq-question .faq-toggle {
  font-size: 1.25rem;
  color: #2563eb;
  transition: transform 0.3s;
  flex-shrink: 0;
  margin-left: 1rem;
}
.faq-item.open .faq-question .faq-toggle { transform: rotate(45deg); }
.faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.7;
  display: none;
}
.faq-item.open .faq-answer { display: block; }
.faq-more { text-align: center; margin-top: 1.5rem; }

/* === AUTHORITY LINKS === */
.authority-links {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin: 1.5rem 0;
}
.authority-links h3 { margin-bottom: 1rem; font-size: 1rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.authority-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1e293b;
  transition: all 0.2s;
}
.authority-links a:hover { background: #eff6ff; color: #2563eb; }

/* === AD BANNER === */
.ad-banner {
  text-align: center;
  padding: 1rem 0;
  min-height: 90px;
  overflow: hidden;
}
.ad-banner ins { display: block; margin: 0 auto; }

/* === ERROR PAGE === */
.error-page {
  text-align: center;
  padding: 4rem 0;
}
.error-icon { font-size: 4rem; margin-bottom: 1rem; }
.error-page h1 { font-size: 5rem; color: #2563eb; margin-bottom: 0.5rem; }
.error-page h2 { margin-bottom: 1rem; }
.error-page p { max-width: 500px; margin: 0 auto 1.5rem; }
.error-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* === PAGE CONTENT (generic content pages) === */
.page-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: 2.5rem 0;
  text-align: center;
}
.page-header h1 { color: #ffffff; }
.page-header p { color: rgba(255,255,255,0.8); max-width: 600px; margin: 0.5rem auto 0; }
.page-content { padding: 2.5rem 0; }

/* === RANKINGS TABLE === */
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.rank-table th {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.5rem;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
}
.rank-table th:last-child,
.rank-table td:last-child {
  text-align: right;
}
.rank-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.rank-table tr:nth-child(even) td {
  background: #f8fafc;
}
.rank-table tr:hover td {
  background: #eff6ff;
}
body.dark-mode .rank-table th {
  background: #334155;
  color: #94a3b8;
  border-bottom-color: #475569;
}
body.dark-mode .rank-table td {
  border-bottom-color: #334155;
}
body.dark-mode .rank-table tr:nth-child(even) td {
  background: #1e293b;
}
body.dark-mode .rank-table tr:hover td {
  background: #1e3a5f;
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
}
.rank-badge.rank-1 { background: #fef3c7; color: #b45309; }
.rank-badge.rank-2 { background: #f1f5f9; color: #64748b; }
.rank-badge.rank-3 { background: #fef2f2; color: #dc2626; }
body.dark-mode .rank-badge.rank-1 { background: #78350f; color: #fbbf24; }
body.dark-mode .rank-badge.rank-2 { background: #475569; color: #e2e8f0; }
body.dark-mode .rank-badge.rank-3 { background: #7f1d1d; color: #fca5a5; }
.rank-region {
  font-size: 0.8rem;
  color: #64748b;
}
.rank-table .rank-bill {
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

/* === RANKINGS WRAPPER (prevents overflow) === */
.rank-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === RANKINGS RESPONSIVE === */
@media (max-width: 768px) {
  .rank-table th, .rank-table td { padding: 0.5rem 0.35rem; }
  .rank-table { font-size: 0.8rem; }
  .rank-table th { font-size: 0.7rem; }
  .rank-region { display: none; }
}

.disclaimer-highlight {
  background: #fef2f2;
  border: 2px solid #fecaca;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  font-weight: 700;
  color: #991b1b;
  line-height: 1.7;
}

/* === FOOTER === */
.footer {
  background: #1e293b;
  color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-col h4 {
  color: #ffffff;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.footer-col p { color: #94a3b8; font-size: 0.875rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a {
  color: #94a3b8;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: #ffffff; }

.footer-related {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
}
.footer-related h4 {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.related-links a {
  color: #60a5fa;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  transition: all 0.2s;
}
.related-links a:hover { background: rgba(255,255,255,0.12); color: #93bbfc; }

.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  text-align: center;
}
.footer-bottom p { color: #64748b; font-size: 0.85rem; margin-bottom: 0.5rem; }
.disclaimer-text { max-width: 800px; margin: 0.75rem auto; font-size: 0.8rem; color: #94a3b8; }
.contact-email a { color: #60a5fa; }

/* === STATE COMPARISON === */
.compare-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* === CHART CONTAINER === */
.chart-container {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/*=== SVG ICON STYLES ===*/
.icon-electric { color: #2563eb; }
.icon-features { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; margin: 2rem 0; }
.icon-feature-item { text-align: center; padding: 1rem; }
.icon-feature-item .icon { font-size: 2.5rem; margin-bottom: 0.5rem; display: block; }
.icon-feature-item p { font-size: 0.9rem; color: #64748b; }

/* === BLOG LIST === */
.blog-list { display: grid; gap: 1.5rem; }
.blog-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
}
.blog-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.blog-card h3 { margin-bottom: 0.5rem; }
.blog-card h3 a { color: #1e293b; }
.blog-card h3 a:hover { color: #2563eb; }
.blog-card .meta { font-size: 0.85rem; color: #64748b; margin-bottom: 0.75rem; }
.blog-card p { font-size: 0.9rem; }

/* === CHART.JS RESPONSIVE === */
.chart-wrapper {
  position: relative;
  width: 100%;
  max-height: 400px;
}

/* === STATE INDEX LIST === */
.state-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.state-index-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}
.state-index-item:hover {
  border-color: #2563eb;
  background: #eff6ff;
}
.state-index-item .state-name { font-weight: 500; font-size: 0.9rem; }
.state-index-item .state-rate { font-weight: 700; color: #2563eb; font-size: 0.9rem; }

/* === RESPONSIVE === */
@media (max-width: 992px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 2.5rem 0; }
  .compare-columns { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 1rem 0;
    gap: 0.25rem;
  }
  .nav-menu.show { display: flex; }
  .nav-container { flex-wrap: wrap; }
  .nav-menu li a { display: block; padding: 0.75rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .tab-nav { flex-direction: column; }
  .hero-icon { font-size: 2.5rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { width: 94%; }
  .hero h1 { font-size: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .calculator-box { padding: 1.25rem; }
  .nav-logo { font-size: 1.1rem; }
  .related-links { justify-content: center; }
}

/* ============================================
   ENHANCED FEATURES
   ============================================ */

/* === BACK TO TOP (DEPRECATED - replaced by FAB) === */

/* === FLOATING ACTION BUTTON === */
.fab-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fab-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}
.fab-actions.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.fab-action {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  position: relative;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.fab-action:hover {
  transform: scale(1.1);
  box-shadow: 0 5px 16px rgba(0,0,0,0.25);
}
.fab-action .fab-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  background: #1e293b;
  color: #ffffff;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}
.fab-action .fab-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  margin-top: -5px;
  border: 5px solid transparent;
  border-left-color: #1e293b;
}
.fab-action:hover .fab-tooltip {
  opacity: 1;
  visibility: visible;
}
.fab-action.share-action {
  background: #2563eb;
  color: #ffffff;
}
.fab-action.print-action {
  background: #64748b;
  color: #ffffff;
}
.fab-action.top-action {
  background: #1e293b;
  color: #ffffff;
}
body.dark-mode .fab-action.share-action { background: #3b82f6; }
body.dark-mode .fab-action.print-action { background: #94a3b8; }
body.dark-mode .fab-action.top-action { background: #334155; }
body.dark-mode .fab-action .fab-tooltip { background: #334155; }
body.dark-mode .fab-action .fab-tooltip::after { border-left-color: #334155; }

.fab-main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  transition: all 0.3s ease;
  position: relative;
}
.fab-main:hover {
  background: #1d4ed8;
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(37,99,235,0.45);
}
.fab-main.open {
  background: #dc2626;
  box-shadow: 0 4px 16px rgba(220,38,38,0.35);
}
.fab-main.open:hover {
  background: #b91c1c;
  box-shadow: 0 6px 24px rgba(220,38,38,0.45);
}
body.dark-mode .fab-main { background: #3b82f6; }
body.dark-mode .fab-main:hover { background: #2563eb; }
body.dark-mode .fab-main.open { background: #ef4444; }
body.dark-mode .fab-main.open:hover { background: #dc2626; }

/* === SHARE BUTTONS (DEPRECATED - replaced by FAB) === */

/* === PRINT STYLES === */
@page {
  margin: 0.6in 0.5in;
}
@media print {
  .navbar, .footer, .ad-banner,
  .fab-container,
  .btn, .calc-btn, .nav-toggle, .authority-links, .footer-related,
  .tab-nav { display: none !important; }
  .hero { background: #fff !important; color: #000 !important; padding: 1rem 0 !important; }
  .hero h1 { color: #000 !important; font-size: 20pt !important; }
  .hero p { color: #333 !important; }
  .hero-icon, .hero-badge { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; line-height: 1.5; overflow-x: hidden; }
  .container { max-width: 100%; width: 100%; padding: 0 1rem; }
  .calculator-box { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  .result-box { display: block !important; border: 1px solid #2563eb; overflow: visible !important; }
  .result-box h4 { white-space: normal; word-wrap: break-word; }
  a { color: #000 !important; text-decoration: underline; }
  .page-header { background: #f0f0f0 !important; color: #000 !important; padding: 1rem 0 !important; }
  .page-header h1, .page-header p { color: #000 !important; }
  .chart-container { page-break-inside: avoid; max-height: none; overflow: hidden !important; max-width: 100%; }
  .chart-wrapper { max-height: none; max-width: 100%; overflow: hidden; }
  img, canvas, svg { max-width: 100% !important; height: auto !important; }
  .content-article { box-shadow: none; border: none; }
  .faq-item { page-break-inside: avoid; }
  .tool-card { page-break-inside: avoid; }
  h1, h2, h3 { page-break-after: avoid; }
  .copy-toast { display: none !important; }
}

/* === TOOLTIP HELP ICONS === */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #e2e8f0;
  color: #64748b;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  margin-left: 0.35rem;
  position: relative;
  transition: background 0.2s;
  vertical-align: middle;
  line-height: 18px;
}
.help-tip:hover {
  background: #2563eb;
  color: #ffffff;
}
.help-tip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 400;
  white-space: nowrap;
  max-width: 280px;
  white-space: normal;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  line-height: 1.4;
  pointer-events: none;
}
.help-tip .tooltip-text::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #1e293b;
}
.help-tip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.2s;
}

/* === RESULT HISTORY === */
.result-history {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: none;
}
.result-history.show { display: block; }
.result-history h5 {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.history-item {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.history-item:last-child { border-bottom: none; }
.history-item .h-date { color: #94a3b8; }
.history-item .h-value { font-weight: 600; color: #2563eb; }
.history-clear {
  font-size: 0.8rem;
  color: #ef4444;
  cursor: pointer;
  float: right;
}
.history-clear:hover { text-decoration: underline; }

/* === SAVED RESULT BADGE === */
.saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: #f0fdf4;
  color: #166534;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* === READING TIME === */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* === BREADCRUMBS === */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: #64748b;
}
.breadcrumbs a {
  color: #2563eb;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: #94a3b8; }
.breadcrumbs .current { color: #1e293b; font-weight: 500; }

/* === LOADING SPINNER === */
.spinner {
  display: none;
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1rem auto;
}
.spinner.show { display: block; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* === DARK MODE === */
body.dark-mode {
  background: #0f172a;
  color: #e2e8f0;
}
body.dark-mode .navbar { background: #1e293b; border-color: #334155; }
body.dark-mode .nav-menu li a { color: #94a3b8 !important; }
body.dark-mode .nav-menu li a:hover { background: #334155; color: #ffffff !important; }
body.dark-mode .hero { background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%); }
body.dark-mode .calculator-box { background: #1e293b; box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
body.dark-mode .content-article { background: #1e293b; }
body.dark-mode .content-article p { color: #cbd5e1; }
body.dark-mode .tool-card { background: #1e293b; border-color: #334155; }
body.dark-mode .tool-card p { color: #94a3b8; }
body.dark-mode .faq-item { background: #1e293b; border-color: #334155; }
body.dark-mode .faq-question { color: #e2e8f0; }
body.dark-mode .faq-question:hover { background: #334155; }
body.dark-mode .faq-answer { color: #cbd5e1; }
body.dark-mode .section-title p { color: #94a3b8; }
body.dark-mode .form-group label { color: #e2e8f0; }
body.dark-mode .form-group select,
body.dark-mode .form-group input { background: #334155; border-color: #475569; color: #e2e8f0; }
body.dark-mode .result-box { background: #1e3a5f; }
body.dark-mode .page-header { background: linear-gradient(135deg, #1e3a5f 0%, #1e40af 100%); }
body.dark-mode .chart-container { background: #1e293b; }
body.dark-mode .authority-links a:hover { background: #1e40af; }
body.dark-mode .authority-links { background: #1e293b; }
body.dark-mode .authority-links a { background: #334155; color: #e2e8f0; }
body.dark-mode .authority-links a:hover { background: #1e40af; }
body.dark-mode .tab-nav { background: #334155; }
body.dark-mode .tab-btn { color: #94a3b8; }
body.dark-mode .tab-btn.active { background: #1e293b; color: #60a5fa; }
body.dark-mode .state-index-item { background: #1e293b; border-color: #334155; }
body.dark-mode .state-index-item:hover { background: #1e3a5f; border-color: #2563eb; }
body.dark-mode .state-index-item .state-name { color: #e2e8f0; }
body.dark-mode .breadcrumbs { color: #94a3b8; }
body.dark-mode .breadcrumbs .current { color: #e2e8f0; }
body.dark-mode .reading-time { color: #94a3b8; }
body.dark-mode .result-history { background: #334155; border-color: #475569; }
body.dark-mode .result-history h5 { color: #94a3b8; }

/* Dark mode toggle button */
.dark-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #475569;
  padding: 0.4rem;
  border-radius: 8px;
  transition: all 0.2s;
  line-height: 1;
}
.dark-toggle:hover { background: #e2e8f0; }
body.dark-mode .dark-toggle { color: #fbbf24; }
body.dark-mode .dark-toggle:hover { background: #334155; }

/* === ENHANCED FOCUS RING === */
*:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}

/* === SKIP LINK (Accessibility) === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: #2563eb;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-link:focus { top: 1rem; }

/* === RESULT COPY CONFIRMATION === */
.copy-toast {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 9999;
}
.copy-toast.show { opacity: 1; visibility: visible; }
