/* ========================================
   BesserAI Article Template v3.0
   Modernisiertes Design: Spaceship / Clean / Immersive
   ======================================== */

:root {
  /* BesserAI v3.0 – Future Vision Theme (Consistent with Main) */
  --ai-red: #ff0000;
  --ai-red-dark: #cc0000;
  --ai-red-light: #fff0f0;
  --ai-red-glow: rgba(255, 0, 0, 0.15);
  
  /* Neutrals */
  --ai-black: #000000;
  --ai-white: #ffffff;
  --ai-bg: #f4f5f7;
  --ai-card-bg: #ffffff;
  --ai-text: #111111;
  --ai-text-muted: #666666;
  --ai-heading: #000000;
  --ai-border: rgba(0,0,0,0.06);
  
  /* Publisher Colors */
  --openai-green: #00a67e;
  --google-blue: #4285f4;
  --anthropic-orange: #d97757;
  --xai-purple: #8e44ad;
  
  /* Layout */
  --max-width: 1000px; /* Wider for immersive feel */
  --spacing: 1.5rem;
  --spacing-lg: 4rem;
  --border-radius: 1rem;
  --border-radius-lg: 2rem;
  --border-radius-xl: 3rem;
  
  /* Shadows */
  --ai-shadow: 0 12px 32px rgba(0,0,0,0.06);
  --ai-shadow-lg: 0 24px 64px rgba(0,0,0,0.08);
  --ai-shadow-xl: 0 40px 100px rgba(0,0,0,0.12);
  
  /* Typography */
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Poppins', var(--font-body);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--ai-bg);
  color: var(--ai-text);
  line-height: 1.8;
  font-size: 19px; /* Slightly larger text */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   ARTICLE CONTAINER
   ======================================== */

.ai-article-container {
  max-width: var(--max-width);
  margin: 2rem auto 4rem;
  padding: var(--spacing-lg);
  background: var(--ai-card-bg);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--ai-shadow-lg);
}

@media (max-width: 800px) {
  .ai-article-container {
    margin: 0;
    border-radius: 0;
    padding: 2rem 1.5rem;
    box-shadow: none;
  }
}

/* ========================================
   ARTICLE HEADER
   ======================================== */

.ai-article-header {
  margin-bottom: var(--spacing-lg);
  text-align: center; /* Centered header for modern look */
}

.ai-badge {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, var(--ai-red) 0%, var(--ai-red-dark) 100%);
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 12px var(--ai-red-glow);
  transition: all 0.3s ease;
}

.ai-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--ai-red-glow);
}

.ai-badge.openai { 
  background: linear-gradient(135deg, var(--openai-green) 0%, #0d8968 100%);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.2);
}
.ai-badge.google { 
  background: linear-gradient(135deg, var(--google-blue) 0%, #3367d6 100%);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2);
}
.ai-badge.anthropic { 
  background: linear-gradient(135deg, var(--anthropic-orange) 0%, #ea580c 100%);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}
.ai-badge.xai { 
  background: linear-gradient(135deg, var(--xai-purple) 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.ai-article-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--ai-heading);
  margin-bottom: 2rem;
  letter-spacing: -0.03em;
}

.ai-article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  color: var(--ai-text-muted);
  font-size: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.ai-meta-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.ai-meta-item i {
  color: var(--ai-red);
  font-size: 1.1rem;
}

/* ========================================
   AUTOREN-INFO (NEU!)
   ======================================== */

.ai-author-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem auto 3rem;
  padding: 1.5rem 2rem;
  background: var(--ai-bg);
  border: none; /* Removed border */
  border-radius: var(--border-radius-lg);
  transition: all 0.3s ease;
  max-width: 600px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); /* Subtle inset */
}

.ai-author-info:hover {
  background: #fff;
  box-shadow: var(--ai-shadow);
  transform: translateY(-2px);
}

.ai-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--ai-white);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-author-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.ai-author-name {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ai-heading);
  text-decoration: none;
  transition: color 0.2s ease;
}

