/* Base styles and variables */
:root {
  /* Color system */
  --primary-light: #81C784;
  --primary: #4CAF50;
  --primary-dark: #2E7D32;
  
  --secondary-light: #4FC3F7;
  --secondary: #0288D1;
  --secondary-dark: #01579B;
  
  --accent-light: #FFD54F;
  --accent: #FFC107;
  --accent-dark: #FF8F00;
  
  --success-light: #A5D6A7;
  --success: #66BB6A;
  --success-dark: #388E3C;
  
  --warning-light: #FFCC80;
  --warning: #FF9800;
  --warning-dark: #EF6C00;
  
  --error-light: #EF9A9A;
  --error: #F44336;
  --error-dark: #C62828;
  
  --neutral-100: #F5F5F5;
  --neutral-200: #EEEEEE;
  --neutral-300: #E0E0E0;
  --neutral-400: #BDBDBD;
  --neutral-500: #9E9E9E;
  --neutral-600: #757575;
  --neutral-700: #616161;
  --neutral-800: #424242;
  --neutral-900: #212121;
  
  /* Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  
  /* Spacing system (8px grid) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.1), 0 3px 6px rgba(0,0,0,0.05);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--neutral-800);
  background-color: var(--neutral-100);
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: var(--space-2);
  font-weight: 600;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-3);
}

h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-1);
}

p {
  margin-bottom: var(--space-2);
}

/* Header and Footer Styles */

/* Header Styles */
.header {
  background-color: #42924a;
  color: white;
  padding: 0.5rem 0;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.header .logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin: 0;
}

.header .logo img {
  height: 70px;
  width: auto;
  object-fit: contain;
}

.desktop-nav {
  display: flex;
  gap: 2rem;
}

.desktop-nav a {
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.desktop-nav a:hover {
  color: #e0e0e0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-icon {
  display: block;
  width: 24px;
  height: 2px;
  background-color: white;
  position: relative;
  transition: background-color 0.3s;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: white;
  transition: transform 0.3s;
}

.menu-icon::before {
  top: -6px;
}

.menu-icon::after {
  bottom: -6px;
}

/* Mobile menu open state */
.mobile-menu-open .menu-icon {
  background-color: transparent;
}

.mobile-menu-open .menu-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.mobile-menu-open .menu-icon::after {
  transform: rotate(-45deg);
  bottom: 0;
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  background-color: #42924a;
  padding: 1rem;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mobile-nav.show {
  display: block;
}

.mobile-nav a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-3);
}

.page-header {
  text-align: center;
  margin-bottom: var(--space-4);
}

.page-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-2);
}

.leaf-icon {
  width: 32px;
  height: 32px;
  background-color: var(--primary);
  margin-right: var(--space-1);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z'/%3E%3C/svg%3E");
  mask-size: cover;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z'/%3E%3C/svg%3E");
  -webkit-mask-size: cover;
  -webkit-mask-repeat: no-repeat;
}

.tagline {
  color: var(--neutral-600);
  font-size: 1.1rem;
}

main {
  display: grid;
  gap: var(--space-5);
}

/* Calculator styling */
.calculator-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.calculator-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 2px solid var(--neutral-300);
}

.tab {
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  font-weight: 500;
  color: var(--neutral-600);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: -2px;
}

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

.tab.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.calculator-card, .results-card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
  transition: var(--transition-normal);
}

.form-group {
  margin-bottom: var(--space-3);
  position: relative;
}

label {
  display: block;
  margin-bottom: var(--space-1);
  font-weight: 500;
}

select, input[type="text"], input[type="number"] {
  width: 100%;
  padding: var(--space-2);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: var(--transition-fast);
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* Range input styling */
.range-container {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  background: var(--neutral-300);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition-fast);
}

input[type="range"]::-moz-range-thumb:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

#areaValue {
  min-width: 70px;
  font-weight: 500;
}

.calculate-btn {
  /* Base styling */
  background-color: #42924a;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: block;
  width: 100%;
  margin-top: var(--space-3);
  
  /* Use transition instead of animation */
  transition: background-color 0.3s ease;
  
  /* Remove opacity: 0 and use a regular animation in animations.css */
  position: relative;
  overflow: hidden; /* Contain the ripple effect */
  z-index: 1;
}

/* Simple hover state without any conflicts */
.calculate-btn:hover {
  background-color: #274526;
}


/* Fix for ripple effect */
.ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
  z-index: 0;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Results styling */
.results-card {
  overflow: hidden;
}

