@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Prompt:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Tech-Minimalist Color Palette */
  --bg-primary: #F4F7F6;       /* Clean Off-White/Light Grey */
  --bg-secondary: #FFFFFF;     /* Pure White */
  --accent-main: #008080;      /* Soft Teal */
  --accent-secondary: #1A365D; /* Midnight Blue */
  --text-primary: #2D3748;     /* Dark Slate Grey */
  --text-secondary: #718096;   /* Warm Grey */
  --header-bg: rgba(255, 255, 255, 0.98);
  --footer-bg: #1A365D;        /* Midnight Blue Footer */
  --border-soft: #E2E8F0;      /* Soft Border Grey */

  /* Compatibility with legacy styles */
  --almost-black: var(--text-primary);
  --dark-cyan: var(--accent-secondary);
  --bright-cyan: var(--accent-main);
  --sand: var(--border-soft);
  --off-white: var(--bg-primary);
  --background-color: var(--bg-primary);
  --text-color: var(--text-primary);
  --header-footer-bg: var(--header-bg);
  --header-footer-text: var(--text-primary);
  --heading-color: var(--accent-secondary);
  --card-background: var(--bg-secondary);
  --section-background: var(--bg-secondary);
  --border-color: var(--border-soft);
  --accent-color: var(--accent-main);
  --button-hover-color: var(--accent-secondary);
  --highlight-color: var(--accent-main);
}

/* =================================
   Scroll Behavior
   ================================= */
html {
  scroll-behavior: smooth;
}

/* Base style for sections */
.snap-section {
  min-height: auto; /* Remove fixed full-screen height */
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  padding: 40px 5%; /* Smaller, consistent padding */
}

.hero {
  min-height: 90vh; /* Keep hero prominent but not too long */
}

.intro-section {
  padding: 80px 5%;
}

.system-selection-section {
  padding: 40px 5%;
  border-bottom: 1px solid var(--border-soft); /* Subtle separator */
}

/* Specific fix for About section on small mobiles */
@media (max-width: 480px) {
  .intro-content h3 { font-size: 1.8em; }
  .about-features-grid { gap: 15px; margin-top: 20px; }
  .feature-item { padding: 20px; }
  .feature-icon { width: 50px; height: 50px; font-size: 1.4em; margin-bottom: 15px; }
  .feature-item h4 { font-size: 1.1em; margin-bottom: 5px; }
}

/* When home content is hidden, disable snapping */
html:has(body #home-content[style*="display: none"]) {
  scroll-snap-type: none;
}

/* Adjust Intro Section for mobile to fit in 100vh */
@media (max-width: 767px) {
  .intro-section {
    padding: 20px 5%;
  }
  .intro-content h3 {
    font-size: 1.6em;
    margin-bottom: 15px;
  }
  .intro-content p {
    font-size: 1em;
  }
}

main {
  padding: 0;
  max-width: none;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Prompt', sans-serif;
  color: var(--heading-color);
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-top: 0;
}

img {
  max-width: 100%;
  height: auto;
}

/* =================================
   Header & Navigation Styles
   ================================= */
header {
  background-color: var(--header-bg);
  color: var(--text-primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border-soft);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.8em 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-logo {
  height: 45px;
  width: auto;
  transition: all 0.3s ease;
  border-radius: 8px;
}

.header-brand h1 {
  font-size: 1.1em;
  margin: 0;
  letter-spacing: 1.5px;
  font-weight: 800;
  line-height: 1.1;
}

.header-brand p {
  font-size: 0.65em;
  margin: 0;
  color: var(--accent-main);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}

.header-nav {
  display: flex;
  gap: 25px;
  align-items: center;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-btn span {
  width: 100%;
  height: 3px;
  background-color: var(--accent-main);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(20px);
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg);
}

.header-nav a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9em;
  transition: color 0.3s;
  letter-spacing: 0.5px;
}

.header-nav a:hover {
  color: var(--accent-main);
}

/* =================================
   Hero Section (Split Layout)
   ================================= */