.ai-author-name:hover {
  color: var(--ai-red);
}

.ai-author-role {
  font-size: 0.9rem;
  color: var(--ai-text-muted);
  font-weight: 500;
}

/* ========================================
   LEAD PARAGRAPH
   ======================================== */

.ai-article-lead {
  font-size: 1.5rem;
  color: var(--ai-heading);
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
  padding: 0;
  border-left: none;
  font-weight: 600;
  background: transparent;
  text-align: center; /* Centered lead */
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   ARTICLE COVER IMAGE
   ======================================== */

.ai-article-cover {
  width: 100%;
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--ai-shadow-xl);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.ai-article-cover:hover {
  transform: scale(1.02);
  box-shadow: 0 30px 80px rgba(0,0,0,0.15);
}

/* ========================================
   INLINE (SECONDARY) ARTICLE IMAGES
   ======================================== */

.ai-article-inline {
  width: 100%;
  border-radius: var(--border-radius-lg);
  margin: 3rem 0 2rem;
  box-shadow: var(--ai-shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-article-inline:hover {
  transform: translateY(-8px);
  box-shadow: var(--ai-shadow-xl);
}

@media (max-width: 800px) {
  .ai-article-inline {
    margin: 2rem 0 1.5rem;
  }
}

/* ========================================
   TABLE OF CONTENTS
   ======================================== */

.ai-toc {
  background: var(--ai-bg);
  border: none; /* Removed border */
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  margin-bottom: var(--spacing-lg);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  transition: all 0.3s ease;
}

.ai-toc:hover {
  background: #fff;
  box-shadow: var(--ai-shadow-lg);
  transform: translateY(-4px);
}

.ai-toc h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ai-heading);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ai-toc h3 i {
  color: var(--ai-red);
  font-size: 1.5rem;
}

.ai-toc ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-toc a {
  color: var(--ai-text);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  position: relative;
}

.ai-toc a::before {
  content: '→';
  color: var(--ai-red);
  font-weight: 800;
  transition: transform 0.2s ease;
}

.ai-toc a:hover {
  background: var(--ai-red-light);
  color: var(--ai-red-dark);
  transform: translateX(8px);
}

.ai-toc a:hover::before {
  transform: translateX(4px);
}

/* ========================================
   ARTICLE CONTENT
   ======================================== */

.ai-article-content {
  background: var(--ai-card-bg);
  padding: 3rem 2.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--ai-shadow);
  border: 1px solid var(--ai-border);
}

.ai-article-content h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ai-heading);
  margin: 3rem 0 1.5rem;
  scroll-margin-top: 100px;
  display: flex;
  align-items: center;
  gap: 1rem;
  letter-spacing: -0.01em;
}

.ai-article-content h2::before {
  content: '';
  width: 5px;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--ai-red) 0%, var(--ai-red-dark) 100%);
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--ai-red-glow);
}

.ai-article-content h3 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ai-heading);
  margin: 2.5rem 0 1.25rem;
  scroll-margin-top: 100px;
}

.ai-article-content h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ai-heading);
  margin: 2rem 0 1rem;
}

.ai-article-content p {
  margin-bottom: 1.75rem;
  line-height: 1.85;
  color: var(--ai-text);
}

.ai-article-content strong {
  color: var(--ai-heading);
  font-weight: 700;
}

.ai-article-content a {
  color: var(--ai-red);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  font-weight: 600;
}

.ai-article-content a:hover {
  color: var(--ai-red-dark);
  border-bottom-color: var(--ai-red-dark);
}

