/* ============================================
   Modern CSS for Anrufbeantworteransagen.com
   SEO-optimized, Fast Loading, Mobile-First
   ============================================ */

/* CSS Variables for easy theming */
:root {
  --primary-color: #4a5568;
  --primary-dark: #2d3748;
  --secondary-color: #718096;
  --accent-color: #805ad5;
  --text-dark: #1a202c;
  --text-medium: #4a5568;
  --text-light: #718096;
  --bg-white: #ffffff;
  --bg-light: #f7fafc;
  --bg-accent: #edf2f7;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --max-width: 1200px;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Mobile optimization */
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-white);
  /* Mobile optimization */
  overflow-x: hidden;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
  color: var(--text-dark);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--text-medium);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

p {
  margin-bottom: var(--spacing-sm);
  color: var(--text-medium);
  line-height: 1.7;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Container & Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-md);
  }
}

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

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.nav-links a {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-weight: 500;
}

.nav-links a:hover {
  background: var(--bg-accent);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
}

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

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
  }

  .nav-links.active {
    display: flex;
  }
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
  padding: var(--spacing-xl) 0;
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.hero h1 {
  margin-bottom: var(--spacing-md);
}

.hero p {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto var(--spacing-lg);
}

/* CTA Button */
.cta-button {
  display: inline-block;
  background: var(--primary-color);
  color: var(--bg-white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  border: none;
  cursor: pointer;
  text-align: center;
}

.cta-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--bg-white);
}

.cta-button-primary {
  background: var(--accent-color);
  font-size: 1.125rem;
  padding: 0.875rem 2rem;
}

.cta-button-primary:hover {
  background: #6b46c1;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.35rem;
}

@media (max-width: 767px) {
  .card h3 {
    font-size: 1.2rem;
  }
}

.card h3 .icon {
  flex-shrink: 0;
}

.card p {
  flex-grow: 1;
}

.card .cta-button {
  margin-top: auto;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
}

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

/* Text Examples List */
.text-examples {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.text-examples ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.text-examples li {
  background: var(--bg-white);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-color);
  box-shadow: var(--shadow-sm);
  line-height: 1.7;
  color: var(--text-medium);
  transition: all 0.2s ease;
}

.text-examples li:hover {
  border-left-color: var(--secondary-color);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

/* Info Box */
.info-box {
  background: var(--bg-accent);
  border-left: 4px solid var(--primary-color);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin: var(--spacing-lg) 0;
}

.info-box h3 {
  margin-top: 0;
  color: var(--primary-color);
}

/* Trust Badges */
.trust-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  padding: var(--spacing-xl) 0;
  margin: var(--spacing-xl) 0;
  background: var(--bg-light);
  border-radius: var(--radius-lg);
}

.trust-item {
  text-align: center;
  padding: var(--spacing-md);
}

.trust-item strong {
  display: block;
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

/* Footer */
footer {
  background: var(--text-dark);
  color: var(--bg-light);
  padding: var(--spacing-xl) 0 var(--spacing-md);
  margin-top: var(--spacing-xl);
}

footer a {
  color: var(--bg-light);
}

footer a:hover {
  color: var(--bg-white);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h4 {
  color: var(--bg-white);
  margin-bottom: var(--spacing-sm);
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: var(--spacing-xs);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: var(--text-light);
}

.footer-bottom a.memberof {
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
}

.footer-bottom a.memberof:hover {
  color: rgba(255, 255, 255, 0.55);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) 0;
  font-size: 0.875rem;
  color: var(--text-light);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-light);
}

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

/* Table of Contents */
.toc {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  position: sticky;
  top: 80px;
}

.toc h3 {
  margin-top: 0;
}

.toc ul {
  list-style: none;
}

.toc li {
  margin-bottom: var(--spacing-xs);
}

.toc a {
  display: block;
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.toc a:hover {
  background: var(--bg-white);
  text-decoration: none;
  padding-left: var(--spacing-sm);
}

/* Two Column Layout for longer pages */
.two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

@media (min-width: 1024px) {
  .two-column {
    grid-template-columns: 250px 1fr;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.section-spacing {
  padding: var(--spacing-xl) 0;
}

/* Performance: Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Enhanced Mobile Optimization */
@media (max-width: 767px) {
  /* Better text readability on mobile */
  body {
    font-size: 16px;
    line-height: 1.7;
  }

  h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  h3 {
    font-size: 1.25rem;
  }

  p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  /* Mobile-friendly spacing */
  .container {
    padding: 0 1rem;
  }

  .section-spacing {
    padding: 2rem 0;
  }

  /* Touch-friendly buttons (min 44x44px) */
  .cta-button {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 44px;
    display: block;
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Better card layout on mobile */
  .content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  /* Mobile hero optimization */
  .hero {
    padding: 2rem 0;
  }

  .hero h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1rem;
  }

  /* Text examples better on mobile */
  .text-examples li {
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Two column layout becomes single column on mobile */
  .two-column {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
    margin-bottom: 2rem;
  }

  /* Footer optimization */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Trust section mobile */
  .trust-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 2rem 1rem;
  }

  .trust-item strong {
    font-size: 1.5rem;
  }

  /* Info box mobile */
  .info-box {
    padding: 1rem;
  }

  /* Breadcrumbs mobile */
  .breadcrumbs {
    font-size: 0.8rem;
    padding: 0.75rem 0;
  }
}

/* Tablet optimization */
@media (min-width: 768px) and (max-width: 1023px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* Large mobile / small tablet */
@media (max-width: 480px) {
  /* Even smaller screens */
  h1 {
    font-size: 1.5rem;
  }

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

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

  .cta-button {
    font-size: 0.95rem;
    padding: 0.875rem 1.5rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .card:hover {
    transform: none;
  }

  .text-examples li:hover {
    transform: none;
  }

  /* Larger touch targets */
  a, button {
    min-height: 44px;
    min-width: 44px;
  }

  /* Better button feedback on touch */
  .cta-button:active {
    transform: scale(0.98);
  }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 1.5rem 0;
  }

  .section-spacing {
    padding: 1.5rem 0;
  }
}

/* Print Styles */
@media print {
  header, footer, .cta-button, .toc {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}