/* CSS Reset and Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #e23744;
  --primary-dark: #cb2d3e;
  --secondary-color: #2d2d2d;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f8f9fa;
  --white: #ffffff;
  --border-color: #e0e0e0;
  --success-color: #28a745;
  --error-color: #dc3545;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 8px;
  --max-width: 1200px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  flex: 1;
  padding: 1.5rem 0;
}

/* Header */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo:hover {
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.9rem;
}

nav a:hover {
  color: var(--primary-color);
}

/* Mobile Navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--secondary-color);
  margin: 5px 0;
  transition: 0.3s;
}

/* Breadcrumb */
.breadcrumb {
  background: var(--white);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.breadcrumb li::after {
  content: "›";
  margin-left: 0.5rem;
  color: var(--text-light);
}

.breadcrumb li:last-child::after {
  content: "";
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb span {
  color: var(--text-color);
}

/* Calculator Section */
.calculator-section {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.calculator-form {
  display: grid;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--secondary-color);
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(226, 55, 68, 0.1);
}

.form-group input.error {
  border-color: var(--error-color);
}

.input-wrapper {
  position: relative;
}

.currency-symbol {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-weight: 500;
}

.input-wrapper input {
  padding-left: 2rem;
}

.time-period-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  display: none;
}

.error-message.show {
  display: block;
}

/* Calculate Button */
.calculate-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  width: 100%;
  margin-top: 0.5rem;
}

.calculate-btn:hover {
  background: var(--primary-dark);
}

.calculate-btn:active {
  transform: scale(0.98);
}

/* Results Section */
.results-section {
  display: none;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  color: var(--white);
}

.results-section.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-grid {
  display: grid;
  gap: 1rem;
}

.result-card {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius);
  padding: 1rem;
  text-align: center;
}

.result-card h3 {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.result-value {
  font-size: 1.75rem;
  font-weight: 700;
}

.savings-insight {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
}

.savings-insight p {
  margin: 0;
  font-size: 0.95rem;
}

/* Content Sections */
.content-section {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.content-section h2 {
  color: var(--primary-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.content-section ul,
.content-section ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.content-section li {
  margin-bottom: 0.5rem;
}

/* FAQ Section */
.faq-section {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

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

.faq-question {
  font-weight: 600;
  color: var(--secondary-color);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  content: "−";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--text-light);
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-top: 1rem;
}

/* Example Box */
.example-box {
  background: var(--bg-color);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.example-box h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* CTA Box */
.cta-box {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--white);
  margin: 1.5rem 0;
}

.cta-box h3 {
  color: var(--white);
  margin-bottom: 0.75rem;
}

.cta-box p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.cta-btn {
  display: inline-block;
  background: var(--white);
  color: var(--primary-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Steps List */
.steps-list {
  counter-reset: step;
  list-style: none;
  margin-left: 0;
}

.steps-list li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}

.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Footer */
footer {
  background: var(--secondary-color);
  color: var(--white);
  padding: 2rem 0;
  margin-top: auto;
}

.footer-content {
  text-align: center;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--white);
}

.copyright {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 3rem 1rem;
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1rem;
}

.hero p {
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* Feature Cards */
.features-grid {
  display: grid;
  gap: 1rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Mobile Sticky Button */
.mobile-sticky-btn {
  display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  
  .nav-toggle {
    display: block;
  }
  
  nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  nav.active {
    max-height: 300px;
  }
  
  nav ul {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }
  
  .time-period-group {
    grid-template-columns: 1fr;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
  
  .mobile-sticky-btn {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 99;
  }
  
  .mobile-sticky-btn .calculate-btn {
    margin: 0;
  }
  
  .calculator-form .calculate-btn {
    display: none;
  }
  
  main {
    padding-bottom: 5rem;
  }
}

@media (min-width: 769px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  
  .calculator-form {
    grid-template-columns: 1fr 1fr;
  }
  
  .calculator-form .form-group:last-of-type {
    grid-column: 1 / -1;
  }
  
  .results-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .hero {
    padding: 4rem 2rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
  
  .calculator-section {
    padding: 2rem;
  }
  
  .content-section {
    padding: 2rem;
  }
}

/* Contact Form Styles */
.contact-form {
  margin-top: 1.5rem;
}

.contact-form .form-group {
  margin-bottom: 1.25rem;
}

.contact-form textarea {
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  width: 100%;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(226, 55, 68, 0.1);
}

.contact-info-box {
  background: var(--bg-color);
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.contact-email {
  font-size: 1.25rem;
  font-weight: 600;
}

.contact-email a {
  color: var(--primary-color);
}

.required {
  color: var(--error-color);
}

/* Blog Styles */
.blog-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}

.blog-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.blog-card-content {
  padding: 1.5rem;
}

.blog-card h3 {
  margin-bottom: 0.75rem;
}

.blog-card h3 a {
  color: var(--secondary-color);
}

.blog-card h3 a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.blog-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.blog-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.read-more {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.read-more::after {
  content: "→";
  transition: transform 0.2s ease;
}

.blog-card:hover .read-more::after {
  transform: translateX(4px);
}

/* Article Styles */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.article-meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.article-content {
  line-height: 1.8;
}

.article-content h2 {
  margin-top: 2rem;
  padding-top: 1rem;
}

.article-content h3 {
  margin-top: 1.5rem;
}

.article-content blockquote {
  background: var(--bg-color);
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
}

/* Disclaimer Banner */
.disclaimer-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #856404;
}

.disclaimer-banner strong {
  color: #664d03;
}

/* Tag Styles */
.tag {
  display: inline-block;
  background: var(--bg-color);
  color: var(--text-light);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

@media (min-width: 769px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Print Styles */
@media print {
  header, footer, .mobile-sticky-btn, .calculate-btn {
    display: none;
  }
  
  .results-section {
    display: block !important;
    background: none;
    color: var(--text-color);
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
  
  .result-card {
    background: none;
    border: 1px solid var(--border-color);
  }
  
  .result-card h3, .result-value {
    color: var(--text-color);
  }
}