.results-card.hidden {
  display: none;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.result-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.result-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.energy-icon {
  background-color: var(--secondary-light);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7,2V13H10V22L17,10H13L17,2H7Z'/%3E%3C/svg%3E");
  mask-size: 60%;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7,2V13H10V22L17,10H13L17,2H7Z'/%3E%3C/svg%3E");
  -webkit-mask-size: 60%;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  background-color: var(--secondary);
}

.money-icon {
  background-color: var(--accent-light);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7,15H9C9,16.08 10.37,17 12,17C13.63,17 15,16.08 15,15C15,13.9 13.96,13.5 11.76,12.97C9.64,12.44 7,11.78 7,9C7,7.21 8.47,5.69 10.5,5.18V3H13.5V5.18C15.53,5.69 17,7.21 17,9H15C15,7.92 13.63,7 12,7C10.37,7 9,7.92 9,9C9,10.1 10.04,10.5 12.24,11.03C14.36,11.56 17,12.22 17,15C17,16.79 15.53,18.31 13.5,18.82V21H10.5V18.82C8.47,18.31 7,16.79 7,15Z'/%3E%3C/svg%3E");
  mask-size: 60%;
  mask-position: center;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7,15H9C9,16.08 10.37,17 12,17C13.63,17 15,16.08 15,15C15,13.9 13.96,13.5 11.76,12.97C9.64,12.44 7,11.78 7,9C7,7.21 8.47,5.69 10.5,5.18V3H13.5V5.18C15.53,5.69 17,7.21 17,9H15C15,7.92 13.63,7 12,7C10.37,7 9,7.92 9,9C9,10.1 10.04,10.5 12.24,11.03C14.36,11.56 17,12.22 17,15C17,16.79 15.53,18.31 13.5,18.82V21H10.5V18.82C8.47,18.31 7,16.79 7,15Z'/%3E%3C/svg%3E");
  -webkit-mask-size: 60%;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  background-color: var(--accent);
}

.result-content {
  flex: 1;
}

.result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-900);
}

.result-per-year {
  font-size: 0.875rem;
  color: var(--neutral-600);
}

/* Savings visualization */
.savings-visualization {
  margin: var(--space-4) 0;
}

.visualization-label {
  margin-bottom: var(--space-1);
  font-weight: 500;
}

.progress-container {
  height: 12px;
  background-color: var(--neutral-200);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--space-1);
}

.progress-bar {
  height: 100%;
  background-color: var(--success);
  width: 0;
  transition: width var(--transition-slow);
}

.visualization-value {
  text-align: right;
  font-weight: 600;
}

.savings-explanation {
  padding: var(--space-3);
  background-color: var(--neutral-100);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
}

/* CTA section */
.cta-section {
  text-align: center;
  margin: var(--space-5) 0;
}

.cta-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.cta-card {
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--neutral-800);
  transition: var(--transition-normal);
}

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

.cta-image {
  height: 160px;
  background-position: center;
  background-size: cover;
}

.insulation-image {
  background-image: url('https://images.pexels.com/photos/3680319/pexels-photo-3680319.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
}

.climate-image {
  background-image: url('https://images.pexels.com/photos/1072824/pexels-photo-1072824.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2');
}

.cta-card h3 {
  padding: var(--space-2) var(--space-2) 0 var(--space-2);
  color: var(--neutral-900);
}

.cta-card p {
  padding: 0 var(--space-2) var(--space-2) var(--space-2);
  color: var(--neutral-600);
  font-size: 0.9rem;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
  margin-left: var(--space-1);
  vertical-align: middle;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background-color: var(--neutral-500);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  cursor: help;
}

.tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: var(--neutral-800);
  color: white;
  text-align: center;
  border-radius: var(--radius-md);
  padding: var(--space-2);
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--neutral-800) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Footer Styles */
.footer {
  background-color: #212121;
  color: white;
  padding: 4rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
}

.footer-info {
  max-width: 400px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.footer-info p {
  color: white;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.link-group h4 {
  color: white;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.link-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-group ul li {
  margin-bottom: 0.75rem;
}

.link-group a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.link-group a:hover {
  color: white;
}

.copyright {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}


/* Responsive adjustments */
@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.35rem;
  }
  
  .container {
    padding: var(--space-2);
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .calculator-tabs {
    flex-direction: column;
    border-bottom: none;
    gap: var(--space-1);
  }
  
  .tab {
    margin-bottom: 0;
    text-align: center;
    padding: var(--space-1);
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
  }
  
  .tab.active {
    border: 1px solid var(--primary);
    background-color: var(--primary-light);
    color: var(--primary-dark);
  }
  
  .calculator-card, .results-card {
    padding: var(--space-2);
  }
}

@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-info {
    max-width: 100%;
  }
}