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

:root {
  --primary-green: #10b981;
  --primary-green-dark: #059669;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --bg-white: #ffffff;
  --bg-light: #f9fafb;
  --border-gray: #e5e7eb;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-white);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-gray);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-green);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Main Content */
.main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
  line-height: 1.2;
}

.hero-text, .intro {
  font-size: 1.1rem;
  color: var(--text-gray);
  max-width: 800px;
  margin: 0 auto 2rem;
  line-height: 1.8;
}

article h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  line-height: 1.2;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.tool-card {
  background: var(--bg-white);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tool-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.tool-card h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.tool-card p {
  color: var(--text-gray);
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn, .btn-secondary, .btn-preset {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-green);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

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

.btn-secondary {
  background-color: var(--text-gray);
  margin-top: 1rem;
}

.btn-secondary:hover {
  background-color: var(--text-dark);
}

.btn-preset {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  margin: 0.25rem;
}

/* Features Grid */
.features {
  margin: 4rem 0;
  padding: 2rem;
  background-color: var(--bg-light);
  border-radius: 8px;
}

.features h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
}

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

.feature {
  text-align: center;
}

.feature h3 {
  color: var(--primary-green);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

/* Calculator Section */
.calculator-section {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
}

.calculator-form {
  margin-bottom: 2rem;
}

.calculator-form h3 {
  margin: 1.5rem 0 1rem;
  color: var(--text-dark);
  font-size: 1.3rem;
}

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

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

.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.form-group input {
  padding: 0.75rem;
  border: 1px solid var(--border-gray);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-green);
}

.form-group small {
  color: var(--text-gray);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Appliance Rows (Energy Calculator) */
.appliance-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: end;
}

#appliancesContainer {
  margin-bottom: 1rem;
}

.btn-remove {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  width: 40px;
  height: 42px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-remove:hover {
  background-color: #dc2626;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Results Section */
.results {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 2rem;
  border: 1px solid var(--border-gray);
}

.results h2 {
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  font-size: 1.8rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.result-item {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 6px;
  text-align: center;
}

.result-item.highlight {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-dark) 100%);
  color: white;
}

.result-item.highlight .result-label,
.result-item.highlight .result-value {
  color: white;
}

.result-label {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.result-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-dark);
}

.result-note {
  background: #dbeafe;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1rem;
  color: #1e40af;
  font-weight: 500;
}

.breakdown {
  background: var(--bg-light);
  padding: 1rem;
  border-radius: 6px;
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-gray);
}

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

.breakdown-name {
  font-weight: 500;
  color: var(--text-dark);
}

.breakdown-cost {
  color: var(--primary-green);
  font-weight: 600;
}

/* FAQ Section */
.faq {
  margin: 3rem 0;
}

.faq h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-dark);
}

.faq-item {
  background: var(--bg-white);
  border: 1px solid var(--border-gray);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.faq-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

.faq-item p {
  color: var(--text-gray);
  line-height: 1.7;
}

/* Related Tools */
.related-tools {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--bg-light);
  border-radius: 8px;
}

.related-tools h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.related-tools ul {
  list-style: none;
}

.related-tools li {
  margin: 0.75rem 0;
}

.related-tools a {
  color: var(--primary-green);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Ad Spaces */
.ad-space {
  background: var(--bg-light);
  border: 2px dashed var(--border-gray);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin: 2rem auto;
}

.ad-placeholder {
  color: var(--text-gray);
  font-weight: 500;
  font-size: 1.1rem;
}

/* Footer */
.footer {
  background-color: var(--text-dark);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

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

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--primary-green);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin: 0.5rem 0;
}

.footer-section a {
  color: white;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--primary-green);
}

.footer-section p {
  color: #9ca3af;
  margin: 0.5rem 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero h1, article h1 {
    font-size: 2rem;
  }

  .hero-text, .intro {
    font-size: 1rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .appliance-row {
    grid-template-columns: 1fr;
  }

  .btn-remove {
    width: 100%;
    margin-top: 0.5rem;
  }

  .nav {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .ad-space {
    height: auto;
    min-height: 60px;
  }

  .ad-placeholder {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .hero h1, article h1 {
    font-size: 1.75rem;
  }

  .calculator-section {
    padding: 1rem;
  }

  .results {
    padding: 1rem;
  }

  .result-value {
    font-size: 1.5rem;
  }
}
