/* ==========================================================================
   CountWord.net — Interactive Components & Standardized Ad Placements
   ========================================================================== */

/* --------------------------------------------------------------------------
   Core Word Counter Interface
   -------------------------------------------------------------------------- */
.counter-interface {
  width: 100%;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.editor-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.luxury-textarea {
  width: 100%;
  min-height: 280px;
  max-height: 800px;
  padding: 22px 24px;
  background-color: #E8E5DF;
  border: 1px solid #D8D4CC;
  border-radius: 4px;
  outline: none;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text-primary);
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.luxury-textarea:hover {
  border-color: var(--accent-gold);
}

.luxury-textarea:focus {
  border-color: var(--accent-gold);
  background-color: #E8E5DF;
  box-shadow: 0 0 0 2px rgba(196, 154, 108, 0.2);
}

.luxury-textarea::placeholder {
  color: #7A746B;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 400;
}

/* Action Toolbar */
.tool-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.action-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}

.text-btn {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 400;
  color: var(--accent-bronze);
  position: relative;
  transition: var(--transition-smooth);
}

.text-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--accent-gold);
  transition: width 0.2s ease;
}

.text-btn:hover {
  color: var(--text-primary);
}

.text-btn:hover::after {
  width: 100%;
}

.case-tools-select {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 4px 8px;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  outline: none;
  letter-spacing: 0.5px;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: 100%;
  margin-bottom: 24px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
}

.stat-item {
  padding: 18px 12px;
  text-align: center;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease;
}

.stat-item:last-child {
  border-right: none;
}

.stat-item:hover {
  background-color: rgba(196, 154, 108, 0.04);
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 2rem; /* 32px */
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem; /* 11px */
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  color: var(--accent-bronze);
  line-height: 1.2;
}

/* Secondary Granular Stats */
.secondary-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background-color: rgba(243, 239, 233, 0.4);
  border: 1px solid var(--border-subtle);
  border-top: none;
  margin-top: -24px;
  margin-bottom: 28px;
}

.sec-stat span {
  color: var(--text-primary);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Beautified Goal Tracker / Progress Component
   -------------------------------------------------------------------------- */
.goal-tracker-wrap {
  margin: 16px 0 24px;
  padding: 16px 20px;
  background: #FDFCFB;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.goal-tracker-wrap:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 2px 8px rgba(196, 154, 108, 0.08);
}

.goal-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-primary);
  font-weight: 400;
}

.goal-info-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-bronze);
  font-size: 0.75rem;
  letter-spacing: 1px;
  font-weight: 500;
}

.goal-info-title svg {
  width: 14px;
  height: 14px;
  stroke: var(--accent-gold);
  fill: none;
}

#goalPercentText {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-bronze);
  background: var(--tag-bg);
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(196, 154, 108, 0.2);
}

.goal-bar-bg {
  width: 100%;
  height: 6px;
  background-color: #EFEAE2;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.goal-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #C49A6C 0%, #D4B896 100%);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}

.goal-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  animation: goalShimmer 2.5s infinite;
}

@keyframes goalShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --------------------------------------------------------------------------
   Interactive Calculators (Words-to-Minutes, Words-to-Pages, Density, etc.)
   -------------------------------------------------------------------------- */
.calculator-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: clamp(20px, 3vw, 36px);
  margin: 2rem 0;
  border-radius: 2px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 24px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  color: var(--accent-bronze);
}

.calc-input, .calc-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-color);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.calc-input:focus, .calc-select:focus {
  border-color: var(--accent-gold);
  background: #FFFFFF;
}

.calc-result-display {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.calc-result-number {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
}

.calc-result-unit {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-bronze);
}

/* --------------------------------------------------------------------------
   FAQ Accordion (15 Unique FAQs Per Page)
   -------------------------------------------------------------------------- */
.faq-section {
  margin: clamp(48px, 6vw, 80px) 0;
}

.faq-header {
  margin-bottom: 2rem;
}

.faq-container {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
}

.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}

