/* ============================================
   SALARYTOHOUR.COM - MAIN STYLES
   Color Palette:
   - Primary (Coral Red): #BF4646
   - Secondary (Beige): #EDDCC6
   - Light (Cream): #FFF4EA
   - Accent (Teal): #7EACB5
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Colors */
  --color-primary: #BF4646;
  --color-secondary: #EDDCC6;
  --color-light: #FFF4EA;
  --color-accent: #7EACB5;
  --color-dark: #2C2C2C;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-border: #E0E0E0;
  --color-success: #4CAF50;
  --color-error: #F44336;

  /* Background */
  --bg-primary: #FFF4EA;
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-input: #FFFFFF;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Spacing - GENEROUS MARGINS */
  --container-max-width: 1200px;
  --container-padding: 24px;
  --section-padding: 60px 24px;
  --card-padding: 32px;
  --text-max-width: 800px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --color-text: #E0E0E0;
  --color-text-light: #B0B0B0;
  --color-border: #404040;
  --bg-primary: #1A1A1A;
  --bg-secondary: #242424;
  --bg-card: #2C2C2C;
  --bg-input: #333333;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CONTAINER & LAYOUT - PROPER MARGINS
   ============================================ */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  width: 100%;
}

/* Text Container - Max width for readability */
.text-container {
  max-width: var(--text-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

section {
  padding: var(--section-padding);
}

/* Mobile: More padding */
@media (max-width: 768px) {
  :root {
    --container-padding: 20px;
    --section-padding: 40px 20px;
    --card-padding: 24px;
  }
}

/* Desktop: Even more padding */
@media (min-width: 1200px) {
  :root {
    --container-padding: 40px;
    --section-padding: 80px 40px;
  }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text);
  /* Generous line spacing for readability */
  line-height: 1.8;
  /* Prevent text from touching edges */
  padding-left: 4px;
  padding-right: 4px;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  gap: 2rem;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.logo a:hover {
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-menu a {
  font-weight: 500;
  color: var(--color-text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-menu a:hover {
  background-color: var(--color-secondary);
  color: var(--color-primary);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  color: var(--color-text);
}

.theme-toggle:hover {
  border-color: var(--color-primary);
  background-color: var(--color-secondary);
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 3px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    z-index: 999;
  }

  .nav-menu.active {
    max-height: 400px;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: 1rem;
    width: 100%;
  }
}

/* ============================================
   BREADCRUMBS - MODERN DESIGN
   ============================================ */
.breadcrumb-nav {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--color-light) 100%);
  padding: 1rem 0;
  border-bottom: 2px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 100;
}

.breadcrumb {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Home icon before first breadcrumb */
.breadcrumb li:first-child a::before {
  content: '🏠';
  margin-right: 0.35rem;
  font-size: 1rem;
}

/* Separator with arrow */
.breadcrumb li:not(:last-child)::after {
  content: '→';
  color: var(--color-primary);
  font-weight: 600;
  font-size: 1rem;
  opacity: 0.6;
  margin: 0 0.25rem;
}

.breadcrumb a {
  color: var(--color-text-light);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  background-color: transparent;
}

.breadcrumb a:hover {
  color: var(--color-primary);
  background-color: rgba(191, 70, 70, 0.1);
  transform: translateY(-1px);
}

/* Current page (last item) */
.breadcrumb li:last-child span {
  color: var(--color-primary);
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background-color: rgba(191, 70, 70, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(191, 70, 70, 0.2);
}

/* Mobile optimization */
@media (max-width: 768px) {
  .breadcrumb {
    font-size: 0.8rem;
  }

  .breadcrumb a,
  .breadcrumb li:last-child span {
    padding: 0.25rem 0.5rem;
  }

  .breadcrumb li:first-child a::before {
    font-size: 0.9rem;
  }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  text-align: center;
  padding: 60px 24px 40px;
  background: linear-gradient(135deg, var(--color-light) 0%, var(--color-secondary) 100%);
}

.hero h1 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto 2rem;
  /* Extra padding for mobile */
  padding-left: 20px;
  padding-right: 20px;
}

/* ============================================
   CALCULATOR CARD
   ============================================ */
.calculator-section {
  padding: 40px 24px;
}

.calculator-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto;
}

.calculator-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--color-border);
}