.hero {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #e2e8f0 100%);
  padding: 80px 0;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 128, 128, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.hero-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
  display: flex;
  flex-direction: column; /* Mobile first */
  align-items: center;
  gap: 40px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-text-side { width: 100%; }

.hero-subtitle {
  display: inline-block;
  color: var(--accent-main);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  font-size: 0.9em;
  margin-bottom: 15px;
  background: rgba(0, 128, 128, 0.1);
  padding: 5px 15px;
  border-radius: 20px;
}

.hero-text-side h2 {
  font-size: 2.8em;
  line-height: 1.1;
  margin-bottom: 25px;
  color: var(--accent-secondary);
  font-weight: 800;
}

.highlight-office {
  color: var(--accent-main);
  font-weight: 700;
  text-decoration: underline; /* Optional: adds even more emphasis */
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.cta-button, .secondary-button {
  display: inline-block;
  padding: 18px 45px;
  border-radius: 40px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05em;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  width: 100%;
  max-width: 280px;
  text-align: center;
  box-sizing: border-box;
}

.cta-button {
  background: linear-gradient(135deg, var(--accent-main) 0%, #006666 100%);
  color: white;
  box-shadow: 0 10px 25px rgba(0, 128, 128, 0.3);
  border: none;
}

.cta-button:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 35px rgba(0, 128, 128, 0.4);
}

.secondary-button {
  background-color: white;
  color: var(--accent-secondary);
  border: 2px solid var(--border-soft);
}

.secondary-button:hover {
  border-color: var(--accent-main);
  color: var(--accent-main);
  background-color: var(--bg-primary);
}

.hero-image-side {
  width: 100%;
  display: flex;
  justify-content: center;
}

.featured-image-wrapper {
  width: 100%;
  max-width: 500px;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.5s ease;
}

.featured-image-wrapper:hover {
  transform: translateY(-10px) rotate(1deg);
}

/* =================================
   Intro Section & About Features
   ================================= */
.intro-section {
  padding: 100px 5%;
  background-color: white;
  text-align: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.intro-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('images/cover.png');
  background-size: cover;
  background-position: center;
  opacity: 0.2; /* Increased opacity for better visibility */
  z-index: -1;
}

.intro-content {
  margin-bottom: 60px;
}

.intro-content h3 {
  font-size: 2.5em;
  margin-top: 10px;
  margin-bottom: 20px;
  color: var(--accent-secondary);
}

.intro-content p {
  font-size: 1.2em;
  color: var(--text-primary); /* Darker text for better contrast */
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8); /* Add text shadow for readability */
}

.about-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 50px;
}

.feature-item {
  background: rgba(255, 255, 255, 0.9); /* More solid white background */
  padding: 40px 30px;
  border-radius: 25px;
  transition: all 0.4s ease;
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  backdrop-filter: blur(10px); /* Stronger blur */
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.feature-item:hover {
  background: white;
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 128, 128, 0.08);
  border-color: var(--accent-main);
}

.feature-icon {
  width: 70px;
  height: 70px;
  background: white;
  color: var(--accent-main);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  margin-bottom: 25px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.03);
  transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
  background: var(--accent-main);
  color: white;
  transform: rotate(10deg) scale(1.1);
}

.feature-item h4 {
  font-size: 1.3em;
  margin-bottom: 15px;
  color: var(--accent-secondary);
}

.feature-item p {
  font-size: 0.95em;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* =================================
   System Selection & Cards
   ================================= */
#system-selection, .system-selection-section {
  text-align: center;
  padding: 80px 0;
}

#system-selection h2, .system-selection-section h2 {
  font-size: 2.2em;
  margin-bottom: 50px;
  position: relative;
  display: inline-block;
}

#system-selection h2::after, .system-selection-section h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background-color: var(--accent-main);
  margin: 15px auto 0;
}

.system-options {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: 1 Column */
  gap: 35px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Large screen: 2 columns */
@media (min-width: 992px) {
  .system-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

.system-card {
  border: 1px solid var(--border-soft);
  border-radius: 25px;
  padding: 0;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  width: 100%;
}

.system-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(0, 128, 128, 0.12);
  border-color: var(--accent-main);
}

/* Inset rounded image area within the card */
.system-card img {
  width: calc(100% - 30px);
  height: 220px;
  object-fit: contain;
  background-color: #f8fafc;
  padding: 20px;
  border-radius: 20px; /* Slightly rounded corners for the image area */
  margin-top: 15px;
  border: 1px solid var(--border-soft);
  transition: all 0.5s ease;
  box-sizing: border-box;
}

.system-card:hover img {
  background-color: #f1f5f9;
  transform: scale(1.03);
  border-color: var(--accent-main);
}

.system-card h3 {
  font-size: 1.4em;
  margin: 25px 20px 20px;
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-secondary);
}

