/**
 * SEO Content Sections Stylesheet
 * Reusable styles for How-To, Formula, FAQ, and Related Tools sections
 * Import this in calculator stylesheets that need SEO content styling
 */

/* =====================================================
   Header & Breadcrumb Navigation
   ===================================================== */

.header {
  background: var(--card, #ffffff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text, #1e293b);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary, #6366f1);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-text {
  font-weight: 600;
  font-size: 1.1rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--muted, #64748b);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary, #6366f1);
}

.breadcrumb-separator {
  color: var(--border, #e2e8f0);
}

/* =====================================================
   Main Content Area
   ===================================================== */

.main {
  padding: 2rem 0;
}

.main > .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.tool-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text, #1e293b);
}

.tool-subtitle {
  color: var(--muted, #64748b);
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* =====================================================
   Calculator Grid Layout
   ===================================================== */

.calculator-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Input Panel (Left Side) */
.input-panel {
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 100px;
}

@media (max-width: 1024px) {
  .input-panel {
    position: static;
  }
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text, #1e293b);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary, #6366f1);
}

/* Form Groups */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text, #1e293b);
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg, #f8fafc);
  color: var(--text, #1e293b);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: #ffffff;
}

.form-group small {
  display: block;
  color: var(--muted, #64748b);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* Results Panel (Right Side) */
.results-panel {
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#result-container {
  margin-bottom: 1rem;
}

.result-disclaimer {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #92400e;
}

.privacy-notice {
  background: #ecfdf5;
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: #065f46;
}

.chart-container {
  margin-top: 1.5rem;
}

.chart-container h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text, #1e293b);
}

.chart-wrapper {
  position: relative;
  height: 300px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* =====================================================
   How to Use Section
   ===================================================== */

.how-to-use {
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.how-to-use h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text, #1e293b);
}

.how-to-use ol {
  padding-left: 1.5rem;
  margin: 0;
}

.how-to-use li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--text, #1e293b);
}

.how-to-use li strong {
  color: var(--primary, #6366f1);
}

/* =====================================================
   Formula Section
   ===================================================== */

.formula-section {
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.formula-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text, #1e293b);
}

.formula-box {
  background: var(--bg, #f8fafc);
  border-radius: 8px;
  padding: 1.5rem;
}

.formula-box p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.formula {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-family: 'Courier New', Consolas, monospace;
  font-size: 1.1rem;
  margin: 1rem 0;
  overflow-x: auto;
  text-align: center;
}

.formula-box ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.formula-box li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* =====================================================
   Why Section (SEO Content)
   ===================================================== */

.why-section {
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.why-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text, #1e293b);
}

.why-section h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text, #1e293b);
}

.why-section p {
  margin-bottom: 1rem;
  line-height: 1.8;
  color: var(--text, #1e293b);
}

.why-section ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.why-section li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

/* =====================================================
   FAQ Section
   ===================================================== */

.faq-section {
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.faq-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text, #1e293b);
}

.faq-item {
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding: 1.25rem 0;
}

.faq-item:first-of-type {
  padding-top: 0;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-question {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text, #1e293b);
}

.faq-answer {
  color: var(--muted, #64748b);
  line-height: 1.7;
  margin: 0;
}

/* Interactive FAQ (Accordion Style) */
.faq-item.interactive .faq-question {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item.interactive .faq-question::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--muted, #64748b);
  transition: transform 0.2s;
}

.faq-item.interactive.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-item.interactive .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.interactive.open .faq-answer {
  max-height: 500px;
}

/* =====================================================
   Related Tools Section
   ===================================================== */

.related-tools {
  margin-top: 2rem;
}

.related-tools h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text, #1e293b);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.related-card {
  background: var(--card, #ffffff);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text, #1e293b);
  border: 1px solid var(--border, #e2e8f0);
  transition: all 0.2s ease;
}

.related-card:hover {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

.related-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text, #1e293b);
}

.related-card p {
  font-size: 0.85rem;
  color: var(--muted, #64748b);
  margin: 0;
  line-height: 1.5;
}

/* =====================================================
   Footer
   ===================================================== */

.footer {
  background: var(--card, #ffffff);
  border-top: 1px solid var(--border, #e2e8f0);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
}

.footer > .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer p {
  color: var(--muted, #64748b);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted, #64748b);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary, #6366f1);
}

/* =====================================================
   Responsive Design
   ===================================================== */

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .breadcrumb {
    font-size: 0.8rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .tool-title {
    font-size: 1.5rem;
  }
  
  .tool-subtitle {
    font-size: 1rem;
  }
  
  .how-to-use,
  .formula-section,
  .why-section,
  .faq-section {
    padding: 1.5rem;
  }
  
  .formula {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-links {
    gap: 1rem;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 0 1rem;
  }
  
  .main > .container {
    padding: 0 1rem;
  }
  
  .tool-title {
    font-size: 1.25rem;
  }
  
  .how-to-use h2,
  .formula-section h2,
  .why-section h2,
  .faq-section h2,
  .related-tools h2 {
    font-size: 1.25rem;
  }
}

/* =====================================================
   Print Styles
   ===================================================== */

@media print {
  .header,
  .footer,
  .related-tools {
    display: none;
  }
  
  .main {
    padding: 0;
  }
  
  .how-to-use,
  .formula-section,
  .why-section,
  .faq-section {
    box-shadow: none;
    border: 1px solid #e2e8f0;
    break-inside: avoid;
  }
}
