/*
  styles.css
  Haupt-Stylesheet für die AI Sandbox Onepager-Seite.
*/

/* 1. CSS-Variablen (Custom Properties) */
:root {
  --color-bg: #f9f9f9;
  --color-text: #212529;
  --color-primary: #0052a8;
  --color-surface: #ffffff;
  --color-border: #dee2e6;
  --color-shadow: rgba(0, 0, 0, 0.1);
  --color-focus: #0056b3;

  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol";
  --font-size-base: 1rem;
  --line-height-base: 1.6;
  --spacing-unit: 1rem;
  --border-radius: 0.5rem;
}

/* 2. Dark Mode Implementierung */

/* a) Automatisch via Systemeinstellung */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #121212;
    --color-text: #e0e0e0;
    --color-primary: #4dabf7;
    --color-surface: #1e1e1e;
    --color-border: #333333;
    --color-shadow: rgba(0, 0, 0, 0.5);
    --color-focus: #82c9ff;
  }
}

/* b) Manuell via [data-theme="dark"] Attribut */
[data-theme="dark"] {
  --color-bg: #121212;
  --color-text: #e0e0e0;
  --color-primary: #4dabf7;
  --color-surface: #1e1e1e;
  --color-border: #333333;
  --color-shadow: rgba(0, 0, 0, 0.5);
  --color-focus: #82c9ff;
}

/* 3. Basis-Styling und Typografie */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 2);
}

section {
  padding: calc(var(--spacing-unit) * 3) 0;
}

h1, h2, h3 {
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: 1.5rem; }

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

a:hover {
  text-decoration: underline;
}

/* Basis-Styling für Buttons */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
}

/* Barrierefreiheit: Sichtbarer Fokus-Stil */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--border-radius);
}


/* Layout-Komponenten */

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: var(--spacing-unit) calc(var(--spacing-unit) * 2);
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.branding {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) / 2);
}

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

.site-title {
  font-size: 1.25rem;
  font-weight: bold;
}

header nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: var(--spacing-unit);
}

#theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  border-radius: 50%;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  box-shadow: 0 2px 4px -1px var(--color-shadow);
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

#theme-toggle:hover,
#theme-toggle:focus {
  background-color: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px -2px var(--color-shadow);
  border-color: var(--color-primary);
}

nav a.active,
nav a[aria-current="location"] {
  font-weight: bold;
  text-decoration: underline;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: calc(var(--spacing-unit) * 4) var(--spacing-unit);
}

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

.hero p {
  font-size: 1.2rem;
  max-width: 60ch;
  margin: 0 auto;
  color: var(--color-text);
  opacity: 0.8;
}

/* Agent-Karten Grid */
#agents h2, #ablauf h2 {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: calc(var(--spacing-unit) * 1.5);
}

.agent-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: calc(var(--spacing-unit) * 1.5);
  box-shadow: 0 4px 8px -2px var(--color-shadow);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.agent-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px -4px var(--color-shadow);
  border-color: var(--color-primary);
}

.agent-card h3 {
  margin-top: 0;
  color: var(--color-primary);
}

/* "So funktioniert's" Section */
.steps {
    list-style: none;
    padding-left: 0;
    counter-reset: steps-counter;
    display: grid;
    gap: calc(var(--spacing-unit) * 2);
}

.steps li {
    counter-increment: steps-counter;
    position: relative;
    padding-left: calc(var(--spacing-unit) * 3);
}

.steps li::before {
    content: counter(steps-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: calc(var(--spacing-unit) * 2);
    height: calc(var(--spacing-unit) * 2);
    border-radius: 50%;
    background-color: var(--color-primary);
    color: var(--color-bg);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Footer */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text);
  opacity: 0.7;
}

footer nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  gap: var(--spacing-unit);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
  body {
    font-size: 0.95rem;
  }

  main {
      padding: var(--spacing-unit);
  }
  
  header {
    flex-direction: column;
    gap: var(--spacing-unit);
  }

  footer {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-unit);
  }

  .steps {
      gap: calc(var(--spacing-unit) * 3);
  }
}