/* Inline Citations */
.ai-citation {
  color: var(--ai-red);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted var(--ai-red);
  white-space: nowrap;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.ai-citation:hover {
  color: var(--ai-red-dark);
  border-bottom-style: solid;
}

.ai-citation::before {
  content: '[';
}

.ai-citation::after {
  content: ']';
}

/* ========================================
   CALLOUT BOXES
   ======================================== */

.ai-callout {
  background: linear-gradient(135deg, var(--ai-red-light) 0%, var(--ai-card-bg) 100%);
  border-left: 5px solid var(--ai-red);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  margin: 2.5rem 0;
  box-shadow: var(--ai-shadow);
  transition: all 0.3s ease;
}

.ai-callout:hover {
  transform: translateX(4px);
  box-shadow: var(--ai-shadow-lg);
}

.ai-callout-icon {
  font-size: 1.5rem;
  color: var(--ai-red);
  margin-bottom: 1rem;
}

.ai-callout-content h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ai-red-dark);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.ai-callout p:last-child {
  margin-bottom: 0;
}

.ai-callout-info {
  background: linear-gradient(135deg, #f0f9ff 0%, var(--ai-card-bg) 100%);
  border-left-color: var(--google-blue);
}

.ai-callout-info .ai-callout-icon,
.ai-callout-info h4 {
  color: var(--google-blue);
}

.ai-callout-success {
  background: linear-gradient(135deg, #f0fdf4 0%, var(--ai-card-bg) 100%);
  border-left-color: var(--openai-green);
}

.ai-callout-success .ai-callout-icon,
.ai-callout-success h4 {
  color: var(--openai-green);
}

.ai-callout-warning {
  background: linear-gradient(135deg, #fff7ed 0%, var(--ai-card-bg) 100%);
  border-left-color: var(--anthropic-orange);
}

.ai-callout-warning .ai-callout-icon,
.ai-callout-warning h4 {
  color: var(--anthropic-orange);
}

/* Legacy Support */
.ai-callout.info {
  background: linear-gradient(135deg, #f0f9ff 0%, var(--ai-card-bg) 100%);
  border-left-color: var(--google-blue);
}

.ai-callout.info .ai-callout-icon,
.ai-callout.info .ai-callout-title,
.ai-callout.info h4 {
  color: var(--google-blue);
}

.ai-callout.success {
  background: linear-gradient(135deg, #f0fdf4 0%, var(--ai-card-bg) 100%);
  border-left-color: var(--openai-green);
}

.ai-callout.success .ai-callout-icon,
.ai-callout.success .ai-callout-title,
.ai-callout.success h4 {
  color: var(--openai-green);
}

.ai-callout.warning {
  background: linear-gradient(135deg, #fff7ed 0%, var(--ai-card-bg) 100%);
  border-left-color: var(--anthropic-orange);
}

.ai-callout.warning .ai-callout-icon,
.ai-callout.warning .ai-callout-title,
.ai-callout.warning h4 {
  color: var(--anthropic-orange);
}

.ai-callout-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ai-red);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
}

/* ========================================
   LISTS
   ======================================== */

.ai-article-content ul,
.ai-article-content ol {
  margin: 2rem 0;
  padding-left: 2rem;
}

.ai-article-content li {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.ai-article-content ul li::marker {
  color: var(--ai-red);
  font-weight: 800;
  font-size: 1.2em;
}

.ai-article-content ol li::marker {
  color: var(--ai-red);
  font-weight: 800;
}

/* Nested Lists */
.ai-article-content ul ul,
.ai-article-content ol ol,
.ai-article-content ul ol,
.ai-article-content ol ul {
  margin: 0.75rem 0;
}

/* ========================================
   BLOCKQUOTES
   ======================================== */

.ai-article-content blockquote {
  border-left: 5px solid var(--ai-red);
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
  background: linear-gradient(90deg, var(--ai-red-light) 0%, transparent 100%);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  color: var(--ai-text);
  box-shadow: var(--ai-shadow);
}

.ai-article-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ========================================
   CODE BLOCKS
   ======================================== */

.ai-article-content code {
  background: var(--ai-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--ai-red-dark);
  border: 1px solid var(--ai-border);
}

.ai-article-content pre {
  background: var(--ai-heading);
  color: var(--ai-white);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  overflow-x: auto;
  margin: 2.5rem 0;
  box-shadow: var(--ai-shadow-lg);
}

.ai-article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--ai-white);
  font-size: 0.95rem;
}

/* ========================================
   TABLES
   ======================================== */

.ai-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2.5rem 0;
  background: var(--ai-card-bg);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--ai-shadow);
}

.ai-article-content thead {
  background: linear-gradient(135deg, var(--ai-red) 0%, var(--ai-red-dark) 100%);
  color: var(--ai-white);
}

.ai-article-content th {
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.ai-article-content td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ai-border);
}

