/* ============================================
   KOMTECMA.DE - Premium Stylesheet
   Mobile-first responsive design
   ============================================ */

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

:root {
  --color-primary: #0f172a;
  --color-primary-light: #1e293b;
  --color-accent: #6366f1;
  --color-accent-light: #818cf8;
  --color-accent-hover: #4f46e5;
  --color-accent-glow: rgba(99, 102, 241, 0.15);
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-muted: #94a3b8;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-dark: #0f172a;
  --color-bg-card: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.03);
  --shadow-xl: 0 20px 40px -10px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --header-height: 72px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--color-accent-hover);
}

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* ============================================
   Header & Navigation
   ============================================ */

.site-header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  position: relative;
}

.site-logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 1px;
  opacity: 0;
  transition: opacity var(--transition);
}

.site-logo:hover {
  color: #fff;
  text-decoration: none;
}

.site-logo:hover::after {
  opacity: 1;
}

.main-nav {
  display: none;
}

.main-nav.active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.main-nav a {
  color: #cbd5e1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
  letter-spacing: -0.01em;
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.main-nav a.active {
  color: var(--color-accent-light);
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-toggle:hover {
  background: rgba(255,255,255,0.12);
}

.lang-switcher {
  display: flex;
  gap: 2px;
  margin-left: 1rem;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.lang-switcher a {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: all var(--transition);
  letter-spacing: 0.03em;
}

.lang-switcher a:hover {
  color: #fff;
  text-decoration: none;
}

.lang-switcher a.active {
  color: #fff;
  background: var(--color-accent);
  text-decoration: none;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  color: #fff;
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.55) 50%, rgba(15,23,42,0.7) 100%);
  z-index: 1;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.1rem;
  color: #cbd5e1;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
  position: relative;
  z-index: 2;
}

/* ============================================
   Main Content
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* ============================================
   Section headings (homepage)
   ============================================ */

.container > section > h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.container > section > h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 1.75rem 0 0.75rem;
}

.container > section > p {
  color: var(--color-text-light);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.container > section > ul {
  color: var(--color-text-light);
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.container > section > ul li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

/* ============================================
   Article / Page Content
   ============================================ */

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.article-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.article-meta {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--color-border-light);
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary-light);
  margin: 1.75rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1.15rem;
  color: var(--color-text);
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.15rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.article-content li strong {
  color: var(--color-primary);
}

.article-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  background: var(--color-accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-text-light);
}

.article-content a {
  text-decoration: underline;
  text-decoration-color: rgba(99,102,241,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}

.article-content a:hover {
  text-decoration-color: var(--color-accent);
}

/* ============================================
   Cards Grid (Homepage)
   ============================================ */

.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}

.card {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.card .card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.card .card-overlay {
  position: relative;
  z-index: 2;
  padding: 1.75rem;
  background: linear-gradient(0deg, rgba(15,23,42,0.92) 0%, rgba(15,23,42,0.6) 60%, transparent 100%);
  color: #fff;
}

.card:hover {
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  transform: translateY(-6px);
}

.card:hover .card-bg {
  transform: scale(1.08);
}

.card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.card h3 a {
  color: #fff;
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--color-accent-light);
  text-decoration: none;
}

.card p {
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ============================================
   Tool Cards (Affiliate)
   ============================================ */

.tool-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition);
}

.tool-card:hover {
  border-color: rgba(99,102,241,0.2);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.01em;
}

.tool-card .tool-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  letter-spacing: 0.08em;
  background: var(--color-accent-glow);
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  display: inline-block;
  align-self: flex-start;
}

.tool-card .tool-description {
  color: var(--color-text-light);
  font-size: 0.92rem;
  line-height: 1.65;
}

.tool-card .tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gradient-accent);
  color: #fff;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  transition: all var(--transition);
  align-self: flex-start;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.tool-card .tool-cta:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-widget {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.sidebar-widget h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
}

.sidebar-widget ul {
  list-style: none;
}

.sidebar-widget li {
  margin-bottom: 0.25rem;
}

.sidebar-widget a {
  font-size: 0.9rem;
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--color-text);
  font-weight: 500;
  transition: all var(--transition);
}

.sidebar-widget a:hover {
  background: var(--color-accent-glow);
  color: var(--color-accent);
  text-decoration: none;
}

/* ============================================
   Breadcrumbs
   ============================================ */

.breadcrumbs {
  padding: 1rem 0;
  font-size: 0.83rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

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

.breadcrumbs a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.breadcrumbs span {
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* ============================================
   Table of Contents
   ============================================ */

.toc {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
}

.toc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-accent);
  border-radius: 3px 0 0 3px;
}

.toc h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.toc ol {
  padding-left: 1.25rem;
}

.toc li {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.toc a {
  color: var(--color-text-light);
  font-weight: 500;
  transition: color var(--transition);
}

.toc a:hover {
  color: var(--color-accent);
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--color-bg-dark);
  color: #94a3b8;
  padding: 3rem 1.5rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-nav a {
  color: #94a3b8;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.footer-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

.footer-copy {
  font-size: 0.8rem;
  color: #475569;
}

.footer-langs {
  display: flex;
  gap: 0.25rem;
}

.footer-langs a {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.footer-langs a:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}

/* ============================================
   Language Selector Page (root index)
   ============================================ */

.lang-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  color: #fff;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lang-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 30%, rgba(139,92,246,0.1) 0%, transparent 50%);
}

.lang-page h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
  position: relative;
}

.lang-page p {
  font-size: 1.15rem;
  color: #94a3b8;
  margin-bottom: 2.5rem;
  position: relative;
}

.lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.lang-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
}

.lang-grid a:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(99,102,241,0.4);
  transform: translateY(-4px);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2), var(--shadow-glow);
}

.lang-grid .lang-flag {
  font-size: 2.5rem;
}

/* ============================================
   Responsive - Tablet (768px+)
   ============================================ */

@media (min-width: 768px) {
  .hero {
    padding: 5rem 2rem;
  }

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

  .container {
    padding: 3rem 2rem;
  }

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

  .content-wrapper {
    flex-direction: row;
  }

  .sidebar {
    width: 280px;
    flex-shrink: 0;
  }

  .article-header h1 {
    font-size: 2.25rem;
  }

  .lang-page h1 {
    font-size: 4rem;
  }
}

/* ============================================
   Responsive - Desktop (1024px+)
   ============================================ */

@media (min-width: 1024px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .main-nav.active {
    position: static;
    flex-direction: row;
    padding: 0;
    border-bottom: none;
  }

  .nav-toggle {
    display: none;
  }

  .hero {
    padding: 6rem 2rem;
  }

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

  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-header h1 {
    font-size: 2.5rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }
}

/* ============================================
   Large Desktop (1280px+)
   ============================================ */

@media (min-width: 1280px) {
  .hero h1 {
    font-size: 3.5rem;
  }

  .lang-page h1 {
    font-size: 4.5rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .site-header, .site-footer, .sidebar, .nav-toggle, .lang-switcher, .breadcrumbs, .toc {
    display: none;
  }

  body {
    font-size: 11pt;
    color: #000;
    line-height: 1.5;
  }

  .hero {
    background: none;
    color: #000;
    padding: 1rem 0;
  }

  .card, .tool-card {
    border: 1px solid #ccc;
    break-inside: avoid;
  }
}

/* ============================================
   Subtle Animations
   ============================================ */

@media (prefers-reduced-motion: no-preference) {
  .card, .tool-card, .lang-grid a {
    will-change: transform;
  }

  .article-content h2 {
    scroll-margin-top: calc(var(--header-height) + 1.5rem);
  }
}