.tab-button {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-button:hover:not(.active) {
  color: var(--color-text);
  background-color: var(--color-secondary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
  /* Padding for labels */
  padding-left: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--bg-input);
  color: var(--color-text);
  transition: all var(--transition-fast);
  font-family: var(--font-family);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(191, 70, 70, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Buttons */
.btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  /* Touch-friendly */
}

.btn-primary {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: #A63D3D;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: var(--color-accent);
  color: white;
}

.btn-secondary:hover {
  background-color: #6A9AA3;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: white;
}

.btn-full {
  width: 100%;
}

/* ============================================
   RESULTS SECTION
   ============================================ */
.results-section {
  margin-top: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-light) 100%);
  border-radius: var(--radius-lg);
  display: none;
}

.results-section.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-highlight {
  text-align: center;
  margin-bottom: 2rem;
}

.result-highlight .amount {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.result-highlight .label {
  font-size: 1.125rem;
  color: var(--color-text-light);
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.breakdown-table th,
.breakdown-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.breakdown-table th {
  font-weight: 600;
  color: var(--color-text);
  background-color: var(--bg-card);
}

.breakdown-table td {
  color: var(--color-text);
}

.breakdown-table tr:last-child td {
  border-bottom: none;
}

.breakdown-table .amount {
  font-weight: 600;
  color: var(--color-primary);
  text-align: right;
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .action-buttons {
    flex-direction: column;
  }

  .action-buttons .btn {
    width: 100%;
  }
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
  padding: 60px 24px;
}

.content-section h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--color-primary);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.content-card {
  background-color: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.content-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.content-card h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.content-card p {
  color: var(--color-text-light);
  /* Extra padding in cards */
  padding-left: 8px;
  padding-right: 8px;
}

/* FAQ Section */
.faq-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 24px;
}

.faq-item {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.5rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast);
}

.faq-question:hover {
  background-color: var(--color-secondary);
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--color-primary);
  transition: transform var(--transition-fast);
}

.faq-question.active::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.faq-answer.show {
  max-height: 500px;
}

.faq-answer-content {
  padding: 0 1.5rem 1.5rem;
  color: var(--color-text-light);
  line-height: 1.8;
  /* Generous padding */
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: 60px 24px 30px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3,
.footer-section h4 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.footer-section p {
  color: var(--color-text-light);
  margin-bottom: 1rem;
  /* Footer text padding */
  padding-left: 8px;
  padding-right: 8px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-section ul li a {
  color: var(--color-text-light);
  transition: color var(--transition-fast);
  /* Link padding */
  padding-left: 8px;
  display: inline-block;
}

.footer-section ul li a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.footer-bottom p {
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.disclaimer-text {
  font-size: 0.875rem;
  font-style: italic;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 1rem;
}

.mt-2 {
  margin-top: 2rem;
}

.mt-3 {
  margin-top: 3rem;
}

.mb-1 {
  margin-bottom: 1rem;
}

.mb-2 {
  margin-bottom: 2rem;
}

.mb-3 {
  margin-bottom: 3rem;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

  .site-header,
  .site-footer,
  .theme-toggle,
  .action-buttons,
  .mobile-menu-toggle {
    display: none;
  }

  body {
    background-color: white;
    color: black;
  }

  .calculator-card,
  .results-section {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   ADSENSE AD CONTAINERS
   ============================================ */
.ad-container {
  margin: 2rem auto;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-top {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.ad-bottom {
  margin-top: 3rem;
  margin-bottom: 2rem;
}

.ad-sidebar {
  position: sticky;
  top: 100px;
  margin: 2rem 0;
}

/* Desktop: Show sidebars */
@media (min-width: 1200px) {
  .content-with-ads {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
  }

  .main-content {
    min-width: 0;
    /* Prevent overflow */
  }

  .ad-sidebar-left,
  .ad-sidebar-right {
    display: block;
  }
}

/* Mobile/Tablet: Hide sidebars */
@media (max-width: 1199px) {

  .ad-sidebar-left,
  .ad-sidebar-right {
    display: none;
  }

  .content-with-ads {
    display: block;
  }

  /* Sticky bottom ad on mobile */
  .ad-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.5rem;
    background-color: var(--bg-secondary);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    border-top: 1px solid var(--color-border);
  }

  .ad-bottom .ad-container {
    margin: 0;
  }

  /* Add padding to body to prevent content from being hidden behind sticky ad */
  body {
    padding-bottom: 100px;
  }
}

/* Ad placeholder styling (for development) */
.ad-placeholder {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-light) 100%);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  color: var(--color-text-light);
  font-size: 0.875rem;
  font-style: italic;
}