.system-card button {
  background-color: transparent;
  color: var(--accent-main);
  border: 2px solid var(--accent-main);
  padding: 12px 35px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.95em;
  transition: all 0.3s ease;
  font-weight: 700;
  margin-bottom: 30px;
  margin-top: auto;
}

.system-card:hover button {
  background: linear-gradient(135deg, var(--accent-main) 0%, #006666 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 8px 15px rgba(0, 128, 128, 0.2);
}

.system-card-link { text-decoration: none; }

.system-selection-section {
  padding: 60px 5%;
  background-color: var(--bg-primary);
}

.system-selection-section h2 {
  font-size: 2.2em;
  margin-bottom: 40px;
  text-align: center;
}

.system-options-single {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.system-options-single .system-card {
  width: 100%;
}

.system-options-single .system-card-link {
  width: 100%;
  text-decoration: none;
}

/* =================================
   Design Area & Form Styles
   ================================= */
#design-area {
  margin-top: 50px;
  padding: 40px 5%;
  background-color: var(--bg-secondary);
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.05);
}

#back-to-selection {
  background-color: var(--bg-primary);
  color: var(--accent-main);
  border: 1px solid var(--accent-main);
  padding: 10px 25px;
  border-radius: 25px;
  cursor: pointer;
  margin-bottom: 40px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#back-to-selection:hover {
  background-color: var(--accent-main);
  color: white;
}

.design-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.load-input-section, .result-section {
  width: 100%;
  background-color: #fafafa;
  padding: 35px 25px;
  border-radius: 15px;
  border: 1px solid var(--border-soft);
  box-sizing: border-box;
}

.load-form label, #common-params label, #additional-params-off-grid label, #grid-tie-inputs label, #water-system-inputs label {
  display: block;
  margin-bottom: 8px;
  margin-top: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95em;
}

.load-form input, .load-form select, #additional-params-off-grid input, #additional-params-off-grid select, #common-params input, #common-params select, #grid-tie-inputs input, #grid-tie-inputs select, #water-system-inputs input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: white;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1em;
}

.param-description {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-top: 8px;
  font-style: italic;
}

#calculate-btn, .load-form button {
  background-color: var(--accent-main);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 30px;
  width: 100%;
}

#calculate-btn:hover, .load-form button:hover {
  background-color: var(--accent-secondary);
}

/* =================================
   Mobile-First Forms & UI
   ================================= */

/* Increase tap targets for all inputs */
input[type="number"], 
input[type="text"], 
select {
  height: 50px; /* Taller inputs for fingers */
  font-size: 16px !important; /* Prevent iOS auto-zoom */
  padding: 12px 15px;
  border: 2px solid var(--border-soft); /* Thicker border for clarity */
  border-radius: 12px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.1);
}

/* Thumb-friendly buttons */
.load-form button, 
#calculate-btn, 
#back-to-selection,
.secondary-button {
  padding: 16px 20px;
  min-height: 55px;
  font-size: 1.1em;
  border-radius: 15px;
}

/* Re-design Load Input Area for Mobile */
.load-form-grid {
  display: grid;
  grid-template-columns: 1fr; /* Vertical on mobile */
  gap: 15px;
}

@media (min-width: 768px) {
  .load-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =================================
   Responsive Table (Card Layout on Mobile)
   ================================= */
#load-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 25px;
  border: none;
  display: block; /* Allows responsive behavior */
}

/* Desktop View (Standard Table) */
@media (min-width: 768px) {
  #load-summary-table {
    display: table;
    border: 1px solid var(--border-soft);
    border-radius: 15px;
    overflow: hidden;
  }
  
  #load-summary-table thead {
    display: table-header-group;
  }
  
  #load-summary-table tr {
    display: table-row;
  }
  
  #load-summary-table td, #load-summary-table th {
    display: table-cell;
    padding: 15px;
    border-bottom: 1px solid var(--border-soft);
  }
}

