/* ===================================
   CSS VARIABLES & BRAND COLORS
   =================================== */

:root {
  /* Brand colors */
  --color-primary: #E63946;
  --color-secondary: #FF8C00;
  --color-secondary-light: #f7bc55;
  --color-tertiary: #ffffff;
  
  /* Neutral colors */
  --color-white: #ffffff;
  --color-white-bg: #f3f4f6;
  --color-white-border: #e5e7eb;
  --color-gray: #6b7280;
  --color-black: #111827;
}

/* ===================================
   BASE STYLES
   =================================== */

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

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

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  color: var(--color-black);
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-black);
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
}

/* ===================================
   LAYOUT UTILITIES
   =================================== */

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

main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  min-height: 70px;
  background: var(--color-black);
  color: var(--color-white);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Logo and brand container */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-white);
}

.brand img {
  height: 50px;
  width: auto;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.brand img:hover {
  transform: scale(1.06);
  filter: drop-shadow(0 0 6px rgba(255, 140, 0, 0.7));
}

.logo {
  height: 50px;
}

.logo-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-title span {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
}

.logo-title small {
  font-size: 0.75rem;
  color: #9CA3AF;
  font-weight: 400;
}

/* Navigation */
nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-links a {
  color: var(--color-white-bg);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--color-secondary);
}

/* Active page styling - add this class to current page link */
.nav-links a.active {
  color: var(--color-secondary);
  font-weight: 600;
}

/* Prevent dropdown parent from being highlighted */
.nav-dropdown > a.active {
  color: var(--color-white-bg);
  font-weight: normal;
}

/* Dropdown menu styles */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-dropdown > a::after {
  content: '▾';
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover > a::after {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-black);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 200px;
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: var(--color-white-bg);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: rgba(255, 140, 0, 0.1);
  color: var(--color-secondary);
}

.dropdown-menu a.active {
  color: var(--color-secondary);
  font-weight: 600;
}

/* Hamburger Button - Hidden by default on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--color-white);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Hamburger animation when active */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ===================================
   FOOTER
   =================================== */

footer {
  background: var(--color-black);
  color: var(--color-white);
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  color: #111827;
}

.btn-secondary {
  background: #111827;
  color: #f9fafb;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* ===================================
   HERO SECTION
   =================================== */

.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-section h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  color: white !important;
}

.hero-section .lead {
  font-size: 1.25rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0.95;
  line-height: 1.6;
}

/* Homepage Hero */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  padding: 6rem 0;
  text-align: center;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  color: white !important;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  line-height: 1.6;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-note {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-top: 1.5rem;
}

/* ===================================
   HOMEPAGE ICONS
   =================================== */

.icon {
  height: 75px;
}

/* ===================================
   HOMEPAGE CALCS SECTION
   =================================== */

.calc-section {
  padding: 5rem 0;
  background: white;
}

.calc-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.calc-card {
  background: #f9f9f9;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.calc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

.calc-card h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.calc-card p {
  color: #666;
  line-height: 1.6;
}

/* ===================================
   ABOUT PAGE
   =================================== */

.about-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--color-black);
}

.about-page h1 {
  color: var(--color-black);
  margin-bottom: 0.5rem;
}

.about-page .page-subtitle {
  color: var(--color-gray);
  opacity: 0.85;
  margin-top: 0.25rem;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.about-page h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.about-page p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.about-page ul, .about-page ol {
  margin-bottom: 1rem;
  margin-left: 1.5rem;
  line-height: 1.7;
}

.about-page li {
  margin-bottom: 0.5rem;
}

.about-page .disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.03);
  border-left: 4px solid var(--color-secondary);
  border-radius: 6px;
  font-size: 0.95rem;
}

/* ===================================
   OTHER COMPONENTS
   =================================== */

.card {
  background: var(--color-white);
  border-radius: 12px;
  padding: 20px 20px 18px;
  border: 1px solid var(--color-white-border);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 10px;
}

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

label {
  display: block;
  font-size: 13px;
  color: var(--color-gray);
  margin-top: 8px;
}

input, select {
  width: 100%;
  margin-top: 3px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--color-white-border);
  font-size: 13px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row > div {
  flex: 1;
}

.helper {
  font-size: 11px;
  color: var(--color-gray);
  margin-top: 2px;
}

.results {
  margin-top: 14px;
  border-top: 1px solid var(--color-white-border);
  padding-top: 10px;
  font-size: 13px;
}

.results h3 {
  margin: 6px 0 4px;
  font-size: 14px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 16px;
  margin-top: 6px;
}

.result-label {
  color: var(--color-gray);
}

.result-value {
  font-weight: 600;
}

.chart-wrap {
  position: relative;
  height: 260px;
}

.chart-wrap canvas {
  width: 100%;
  max-width: 100%;
  height: 100%;
  border-radius: 10px;
  border: 1px solid var(--color-white-border);
  background: #f9fafb;
}

.banner {
  background: #facc15;
  color: #1f2937;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 968px) {
  /* Show hamburger on tablets and mobile */
  .hamburger {
    display: flex;
  }

  /* Navigation adjustments */
  nav {
    position: relative;
  }

  /* Hide nav links by default on mobile */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 70%;
    max-width: 300px;
    background: var(--color-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: 5rem 2rem 2rem;
    gap: 0;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    overflow-y: auto;
  }

  /* Show nav links when menu is active */
  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    font-size: 1.1rem;
    color: var(--color-white);
    padding: 1rem 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Dropdown in mobile menu */
  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown > a::after {
    margin-left: auto;
  }

  .dropdown-menu {
    position: static;
    display: none;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
  }

  .nav-dropdown.active .dropdown-menu {
    display: block;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-menu a {
    padding-left: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Logo adjustments for mobile */
  .brand img {
    height: 40px;
  }

  .logo {
    height: 40px;
  }

  .logo-title span {
    font-size: 1.2rem;
  }

  .logo-title small {
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  /* Header padding */
  header {
    padding: 0.5rem 1rem;
  }

  /* Container adjustments */
  .container {
    padding: 0 1rem;
  }

  /* About page mobile */
  .about-page {
    padding: 1.5rem 1rem;
  }

  /* Hero adjustments */
  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  /* Calc grid mobile */
  .calc-grid {
    grid-template-columns: 1fr;
  }
}
