/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;800&display=swap');

/* CSS Variables & Theming */
:root {
  /* Light Theme */
  --bg-color: #f4f7fb;
  --surface-color: rgba(255, 255, 255, 0.85);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --border-color: rgba(148, 163, 184, 0.2);
  
  /* Primary Brand Colors */
  --primary-accent: #0284c7; /* Electric blueish */
  --primary-hover: #0369a1;
  --gradient-bg: linear-gradient(135deg, #e0f2fe 0%, #f0fdf4 100%);
  --shadow-color: rgba(0, 0, 0, 0.05);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-color: #0f172a;
  --surface-color: rgba(30, 41, 59, 0.75);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --border-color: rgba(255, 255, 255, 0.1);
  --primary-accent: #38bdf8;
  --primary-hover: #7dd3fc;
  --gradient-bg: linear-gradient(135deg, #020617 0%, #0f172a 100%);
  --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-color);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

a {
  color: var(--primary-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Nav */
header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface-color);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  color: var(--primary-accent);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-primary);
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--primary-accent);
  text-decoration: none;
}

/* Mobile Menu */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: rgba(148, 163, 184, 0.1);
}

#icon-moon {
  display: none;
}
[data-theme="dark"] #icon-sun {
  display: none;
}
[data-theme="dark"] #icon-moon {
  display: block;
}

/* CTA Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-accent);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-heading);
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

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

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
  background: linear-gradient(to right, var(--primary-accent), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Main Calculator Tool Area */
.tool-section {
  padding: 2rem 0;
}

.glass-card {
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: 0 10px 40px var(--shadow-color);
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

/* Form Elements */
.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.input-group input[type="number"],
.input-group select {
  width: 100%;
  padding: 0.875rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

/* Switch for AC/Heater */
.switch-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
  border-radius: 34px;
}
[data-theme="dark"] .slider {
  background-color: #475569;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary-accent);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Results Area */
.results-area {
  background: var(--bg-color);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid var(--border-color);
}

.huge-result {
  font-size: 4rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--primary-accent);
  line-height: 1;
  margin: 1rem 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  margin-top: 1.5rem;
}

.metric {
  background: var(--surface-color);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.metric span {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.metric strong {
  display: block;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

/* Adsense Placeholders */
.ad-slot {
  width: 100%;
  background: rgba(148, 163, 184, 0.1);
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  border-radius: 8px;
  font-size: 0.875rem;
}

.ad-slot.top { height: 90px; }
.ad-slot.square { height: 250px; max-width: 300px; margin: 2rem auto; }

/* SEO Content Section */
.content-section {
  padding: 4rem 0;
}

.content-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.content-wrapper h2 {
  font-size: 2rem;
  margin-top: 3rem;
}

.content-wrapper h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

.content-wrapper p, .content-wrapper ul {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.content-wrapper ul {
  padding-left: 1.5rem;
}

/* FAQ Accordion */
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: var(--surface-color);
}

.faq-title {
  padding: 1.25rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-content {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item.active .faq-content {
  padding: 0 1.25rem 1.25rem;
  max-height: 500px;
}

/* Newsletter Section */
.newsletter {
  background: var(--primary-accent);
  color: white;
  padding: 4rem 0;
  text-align: center;
  border-radius: var(--radius);
  margin: 4rem 0;
}

.newsletter h3 {
  color: white;
  font-size: 2.25rem;
}

.newsletter p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 1rem;
  border-radius: 9999px;
  border: none;
  font-size: 1rem;
  outline: none;
}

.newsletter-form .btn {
  background: #0f172a;
}

.newsletter-form .btn:hover {
  background: #1e293b;
}
[data-theme="dark"] .newsletter-form .btn {
  background: white;
  color: #0f172a;
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  background: var(--surface-color);
  text-align: center;
}

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

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-copy {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Page Standard Layout (for about, terms, etc.) */
.page-header {
  padding: 5rem 0 3rem;
  text-align: center;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 3rem;
}

.page-content {
  max-width: 800px;
  margin: 0 auto 5rem;
}

.page-content p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.page-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .hamburger {
    display: block;
  }

  .newsletter-form {
    flex-direction: column;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
}