/* Mobile View (Card Layout) */
@media (max-width: 767px) {
  #load-summary-table thead {
    display: none; /* Hide headers on mobile */
  }
  
  #load-summary-table tbody {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  #load-summary-table tr {
    display: block;
    background: white;
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
    position: relative;
  }
  
  #load-summary-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-soft);
    font-size: 0.95em;
  }
  
  #load-summary-table td:last-child {
    border-bottom: none;
    padding-top: 15px;
    justify-content: center;
  }
  
  /* Add labels for mobile cards */
  #load-summary-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.85em;
  }

  /* Make 'Delete' button look like a real button on mobile */
  #load-summary-table td button {
    width: 100%;
    background-color: #fff5f5;
    color: #e03131;
    border: 1px solid #ffa8a8;
    padding: 10px;
    border-radius: 10px;
    font-weight: 600;
  }
}

/* =================================
   Results & Diagram Styles
   ================================= */
.results-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

#calculation-details div {
  margin-bottom: 12px;
  padding: 15px;
  background-color: #f3f0ec;
  border-left: 4px solid var(--accent-main);
  border-radius: 5px;
}

.system-diagram-container {
  position: relative;
  text-align: center;
}

#system-diagram {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: white;
  padding: 10px;
}

#diagram-overlay { position: relative; display: inline-block; }

.overlay-text {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--accent-main);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.6em;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Position definitions (Keep existing) */
.overlay-text.solar-panels { top: 15%; left: 26.3%; }
.overlay-text.charge-controller { top: 32%; left: 35%; }
.overlay-text.battery { top: 82%; left: 46%; }
.overlay-text.inverter { top: 73%; left: 74%; }
.overlay-text.ac-load { top: 64%; left: 85%; }
.overlay-text.dc-load { top: 80%; left: 23%; }
.overlay-text.og-pv-fuse { top: 68%; left: 8%; }
.overlay-text.og-dc-surge { top: 32%; left: 15%; }
.overlay-text.og-pv-breaker { top: 32%; left: 25%; }
.overlay-text.og-ctrl-batt-breaker { top: 32%; left: 46%; }
.overlay-text.og-batt-inv-breaker { top: 32%; left: 55%; }
.overlay-text.og-ac-surge { top: 10%; left: 75%; }
.overlay-text.og-ac-breaker { top: 10%; left: 86%; }
.overlay-text.og-ac-fuse { top: 10%; left: 65%; }
.overlay-text.gridtie-inverter { top: 81%; left: 47%; }
.overlay-text.gt-pv-fuse { top: 77%; left: 8%; }
.overlay-text.gt-dc-surge { top: 80%; left: 25%; }
.overlay-text.gt-dc-breaker { top: 36%; left: 28%; }
.overlay-text.hy-solar { top: 18%; left: 20%; }
.overlay-text.hy-inverter { top: 40%; left: 50%; }
.overlay-text.hy-battery { top: 80%; left: 50%; }
.overlay-text.hy-meter { top: 25%; left: 78%; }
.overlay-text.hy-dc-breaker { top: 55%; left: 28%; }
.overlay-text.hy-batt-breaker { top: 65%; left: 38%; }
.overlay-text.hy-ac-breaker { top: 55%; left: 78%; }
.overlay-text.hy-pv-fuse { top: 45%; left: 15%; }
.overlay-text.hy-dc-surge { top: 58%; left: 15%; }
.overlay-text.hy-ac-fuse { top: 45%; left: 68%; }
.overlay-text.hy-ac-surge { top: 58%; left: 68%; }
.overlay-text.ws-solar { top: 20%; left: 18%; }
.overlay-text.ws-pump { top: 70%; left: 42%; }
.overlay-text.ws-main-pipe { top: 50%; left: 65%; }
.overlay-text.ws-submain-pipe { top: 60%; left: 80%; }
.overlay-text.ws-sprinkler-pipe { top: 40%; left: 88%; }

/* =================================
   Footer Styles
   ================================= */