.ai-article-content tbody tr:hover {
  background: var(--ai-red-light);
  transition: background 0.2s ease;
}

.ai-article-content tbody tr:last-child td {
  border-bottom: none;
}

/* ========================================
   SOURCES / REFERENCES
   ======================================== */

.ai-sources {
  background: white;
  border: 2px solid var(--ai-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: var(--spacing-lg);
}

.ai-sources-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ai-text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-sources-title i {
  color: var(--ai-red);
}

.ai-sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-source-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--ai-bg);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.ai-source-item:hover {
  background: #f3f4f6;
  transform: translateX(5px);
}

.ai-source-number {
  font-weight: 800;
  color: var(--ai-red);
  font-size: 1.1rem;
  min-width: 30px;
}

.ai-source-link {
  color: var(--ai-text);
  text-decoration: none;
  flex: 1;
}

.ai-source-link:hover {
  color: var(--ai-red);
}

.ai-source-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.ai-source-url {
  font-size: 0.9rem;
  color: var(--ai-text-muted);
  word-break: break-all;
}

/* ========================================
   PROGRESS TRACKER (Side Navigation)
   ======================================== */

.ai-progress-tracker {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 200px;
  z-index: 100;
  display: none;
}

.ai-progress-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  color: var(--ai-text);
}

.ai-progress-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--ai-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 0.5rem;
}

.ai-progress-step:hover {
  background: var(--ai-bg);
}

.ai-progress-step.active {
  background: var(--ai-red);
  color: white;
  font-weight: 600;
}

.ai-progress-step.active .ai-step-icon {
  filter: grayscale(0);
}

.ai-step-icon {
  font-size: 1.2rem;
  filter: grayscale(1);
  transition: all 0.2s ease;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  .ai-article-title {
    font-size: 2rem;
  }
  
  .ai-article-lead {
    font-size: 1.15rem;
    padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  }
  
  .ai-article-content {
    padding: 2rem 1.5rem;
  }
  
  .ai-article-content h2 {
    font-size: 1.65rem;
    margin: 2.5rem 0 1.25rem;
  }
  
  .ai-article-content h3 {
    font-size: 1.35rem;
  }
  
  .ai-article-container {
    padding: 1.5rem 1rem;
  }
  
  .ai-toc {
    padding: 1.5rem;
  }
  
  .ai-author-info {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }
  
  .ai-author-avatar {
    width: 48px;
    height: 48px;
  }
  
  .ai-author-name {
    font-size: 0.95rem;
  }
  
  .ai-author-role {
    font-size: 0.8rem;
  }
  
  .ai-callout {
    padding: 1.5rem;
  }
  
  .ai-article-content table {
    font-size: 0.9rem;
  }
  
  .ai-article-content th,
  .ai-article-content td {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .ai-article-title {
    font-size: 1.65rem;
  }
  
  .ai-article-meta {
    gap: 1rem;
  }
  
  .ai-article-content h2 {
    font-size: 1.45rem;
  }
}

/* ========================================
   UTILITIES
   ======================================== */

.ai-text-red { color: var(--ai-red); }
.ai-text-muted { color: var(--ai-text-muted); }
.ai-text-center { text-align: center; }
.ai-mb-lg { margin-bottom: var(--spacing-lg); }
.ai-mt-lg { margin-top: var(--spacing-lg); }
.ai-font-bold { font-weight: 700; }
.ai-font-display { font-family: var(--font-display); }

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .ai-progress-tracker,
  .ai-badge,
  .ai-toc {
    display: none;
  }
  
  .ai-article-content a {
    text-decoration: underline;
    border-bottom: none;
  }
  
  .ai-article-content {
    box-shadow: none;
  }
}
