/* ============================================================
   QuickTools — Enhancements CSS
   Cookie Banner, Progress Bar, Back to Top, Author Box,
   Search Bar, Newsletter, Social Proof, Reading Time
   ============================================================ */

/* ---- Cookie Consent Banner ---- */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1B2A41;
  color: #E7EEEF;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
  font-size: 14px;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner a { color: var(--accent); }
.cookie-btns { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-accept {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.cookie-decline {
  background: transparent;
  color: #E7EEEF;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

/* ---- Reading Progress Bar ---- */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 9998;
  transition: width 0.1s linear;
}

/* ---- Back to Top Button ---- */
.back-to-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); }

/* ---- Search Bar ---- */
.search-wrap {
  max-width: 520px;
  margin: 0 auto 32px;
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 13px 48px 13px 18px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
}
.search-wrap .search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.search-results.show { display: block; }
.sr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  transition: background 0.1s;
}
.sr-item:last-child { border: none; }
.sr-item:hover { background: var(--bg); }
.sr-cat {
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 700;
  flex-shrink: 0;
}
.sr-empty { padding: 16px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---- Author Box ---- */
.author-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-top: 32px;
}
.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Poppins', sans-serif;
}
.author-info .name { font-weight: 700; font-size: 15px; color: var(--primary); }
.author-info .role { font-size: 12px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.author-info p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.6; }

/* ---- Post Meta (reading time, word count, date) ---- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.post-meta span { display: flex; align-items: center; gap: 5px; }

/* ---- Newsletter Box ---- */
.newsletter-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  margin: 32px 0;
}
.newsletter-box h3 { color: #fff; font-size: 20px; margin: 0 0 8px; }
.newsletter-box p  { color: rgba(255,255,255,0.8); margin: 0 0 18px; font-size: 14px; }
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-family: inherit;
}
.newsletter-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 20px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  white-space: nowrap;
}
.newsletter-form button:hover { background: #d97b2e; }

/* ---- Social Proof / Trust Badges ---- */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin: 24px 0;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.trust-item .ti { font-size: 20px; }

/* ---- Related Tools (inside blog posts) ---- */
.related-tools {
  margin-top: 28px;
  padding: 20px;
  background: var(--accent-soft);
  border-radius: 14px;
  border-left: 4px solid var(--accent);
}
.related-tools h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.rt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rt-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary);
  transition: all 0.15s;
}
.rt-link:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/* ---- FAQ Section ---- */
.faq-section { margin-top: 32px; }
.faq-section h2 { font-size: 20px; margin-bottom: 16px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  background: var(--surface);
  border: none;
  padding: 16px 18px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
}
.faq-q:hover { background: var(--bg); }
.faq-q .arrow { transition: transform 0.2s; font-size: 12px; }
.faq-q.open .arrow { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
  padding: 0 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  background: var(--surface);
}
.faq-a.open { max-height: 300px; padding: 0 18px 16px; }

/* ---- EEAT / Helpful Content badge ---- */
.eeat-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #1E40AF;
  margin-bottom: 20px;
}
[data-theme="midnight"] .eeat-banner {
  background: #1E2840;
  border-color: #3B4F7A;
  color: #93C5FD;
}
.eeat-banner strong { font-weight: 700; }

/* ---- Post views ---- */
.view-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