footer {
  background-color: var(--footer-bg);
  color: #ffffff;
  padding: 30px 5%; /* Reduced vertical padding */
  border-top: 4px solid var(--accent-main);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px; /* Reduced gap between items */
  align-items: center;
  text-align: center;
}

.footer-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer-image-container {
  width: 70px; /* Slightly smaller profile image */
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.footer-brand h3 {
  color: #fff;
  margin: 0;
  font-size: 1.2em;
}

.footer-brand p {
  color: #a0aec0;
  font-weight: 500;
  font-size: 0.9em;
  margin: 5px 0 0 0;
  line-height: 1.5;
}

.footer-center {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Reduced internal gap */
  width: 100%;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 20px; /* Adjusted gap */
}

.footer-links a {
  color: #ffffff; /* Changed link color to white */
  text-decoration: none;
  font-size: 0.9em;
  transition: opacity 0.3s;
  font-weight: 500;
}

.footer-links a:hover {
  opacity: 0.8;
  color: var(--accent-main);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.footer-social a {
  color: #fff;
  font-size: 1.2em;
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.footer-right {
  color: #a0aec0;
  font-size: 0.8em;
  line-height: 1.5;
}

.footer-right p {
  margin: 2px 0; /* Reduced vertical margin */
}

/* Tablet & Desktop Footer */
@media (min-width: 768px) {
  footer { padding: 40px 5%; } /* Slightly more padding for larger screens */
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    align-items: center;
  }
  .footer-left { align-items: center; flex-direction: row; }
  .footer-brand h3 { font-size: 1.3em; }
  .footer-links { justify-content: flex-start; }
  .footer-social { justify-content: flex-start; }
  .footer-center { width: auto; align-items: flex-start; gap: 10px; }
  .footer-right { text-align: right; }
}

/* =================================
   Back to Top Button
   ================================= */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--accent-main);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  z-index: 1000;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#back-to-top:hover {
  background-color: var(--accent-secondary);
  transform: scale(1.1);
}

/* =================================
   Scroll Reveal Animation
   ================================= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =================================
   Media Queries (Responsive)
   ================================= */

/* Mobile Phones (max-width: 767px) */
@media (max-width: 767px) {
  .header-logo {
    height: 35px;
  }

  .header-brand h1 {
    font-size: 0.9em;
  }

  .header-brand p {
    font-size: 0.55em;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .hero-text-side h2 {
    font-size: 1.8em;
  }

  .hero-text-side p {
    font-size: 1em;
  }

  .header-nav {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--header-bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    transition: 0.3s ease-in-out;
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    padding: 40px 0;
  }

  .header-nav.active {
    right: 0;
  }

  .header-nav a {
    font-size: 1.2em;
  }

  .manual-link {
    margin-left: 0 !important;
  }
}

/* Tablets (min-width: 768px) */
@media (min-width: 768px) {
  .header-logo { height: 55px; }
  .header-brand h1 { font-size: 1.3em; }
  .hero-container { text-align: left; }
  .hero-text-side h2 { font-size: 3.5em; }
  .hero-actions { flex-direction: row; }
  .cta-button, .secondary-button { width: auto; }
  .system-options { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: row; justify-content: space-between; text-align: left; align-items: flex-start; }
}

/* Large Tablets / Desktops (min-width: 1024px) */
@media (min-width: 1024px) {
  .hero { padding: 100px 0; }
  .hero-container { flex-direction: row; gap: 80px; }
  .hero-text-side { flex: 1.2; }
  .hero-image-side { flex: 0.8; }
  .system-options { grid-template-columns: repeat(3, 1fr); }
  .design-content { flex-direction: row; align-items: flex-start; }
  .load-input-section { flex: 1; }
  .result-section { flex: 1.2; }
}

/* Large Desktops (min-width: 1280px) */
@media (min-width: 1280px) {
  .header-logo { height: 65px; }
  .hero-text-side h2 { font-size: 4.5em; }
  .system-options { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}

/* =================================
   Special Calculation & Result Styles
   ================================= */
.savings-summary {
  background-color: var(--accent-secondary) !important;
  color: white !important;
  border-left: 4px solid var(--text-primary) !important;
  padding: 20px !important;
  border-radius: 8px;
  margin-top: 20px;
}

.savings-summary strong, .savings-summary .calculation {
  color: white !important;
}

.calculation {
  color: #556b2f;
  font-style: italic;
  font-size: 0.9em;
}

.recommendation {
  font-weight: bold;
  color: var(--accent-main);
  margin-top: 5px;
}

/* =================================
   Modal Popup Styles
   ================================= */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(26, 54, 93, 0.8); /* Midnight Blue overlay */
  backdrop-filter: blur(5px);
}

.modal-content {
  background-color: var(--bg-secondary);
  margin: 10% auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modalScale 0.3s ease-out;
  overflow: hidden;
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 25px 40px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5em;
  color: var(--accent-secondary);
}

.close-modal {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--accent-main);
}

