:root {
  --bg-page: #F8FAFC;
  --bg-hero-start: #F0FDFA;
  --bg-hero-end: #F1F5F9;
  --bg-card: #FFFFFF;
  --primary-accent: #0D9488;
  --primary-accent-light: #CCFBF1;
  --text-dark: #1E293B;
  --text-medium: #475569;
  --text-light: #94A3B8;
  --border-color: #E2E8F0;
  --error-bg: #FEF2F2;
  --error-text: #DC2626;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-medium);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  color: var(--text-dark);
  line-height: 1.2;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

h2.section-title {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  margin-bottom: 1.25rem;
}

h3.subsection-title {
  font-size: clamp(1rem, 3vw, 1.1rem);
  margin-bottom: 0.75rem;
}

/* Navigation */
.navbar {
  background-color: var(--bg-card);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem clamp(0.75rem, 3vw, 1rem);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo {
  height: 32px;
  width: auto;
}

.brand-name {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 1.1rem;
}

/* Navigation Toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 0.25rem;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-dark);
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Navigation Slider */
.nav-slider {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background-color: var(--bg-card);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-in-out;
  z-index: 1001;
  overflow-y: auto;
}

.nav-slider.active {
  right: 0;
}

.slider-content {
  padding: 1.5rem;
  height: 100%;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.slider-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0.5rem;
}

.slider-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-link {
  display: block;
  padding: 1rem;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.slider-link:hover, .slider-link.active {
  background-color: var(--primary-accent-light);
  color: var(--primary-accent);
}

/* Overlay when slider is open */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Layout */
main {
  padding: 0.75rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.card {
  background-color: var(--bg-card);
  border-radius: 0.75rem;
  padding: clamp(0.75rem, 3vw, 1.25rem);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  width: 100%;
}

.main-card {
  border-top: 4px solid var(--primary-accent);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  width: 100%;
}

@media (min-width: 768px) {
  main {
    padding: 1rem;
  }
  .main-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* Form Styles */
.form-section {
  width: 100%;
}

.input-group {
  margin-bottom: 1.5rem;
}

.form-section label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(0.8rem, 2.5vw, 0.875rem);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-section input {
  width: 100%;
  padding: clamp(0.5rem, 2vw, 0.75rem);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  background-color: var(--bg-page);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-section input:focus {
  outline: none;
  background-color: white;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px var(--primary-accent-light);
}

/* Tip Percentage Options */
.tip-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 480px) {
  .tip-options {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tip-option {
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  user-select: none;
}

.tip-option:hover {
  background-color: var(--primary-accent-light);
  border-color: var(--primary-accent);
}

.tip-option.active {
  background-color: var(--primary-accent);
  color: white;
  border-color: var(--primary-accent);
}

.custom-tip-input {
  grid-column: 1 / -1;
  position: relative;
}

.custom-tip-input input {
  margin-bottom: 0;
  padding-right: 2.5rem;
}

.custom-tip-input::after {
  content: '%';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-weight: 500;
  pointer-events: none;
}

/* Results Section */
.results-section {
  width: 100%;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.5rem, 2vw, 0.75rem);
  margin-bottom: 1.5rem;
  width: 100%;
}

@media (min-width: 480px) {
  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.result-box {
  text-align: center;
  padding: clamp(0.5rem, 2vw, 0.75rem);
  background-color: var(--bg-page);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  width: 100%;
}

.result-box.primary {
  background-color: var(--primary-accent-light);
  border-color: var(--primary-accent);
}

.result-label {
  font-size: clamp(0.7rem, 2vw, 0.75rem);
  color: var(--text-medium);
  margin-bottom: 0.25rem;
}

.result-value {
  font-size: clamp(0.875rem, 3vw, 1.25rem);
  font-weight: 700;
  color: var(--text-dark);
}

/* Message Boxes */
.message-box {
  padding: clamp(0.5rem, 2vw, 0.75rem);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: clamp(0.75rem, 2vw, 0.875rem);
  width: 100%;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-box {
  background-color: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error-text);
}

/* Hero Section */
.hero-section {
  padding: clamp(1.5rem, 5vw, 2.5rem) clamp(0.75rem, 3vw, 1rem) clamp(2rem, 5vw, 3.5rem);
  background-image: linear-gradient(120deg, var(--bg-hero-start), var(--bg-hero-end));
  text-align: center;
  width: 100%;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(0.75rem, 3vw, 1rem);
}

.hero-text p {
  font-size: clamp(0.875rem, 3vw, 1.1rem);
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.tool-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tool-link {
  background-color: white;
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
}

.tool-link:hover {
  background-color: var(--primary-accent-light);
  border-color: var(--primary-accent);
}

.tool-link.active {
  background-color: var(--primary-accent);
  color: white;
  border-color: var(--primary-accent);
}

.cta-button {
  display: inline-block;
  background-color: var(--primary-accent);
  color: white;
  padding: clamp(0.625rem, 2.5vw, 0.75rem) clamp(1.25rem, 4vw, 1.75rem);
  border-radius: 0.5rem;
  font-size: clamp(0.875rem, 2.5vw, 1rem);
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  margin-top: 0.5rem;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(13, 148, 136, 0.1);
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem clamp(0.75rem, 3vw, 1rem);
  margin-top: 2rem;
  background-color: var(--bg-hero-end);
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--primary-accent);
  text-decoration: none;
  font-weight: 500;
}

/* Content Sections */
.content-section {
  margin-top: 2rem;
  width: 100%;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  width: 100%;
}

@media (min-width: 992px) {
  .content-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

.content-main, .content-sidebar {
  width: 100%;
}

.tips-list {
  list-style-type: none;
}

.tips-list li {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  position: relative;
}

.tips-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary-accent);
  font-weight: bold;
}

.tips-list h3 {
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  margin-bottom: 0.25rem;
}

.tips-list p {
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  color: var(--text-medium);
}

/* FAQ Styles */
.faq-item {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: var(--bg-card);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: clamp(1rem, 3vw, 1.25rem);
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  transition: all 0.3s ease;
}

.faq-question:hover {
  background-color: var(--primary-accent-light);
}

.faq-question i {
  color: var(--primary-accent);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background-color: var(--bg-page);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding: 0 clamp(1rem, 3vw, 1.25rem) clamp(1rem, 3vw, 1.25rem);
  margin: 0;
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  color: var(--text-medium);
}

/* Scenario Examples */
.scenario-example {
  margin-bottom: 1.25rem;
  padding: clamp(0.5rem, 2vw, 0.75rem);
  border-radius: 0.5rem;
  background-color: var(--bg-page);
  border: 1px solid var(--border-color);
  width: 100%;
}

.scenario-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.scenario-header i {
  font-size: 1.5rem;
  color: var(--primary-accent);
}

.scenario-header h3 {
  font-size: clamp(0.8rem, 2vw, 0.875rem);
  margin-bottom: 0.125rem;
}

.scenario-meta {
  font-size: clamp(0.7rem, 1.8vw, 0.75rem);
  color: var(--text-light);
}

.scenario-example p {
  font-size: clamp(0.75rem, 2vw, 0.8125rem);
  color: var(--text-medium);
}

/* Tools Grid */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--bg-page);
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-dark);
  transition: all 0.2s;
}

.tool-card:hover {
  background-color: var(--primary-accent-light);
  border-color: var(--primary-accent);
}

.tool-card.active {
  background-color: var(--primary-accent-light);
  border-color: var(--primary-accent);
}

.tool-card i {
  font-size: 1.25rem;
  color: var(--primary-accent);
}

.tool-card h3 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.tool-card p {
  font-size: 0.75rem;
  color: var(--text-medium);
  margin: 0;
}

/* Animations */
.animate-on-load {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Input Help Text */
.input-help {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

/* Chart Styles */
.chart-container {
  margin-bottom: 1.5rem;
  width: 100%;
}

.chart-wrapper {
  border-radius: 0.5rem;
  padding: clamp(0.5rem, 2vw, 0.75rem);
  height: clamp(200px, 40vw, 300px);
  background-color: white;
  border: 1px solid var(--border-color);
  position: relative;
  width: 100%;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .nav-slider {
    width: 100%;
  }
  
  .tip-options {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .tool-links {
    flex-direction: column;
    align-items: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .tip-options {
    grid-template-columns: 1fr;
  }
}