:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --accent: #f59e0b;
  --dark: #1e293b;
  --light: #f8fafc;
  --white: #ffffff;
  --text: #334155;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background-color: #ffffff;
}

a {
  text-decoration: none;
}

.container {
  width: 90%;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Header Styles ===== */
.header {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
}

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

.nav-list {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-cta {
  background: var(--primary);
  color: white !important;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  transition: transform 0.2s ease;
  margin-left: 1rem;
}

.nav-cta:hover {
  transform: translateY(-2px);
  background: var(--primary-dark);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  padding: 1rem;
  cursor: pointer;
  background: transparent;
  border: 0;
  z-index: 1001;
}

.hamburger-box {
  width: 30px;
  height: 24px;
  display: inline-block;
  position: relative;
}

.hamburger-inner {
  width: 100%;
  height: 2px;
  background: var(--dark);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.2s ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
  content: "";
  width: 100%;
  height: 2px;
  background: inherit;
  position: absolute;
  left: 0;
  transition: transform 0.3s ease;
}

.hamburger-inner::before {
  top: -8px;
}

.hamburger-inner::after {
  top: 8px;
}

/* ===== Hero Section ===== */
.hero {
  padding: 160px 0 80px;
  background: linear-gradient(to bottom right, var(--light) 50%, #ffffff 50%);
  border-bottom: #ebeff5 1px solid;
}

.hero-content {
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  color: var(--dark);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2.5rem;
}

/* ===== Calculator Styles ===== */
.calculator-detail {
  padding: 4rem 0;
}

.calculator-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 3rem;
}

.calculator-header {
  text-align: center;
  margin-bottom: 2rem;
}

.calculator-version {
  color: var(--text-light);
  font-size: 0.9rem;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.calculator-form {
  width: 100%;
  margin: 0 auto 3rem;
  padding-right: 2rem;
  border-right: 2px solid var(--border);
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
}

.input-group select {
  margin-top: 0.5rem;
  background: var(--light);
}

.location-group {
  position: relative;
}

.location-button {
  background: var(--light);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  color: var(--text);
}

.location-button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.location-status {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  margin: 0 auto;
  justify-content: center;
}

.cta-button {
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid transparent;
  cursor: pointer;
}

.cta-button:not(.secondary) {
  background: var(--primary);
  color: white;
}

.cta-button:not(.secondary):hover {
  background: var(--primary-dark);
}

.cta-button.secondary {
  background: var(--light);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.cta-button.secondary:hover {
  background: var(--primary);
  color: white;
}

.calculator-results {
  background: var(--light);
  padding: 2rem;
  border-radius: 0.5rem;
}

.result-overview {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

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

.overview-label {
  font-weight: 500;
  color: var(--text);
}

.overview-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

/* Results Section Styles */
.results-section {
  margin: 3rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.result-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.card-header {
  background: var(--primary);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.card-header h3 {
  margin: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.card-content {
  padding: 2rem;
}

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

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

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

.spec-label {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.spec-value {
  font-weight: 700;
  color: var(--primary);
  text-align: right;
  min-width: 100px;
}

/* Guide Section */
.guide-section {
  background: var(--light);
  padding: 2rem;
  border-radius: 1rem;
  margin: 3rem 0;
}

.guide-section h2 {
  font-size: 1.75rem;
  color: var(--dark);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.guide-card {
  background: white;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

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

.guide-card ul {
  padding-left: 1.5rem;
  color: var(--text-light);
}

.guide-card li {
  margin-bottom: 0.5rem;
}

/* Theory Section */
.explanation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin: 4rem 0;
}

.theory-section.enhanced {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
}

.theory-cards {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.theory-card {
  padding: 1.5rem;
  background: var(--light);
  border-radius: 0.75rem;
}

.theory-card h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theory-card ul {
  list-style: none;
  padding-left: 1rem;
}

.theory-card li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.theory-card li::before {
  content: "•";
  color: var(--primary);
  position: absolute;
  left: 0;
}

.formula-section {
  background: var(--light);
  padding: 2rem;
  border-radius: 0.5rem;
}

.formula-box {
  background: white;
  padding: 1.5rem;
  margin: 1rem 0;
  border-radius: 0.5rem;
  font-family: monospace;
  font-size: 1.1rem;
  border: 1px dashed var(--primary);
}

.formula {
  color: var(--primary);
  font-weight: 600;
  display: inline-block;
  margin-top: 0.5rem;
  font-family: monospace;
  font-size: 1.1rem;
  background: rgba(37, 99, 235, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.calculation-example {
  background: var(--light);
  padding: 1.5rem;
  border-radius: 0.75rem;
  margin-top: 1.5rem;
  border-left: 4px solid var(--accent);
}

.calculation-example h4 {
  color: var(--dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.example-steps {
  color: var(--text-light);
  line-height: 1.6;
}

.example-steps p {
  margin: 0.5rem 0;
}

/* FAQ Section */
.faq-section {
  margin: 4rem 0;
}

.faq-section h2 {
  font-size: 1.75rem;
  color: var(--dark);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
}

.faq-question {
  padding: 1.5rem;
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-question h3 {
  font-size: 1.1rem;
  color: var(--dark);
  font-weight: 600;
}

.faq-toggle {
  color: var(--primary);
  transition: transform 0.3s;
}

.faq-item.active .faq-toggle {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  background: var(--light);
}

.faq-item.active .faq-answer {
  padding: 1.5rem;
  max-height: 500px;
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--dark);
  margin-bottom: 1rem;
}

/* Cards Container */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
}

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

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

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: gap 0.3s;
}

.card-link:hover {
  gap: 1rem;
}

/* ===== Footer ===== */
.footer {
  background: var(--dark);
  color: #cbd5e0;
}

.footer-top {
  padding: 4rem 0;
  border-bottom: 1px solid #4a5568;
}

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

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-brand .logo {
  color: white;
}

.footer-text {
  color: var(--white);
  line-height: 1.6;
}

.footer-col h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-col a {
  color: var(--light);
  text-decoration: none;
  transition: color 0.3s;
}

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

.footer-bottom {
  padding: 2rem 0;
}

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

.copyright {
  color: var(--light);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: #cbd5e0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
}

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

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

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

  .results-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: white;
    padding: 2rem;
    transition: left 0.3s ease;
  }

  .nav.active {
    left: 0;
  }

  .nav-list {
    flex-direction: column;
    gap: 1.5rem;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .cards-container {
    grid-template-columns: 1fr;
  }

  .footer-bottom .container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .nav-cta {
    margin-left: 0;
  }

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

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

  .theory-cards {
    grid-template-columns: 1fr;
  }

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

  .calculator-form {
    padding-right: 0;
    border-right: none;
    border-bottom: 2px solid var(--border);
    padding-bottom: 2rem;
  }

  .calculator-results {
    padding: 1rem;
  }

  .results-section {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .result-card {
    min-width: unset;
  }

  .calculator-card,
  .guide-section,
  .explanation-grid,
  .section-header {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .container {
    width: 100% !important;
    padding: 0 1rem !important;
  }

  .input-group input,
  .input-group select {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .button-group {
    flex-direction: column;
  }

  .cta-button {
    width: 100%;
    justify-content: center;
  }

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

  .results-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .spec-grid {
    gap: 0.75rem;
  }

  .spec-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .spec-value {
    text-align: left;
    min-width: unset;
  }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate {
  animation: fadeInUp 0.6s ease forwards;
}