.modal-body {
  padding: 40px;
}

.step-item {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.step-item:last-child {
  margin-bottom: 0;
}

.step-number {
  background-color: var(--accent-main);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
  margin-top: 5px;
}

.step-text h4 {
  margin: 0 0 10px 0;
  color: var(--accent-secondary);
  font-size: 1.1em;
}

.step-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95em;
  line-height: 1.6;
}

.modal-footer {
  padding: 20px 40px;
  background-color: var(--bg-primary);
  text-align: right;
  border-top: 1px solid var(--border-soft);
}

.close-modal-btn {
  background-color: var(--accent-secondary);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s;
}

.close-modal-btn:hover {
  background-color: var(--accent-main);
}

.manual-link {
  color: var(--accent-main) !important;
  border: 1px solid var(--accent-main);
  padding: 8px 18px !important;
  border-radius: 20px;
  margin-left: 10px;
}

.manual-link:hover {
  background-color: var(--accent-main);
  color: white !important;
}

/* =================================
   Knowledge Hub Enhanced Styles
   ================================= */
.knowledge-hero {
  background: linear-gradient(135deg, var(--accent-secondary) 0%, #2d3748 100%);
  color: white;
  padding: 80px 0 60px;
  text-align: center;
}

.knowledge-hero h2 {
  color: white !important;
  font-size: 3em;
  margin-bottom: 20px;
}

.knowledge-hero p {
  color: #cbd5e0 !important;
  font-size: 1.2em;
  max-width: 700px;
  margin: 0 auto;
}

.knowledge-hub {
  padding: 60px 0;
  background-color: var(--bg-primary);
}

.knowledge-hub .knowledge-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.knowledge-hub .knowledge-card {
  background: white;
  padding: 0;
  border-radius: 25px;
  border: 1px solid var(--border-soft);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  overflow: hidden;
  text-align: center;
}

.knowledge-hub .knowledge-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(0, 128, 128, 0.12);
  border-color: var(--accent-main);
}

.knowledge-hub .knowledge-icon {
  width: 100%;
  height: 280px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border-soft);
}

.knowledge-hub .knowledge-card:hover .knowledge-icon {
  background: #f1f5f9;
}

.knowledge-hub .knowledge-icon img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.knowledge-hub .knowledge-card:hover .knowledge-icon img {
  transform: scale(1.15);
}

.knowledge-hub .knowledge-card h3 {
  font-size: 1.6em;
  margin: 25px 25px 15px;
  color: var(--accent-secondary);
}

.knowledge-hub .knowledge-card p {
  color: var(--text-secondary);
  font-size: 1.05em;
  margin: 0 25px 30px;
  line-height: 1.6;
}

.knowledge-hub .read-lesson-btn {
  margin: auto 25px 30px;
  width: calc(100% - 50px);
  background-color: transparent;
  color: var(--accent-main);
  border: 2px solid var(--accent-main);
  padding: 14px 0;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
}

.knowledge-hub .knowledge-card:hover .read-lesson-btn {
  background: linear-gradient(135deg, var(--accent-main) 0%, #006666 100%);
  color: white;
  border-color: transparent;
  box-shadow: 0 10px 20px rgba(0, 128, 128, 0.2);
}

.knowledge-footer {
  margin-top: 60px;
  text-align: center;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent-main) 0%, #006666 100%);
  color: white !important;
  padding: 15px 40px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  box-shadow: 0 10px 25px rgba(0, 128, 128, 0.3);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.back-home-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 128, 128, 0.4);
}