.faq-trigger {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.faq-trigger:hover {
  color: var(--accent-bronze);
}

.faq-icon-chevron {
  width: 18px;
  height: 18px;
  stroke: var(--accent-bronze);
  stroke-width: 1.5;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.is-open .faq-icon-chevron {
  transform: rotate(180deg);
  stroke: var(--accent-gold);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.faq-item.is-open .faq-content {
  max-height: 500px;
  opacity: 1;
}

.faq-inner {
  padding-bottom: 20px;
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-secondary);
  font-weight: 300;
}

/* --------------------------------------------------------------------------
   Related Tools Grid
   -------------------------------------------------------------------------- */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 2rem 0 clamp(40px, 5vw, 64px);
}

.tool-card {
  padding: 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s ease, background-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-card:hover {
  border-color: var(--accent-gold);
  background-color: rgba(196, 154, 108, 0.03);
}

.tool-card h4 {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.tool-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   PREMIUM EDITORIAL AD PLACEMENTS & GOOGLE ADSENSE INTEGRATION
   -------------------------------------------------------------------------- */

/* Standard Ad Placement Base */
.ad-slot-top-banner,
.ad-slot-post-tool,
.ad-slot-in-content,
.ad-slot-post-faq,
.ad-slot-footer-banner {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.adsbygoogle {
  display: block;
  margin: 0 auto;
  text-align: center;
}

/* Position 1: Top Banner (Responsive 728x90 max) - Below Nav, Above Content */
.ad-slot-top-banner {
  max-width: 728px;
  min-height: 90px;
  margin: 16px auto 28px;
  background-color: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-label {
  font-family: var(--font-sans);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

/* Position 2: Native Ad - After Tool Interface */
.ad-slot-post-tool {
  margin: 28px 0 36px;
  padding: 20px 24px;
  background-color: #FDFCFB;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-gold);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.ad-slot-post-tool .ad-sponsor {
  font-size: 0.6875rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-bronze);
  font-weight: 500;
}

.ad-slot-post-tool .ad-headline {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
}

/* Position 3: In-Content Editorial Ad (Between Content Sections) */
.ad-slot-in-content {
  max-width: 600px;
  margin: 36px auto;
  padding: 18px 20px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-subtle);
  border-top: 2px solid var(--accent-gold);
  border-radius: 3px;
  text-align: center;
}

/* Position 4: Post-FAQ Banner (728x90 max) */
.ad-slot-post-faq {
  max-width: 728px;
  min-height: 90px;
  margin: 36px auto 28px;
  background-color: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Unique Premium Ad Area: "Discover More" Editorial Recommendation */
.discover-more-ad-module {
  margin: clamp(36px, 5vw, 48px) 0;
  padding: clamp(20px, 3vw, 28px);
  background: #FDFCFB;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.discover-more-ad-module:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 4px 12px rgba(196, 154, 108, 0.06);
}

.discover-more-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.discover-more-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.2px;
}

.discover-more-badge {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent-bronze);
  background: var(--tag-bg);
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 500;
}

.discover-more-body {
  width: 100%;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Position 6: Native Ad Grid (3 Cards Before Related Tools) */
.ad-slot-native-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 32px 0 48px;
}

.ad-native-card {
  padding: 18px 20px;
  background-color: #FDFCFB;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s ease;
}

.ad-native-card:hover {
  border-color: var(--accent-gold);
}

.ad-native-card h5 {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
}

.ad-native-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0;
  line-height: 1.55;
}

/* Position 7: Footer Banner */
.ad-slot-footer-banner {
  max-width: 728px;
  margin: 24px auto 0;
  padding: 10px 12px;
  text-align: center;
  background-color: #FAF8F5;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   PREMIUM CROSS-SITE NETWORK BANNER (Ecosystem Discovery)
   -------------------------------------------------------------------------- */
.network-ecosystem-section {
  margin: clamp(48px, 6vw, 72px) 0 32px;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 3vw, 36px);
  background: #FDFCFB;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}

.network-header {
  margin-bottom: 24px;
  text-align: left;
}

.network-label {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-bronze);
  font-weight: 500;
  display: inline-block;
  margin-bottom: 4px;
}

.network-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 400;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.network-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.network-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.network-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  padding: 22px;
  border-radius: 3px;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.network-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: 0 6px 18px rgba(196, 154, 108, 0.08);
}

.network-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.network-monogram {
  width: 32px;
  height: 32px;
  background: var(--tag-bg);
  color: var(--accent-bronze);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  border: 1px solid var(--border-subtle);
}

.network-arrow {
  color: var(--accent-bronze);
  font-size: 1.125rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.network-card:hover .network-arrow {
  color: var(--accent-gold);
  transform: translate(2px, -2px);
}

.network-card-name {
  font-family: var(--font-serif);
  font-size: 1.1875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.network-card-desc {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 14px;
  flex: 1;
}

.network-card-link {
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-bronze);
  font-weight: 500;
}

.network-card:hover .network-card-link {
  color: var(--accent-gold);
}

@media (max-width: 820px) {
  .network-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #1A1A1A;
  color: #FAF8F5;
  padding: 12px 24px;
  font-size: 0.8125rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-left: 3px solid var(--accent-gold);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 1000;
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .stats-bar {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-item:nth-child(3) {
    border-right: none;
  }
  .stat-item:nth-child(-n+3) {
    border-bottom: 1px solid var(--border-subtle);
  }
}

@media (max-width: 540px) {
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-item:nth-child(2n) {
    border-right: none;
  }
  .stat-item:nth-child(2n+1) {
    border-right: 1px solid var(--border-subtle);
  }
  .stat-item:nth-child(-n+4) {
    border-bottom: 1px solid var(--border-subtle);
  }
  .stat-number {
    font-size: 1.75rem;
  }
}
