/* ============================================
   CalcMoney.net - Global Stylesheet
   Mobile-first responsive design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --primary: #1B4F72;
  --primary-light: #2E86C1;
  --success: #27AE60;
  --warning: #F39C12;
  --error: #E74C3C;
  --dark: #2C3E50;
  --light-bg: #F8F9FA;
  --white: #FFFFFF;
  --gray-100: #F0F2F5;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --border: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--light-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--primary);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 1.75rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-size: 0.875rem;
}
.skip-link:focus {
  top: 0;
  text-decoration: none;
  color: var(--white);
}

/* --- Header / Navigation --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--primary); }

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--dark);
  border-radius: 2px;
  transition: var(--transition);
}

.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
}
.nav-menu.active { display: block; }

.nav-menu ul {
  list-style: none;
}

.nav-menu a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--dark);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-menu a:hover {
  background: var(--gray-100);
  color: var(--primary);
  text-decoration: none;
}
.nav-menu a.active {
  color: var(--primary);
  font-weight: 600;
}

/* --- Nav Dropdown --- */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0.75rem 1.5rem;
  color: var(--dark);
  font-size: 0.9375rem;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.nav-dropdown-toggle:hover {
  background: var(--gray-100);
  color: var(--primary);
}
.nav-dropdown-toggle.active {
  color: var(--primary);
  font-weight: 600;
}
.nav-dropdown-arrow {
  width: 12px;
  height: 12px;
  transition: transform var(--transition);
}
.nav-dropdown.open .nav-dropdown-arrow {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  display: none;
  list-style: none;
  padding-left: 1rem;
}
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}
.nav-dropdown-menu a {
  padding: 0.5rem 1.5rem;
  font-size: 0.875rem;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 0.75rem 0;
  font-size: 0.8125rem;
  color: var(--gray-500);
}
.breadcrumbs a {
  color: var(--gray-500);
}
.breadcrumbs a:hover {
  color: var(--primary-light);
}
.breadcrumbs span {
  margin: 0 0.375rem;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 2.5rem 1rem;
  text-align: center;
}
.hero h1 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.hero p {
  font-size: 1.0625rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-cta {
  display: inline-block;
  background: var(--white);
  color: var(--primary);
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--primary);
}

/* --- Section Titles --- */
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}
.section-title h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}
.section-title p {
  color: var(--gray-500);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Calculator Grid (Homepage) --- */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 2rem 0;
}

.calc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
}
.calc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: inherit;
}

.calc-card-icon {
  width: 48px;
  height: 48px;
  background: var(--gray-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

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

.calc-card p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
}

.calc-card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-light);
}

/* --- Trust Signals --- */
.trust-section {
  padding: 2.5rem 0;
  background: var(--white);
}

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

.trust-item {
  text-align: center;
  padding: 1.5rem;
}

.trust-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.trust-item h3 {
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.375rem;
}

.trust-item p {
  font-size: 0.875rem;
  color: var(--gray-500);
}

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

.content-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.content-card h2 {
  margin-top: 1.5rem;
}
.content-card h2:first-child {
  margin-top: 0;
}

.content-card ul, .content-card ol {
  margin: 0.75rem 0 1rem 1.25rem;
}
.content-card li {
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

/* --- FAQ Section --- */
.faq-section {
  padding: 2.5rem 0;
}

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

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: inherit;
  line-height: 1.4;
}
.faq-question:hover { background: var(--gray-100); }

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
}
.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  font-size: 0.9375rem;
  color: var(--gray-600);
  line-height: 1.6;
}

/* --- Ad Placeholders --- */
.ad-slot {
  background: var(--gray-100);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.75rem;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot-leaderboard { min-height: 90px; }
.ad-slot-rectangle { min-height: 250px; max-width: 300px; margin-left: auto; margin-right: auto; }
.ad-slot-large-rectangle { min-height: 600px; max-width: 300px; }
.ad-slot-in-article { min-height: 120px; }

/* --- Footer --- */
.site-footer {
  background: var(--primary);
  color: var(--white);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 0.375rem;
}
.footer-col a {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: var(--white);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-light);
  color: var(--white);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  text-decoration: none;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* --- Page Content (About, Contact, etc.) --- */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 2rem 1rem;
  text-align: center;
}
.page-header h1 {
  color: var(--white);
  margin-bottom: 0.5rem;
}
.page-header p {
  opacity: 0.9;
}

.page-content {
  padding: 2rem 0;
}

.page-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
}

.page-card h2 {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.page-card h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.page-card ul, .page-card ol {
  margin: 0.5rem 0 1rem 1.25rem;
}
.page-card li {
  margin-bottom: 0.375rem;
}

/* --- Contact Form --- */
.contact-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.375rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.15);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* --- CTA Box (in-content) --- */
.cta-box {
  background: linear-gradient(135deg, #EBF5FB 0%, #D6EAF8 100%);
  border: 1px solid var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
}
.cta-box h3 {
  color: var(--primary);
  font-size: 1rem;
  margin-bottom: 0.375rem;
}
.cta-box p {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

/* --- Tables (in content) --- */
.content-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.875rem;
}
.content-table th,
.content-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.content-table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}
.content-table tr:hover td {
  background: var(--gray-100);
}

/* --- Responsive: Tablet (768px+) --- */
@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.375rem; }

  .container { padding: 0 2rem; }

  .hero {
    padding: 3.5rem 2rem;
  }
  .hero h1 { font-size: 2.5rem; }

  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .nav-toggle { display: none; }

  .nav-menu {
    display: flex;
    position: static;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  .nav-menu > ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  .nav-menu a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
  }

  .nav-dropdown-toggle {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    width: auto;
  }
  .nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    min-width: 220px;
    padding: 0.5rem 0;
    z-index: 100;
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown-menu li {
    display: block;
  }
  .nav-dropdown-menu a {
    padding: 0.5rem 1rem;
    display: block;
    white-space: nowrap;
    border-radius: 0;
  }

  .page-card {
    padding: 2.5rem;
  }
}

/* --- Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .calc-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }

  .trust-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

  .hero {
    padding: 4rem 2rem;
  }
  .hero h1 { font-size: 2.75rem; }
}

/* --- Print Styles --- */
@media print {
  .site-header, .site-footer, .nav-toggle, .ad-slot, .breadcrumbs { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  .container { max-width: 100%; padding: 0; }
  a { color: black; text-decoration: underline; }
  .content-card, .page-card { box-shadow: none; padding: 0; }
}