/* =================================
   Knowledge Article & Lesson UI
   ================================= */
.knowledge-content-container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.knowledge-article {
  background: white;
  padding: 50px;
  border-radius: 30px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.03);
  border: 1px solid var(--border-soft);
}

.knowledge-article h2 {
  font-size: 2.2em;
  color: var(--accent-secondary);
  margin-bottom: 25px;
  line-height: 1.3;
}

.knowledge-article h3 {
  font-size: 1.5em;
  color: var(--accent-main);
  margin-top: 40px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-primary);
}

.knowledge-article p {
  margin-bottom: 20px;
  color: var(--text-primary);
  line-height: 1.9;
}

.knowledge-article img {
  border-radius: 20px;
  margin: 30px 0;
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
  transition: transform 0.3s ease;
}

.knowledge-article img:hover {
  transform: scale(1.02);
}

.lesson-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 50px;
  gap: 20px;
}

.lesson-nav-btn {
  flex: 1;
  padding: 18px 25px;
  border-radius: 15px;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-soft);
  background: white;
  color: var(--text-primary);
}

.lesson-nav-btn:hover {
  background: var(--bg-primary);
  border-color: var(--accent-main);
  color: var(--accent-main);
  transform: translateY(-3px);
}

.lesson-nav-btn.primary {
  background: linear-gradient(135deg, var(--accent-main) 0%, #006666 100%);
  color: white;
  border: none;
}

.lesson-nav-btn.primary:hover {
  box-shadow: 0 10px 25px rgba(0, 128, 128, 0.25);
  filter: brightness(1.1);
}

@media (max-width: 768px) {
  .knowledge-article {
    padding: 30px 20px;
  }
  .lesson-navigation {
    flex-direction: column;
  }
}

/* =================================
   Common Fixes & Example Box
   ================================= */
.header-logo-link {
  text-decoration: none;
  display: block;
}
.header-logo-link:hover .header-brand h1 {
  color: var(--accent-main);
}

.example-box {
  background-color: #fff9db;
  border: 2px dashed #fcc419;
  border-radius: 15px;
  padding: 20px;
  position: relative;
}

.example-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #e67e22;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.example-body {
  font-size: 0.95em;
  color: #5c5c5c;
  line-height: 1.6;
}

.example-body strong {
  color: var(--accent-secondary);
}

/* =================================
   Credits Page Styles
   ================================= */
.credits-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 5%;
  text-align: center;
}

.credits-intro {
  color: var(--text-secondary);
  font-size: 1.1em;
  margin-bottom: 50px;
  line-height: 1.8;
}

.credits-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.credit-card {
  background: white;
  padding: 35px 25px;
  border-radius: 25px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.credit-card:hover {
  transform: translateY(-5px);
}

.credit-image-container {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--bg-primary);
  margin-bottom: 20px;
  border: 3px solid var(--accent-main);
  box-shadow: 0 8px 15px rgba(0, 128, 128, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.credit-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-placeholder {
  font-size: 2.5em;
  color: var(--text-secondary);
}

.credit-card h3 {
  font-size: 1.1em;
  color: var(--accent-main);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.credit-name {
  font-weight: 700;
  color: var(--accent-secondary);
  margin-bottom: 5px;
  font-size: 1.1em;
}

.credit-title {
  font-size: 0.9em;
  color: var(--text-secondary);
}

.reference-card {
  grid-column: 1 / -1; /* Span full width */
  text-align: left;
  align-items: flex-start;
}

.ref-list {
  list-style: none;
  padding: 0;
  width: 100%;
}

.ref-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-soft);
  color: var(--text-primary);
  font-size: 0.95em;
}

.ref-list li:last-child { border-bottom: none; }

.rating-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  width: 100%;
}
.rating-section h4 {
  margin-bottom: 15px;
  font-size: 1.1em;
  color: #fff;
}
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 10px;
}
.star-rating input {
  display: none;
}
.star-rating label {
  font-size: 2.5em;
  color: #444;
  cursor: pointer;
  transition: color 0.2s ease;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #fcc419;
}
