/* Reset and Base Styles */

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Manrope:wght@200;400;700&display=swap");
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Dark Mode Colors (Only Mode) */
  --primary-cyan: #22d3ee;
  --primary-light-green: #4ade80;
  --primary-dark-green: #10b981;
  --secondary-cyan: #06b6d4;
  --secondary-light-green: #22c55e;
  --secondary-dark-green: #059669;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --border-color: #475569;
  --shadow-light: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-medium: 0 4px 6px -1px rgb(0 0 0 / 0.3),
    0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-large: 0 10px 15px -3px rgb(0 0 0 / 0.3),
    0 4px 6px -4px rgb(0 0 0 / 0.3);
}

body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-image: url(gfx/bilder/earth-1756274_1920.jpg);
  background-size: cover;
  transition: background-color 0.3s ease, color 0.3s ease;
  /* Bessere Touch-Performance */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Verhindert horizontales Scrollen */
  overflow-x: hidden;
}

/* Scroll-Performance optimiert */

html {
  scroll-behavior: smooth;
  /* iOS Safari scroll fix */
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 800px;
  margin: 2em auto;
  padding: 1em;
}

.cards {
  display: flex;
  gap: 2em;
  justify-content: center;
  margin-bottom: 2em;
  flex-wrap: wrap;
}

.card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px #aaa;
  flex: 1 1 320px;
  padding: 2em;
  text-align: center;
  transition: box-shadow 0.2s;
  min-width: 280px;
}

.card:hover {
  box-shadow: 0 6px 16px #999;
}

button {
  margin-top: 1em;
  padding: 0.5em 1.5em;
  border: none;
  background: #2874a6;
  color: #fff;
  border-radius: 5px;
  cursor: pointer;
  /* Touch-optimiert */
  min-height: 44px;
  min-width: 44px;
}

.hidden {
  display: none;
}

#details {
  background: #eaf3fa;
  border-radius: 10px;
  padding: 1.5em;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

/* Navigation */

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-image: url(gfx/bilder/earth-1756274_1920.jpg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: all 0.3s ease;
  /* Support für ältere Browser */
  -webkit-backdrop-filter: blur(10px);
  height: 80px;
  /* Feste Navbar-Höhe definiert */
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.nav-logo h2 {
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 2rem;
  margin: 0;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  /* Touch-optimiert */
  padding: 0.5rem;
  border-radius: 0.25rem;
}

.nav-link:hover {
  color: var(--primary-cyan);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0.5rem;
  right: 0.5rem;
  width: calc(100% - 1rem);
  height: 2px;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green)
  );
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.youtube-link {
  color: var(--text-secondary);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 0.5rem;
  /* Touch-optimiert */
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
}

.youtube-link:hover {
  color: #ff0000;
  background-color: var(--bg-tertiary);
}

/* Mobile Menu */

.mobile-menu {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  z-index: 999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.mobile-menu.active {
  transform: translateY(0);
}

.mobile-menu .nav-menu {
  flex-direction: column;
  padding: 2rem 0;
  gap: 1rem;
}

/* Hamburger Menu */

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  /* Touch-optimiert */
  padding: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  align-items: center;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Hero Section - KOMPLETT REPARIERT */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url(gfx/bilder/minecraft-6923660_1920.jpg);
  background-size: cover;
  padding-top: 80px;
  /* Fester Abstand zur Navbar */
  padding-bottom: 2rem;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 800px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-align: center;
}

.gradient-text {
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green),
    var(--primary-dark-green)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
  text-align: center;
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  /* Touch-optimiert */
  min-height: 44px;
  text-align: center;
  white-space: nowrap;
  /* Verhindert Layout-Shifts */
  backface-visibility: hidden;
  transform: translateZ(0);
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green)
  );
  color: white;
  box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* Floating Cards */

.hero-visual {
  position: relative;
  height: 400px;
  display: none;
  /* Versteckt auf mobilen Geräten für bessere Performance */
}

.floating-card {
  position: absolute;
  border-radius: 1rem;
  box-shadow: var(--shadow-large);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  /* Performance-Optimierung */
  will-change: transform;
  backface-visibility: hidden;
}

.card-1 {
  width: 200px;
  height: 120px;
  background: linear-gradient(135deg, var(--primary-cyan) 20, transparent);
  top: 50px;
  left: 50px;
  animation: float 6s ease-in-out infinite;
}

.card-2 {
  width: 160px;
  height: 100px;
  background: linear-gradient(
    135deg,
    var(--primary-light-green) 20,
    transparent
  );
  top: 200px;
  right: 80px;
  animation: float 6s ease-in-out infinite 2s;
}

.card-3 {
  width: 180px;
  height: 110px;
  background: linear-gradient(
    135deg,
    var(--primary-dark-green) 20,
    transparent
  );
  bottom: 80px;
  left: 20px;
  animation: float 6s ease-in-out infinite 4s;
}

.card-4 {
  width: 180px;
  height: 110px;
  background: linear-gradient(
    135deg,
    var(--primary-dark-green) 20,
    transparent
  );
  bottom: 80px;
  right: 20px;
  animation: float 6s ease-in-out infinite 3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Sections */

.section {
  padding: 5rem 0;
}

.section-alt {
  background-image: url(gfx/bilder/ai-generated-9268117_1920.jpg);
  background-size: cover;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
}

/* News Grid */

#neues {
  background-image: url(gfx/bilder/earth-1756274_1920.jpg);
  background-size: cover;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.news-card {
  background: var(--bg-primary);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  /* Performance-Optimierung */
  backface-visibility: hidden;
  transform: translateZ(0);
}

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

.news-image {
  height: 200px;
  overflow: hidden;
}

.news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  /* Lazy Loading optimiert */
  [loading="lazy"] {
    content-visibility: auto;
    contain-intrinsic-size: 100% 200px;
  }
}

.news-card:hover .news-image img {
  transform: scale(1.05);
}

.news-content {
  padding: 1.5rem;
}

.news-date {
  color: var(--primary-cyan);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0.5rem 0;
  color: var(--text-primary);
  line-height: 1.4;
}

.news-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.news-link {
  color: var(--primary-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.news-link:hover {
  color: var(--secondary-cyan);
}

/* Projects Grid */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.project-card {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-medium);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  /* Performance-Optimierung */
  backface-visibility: hidden;
  transform: translateZ(0);
}

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

.project-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green)
  );
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}

.project-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.feature-tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.project-link {
  color: var(--primary-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--secondary-cyan);
}

/* Installation Guide */

.installation-guide {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
}

.installation-guide h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.code-block {
  background: var(--bg-tertiary);
  border-radius: 0.5rem;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  /* Horizontales Scrollen auf mobil verbessert */
  -webkit-overflow-scrolling: touch;
}

.code-block pre {
  padding: 1.5rem;
  margin: 0;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

.code-block code {
  color: var(--text-primary);
}

/* Contact Section */

#kontakt {
  background-image: url(gfx/bilder/conny-schneider-xuTJZ7uD7PI-unsplash.jpg);
  background-size: cover;
}

.contact-container {
  display: flex;
  flex-direction: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto;
  padding: 1rem;
  max-width: 100%;
}

.contact-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2rem;
  margin: 0 auto;
  max-width: 800px;
  width: 100%;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  width: 100%;
  /* Performance-Optimierung */
  backface-visibility: hidden;
  transform: translateZ(0);
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

.contact-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green)
  );
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: 1rem;
  flex-shrink: 0;
}

.contact-card h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.contact-card p {
  margin: 0;
  color: var(--text-secondary);
  word-break: break-word;
}

/* Footer */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-content p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.3s ease;
  padding: 0.25rem;
}

.footer-link:hover {
  color: var(--primary-cyan);
}

/* Legal Pages Styles */

.legal-section {
  padding: 8rem 0 4rem;
  min-height: 100vh;
  /* iOS Safari fix */
  min-height: -webkit-fill-available;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.legal-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(
    135deg,
    var(--primary-cyan),
    var(--primary-light-green)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-card {
  background: var(--bg-secondary);
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
}

.legal-card h2 {
  color: var(--primary-cyan);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.legal-card h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem 0;
}

.legal-info p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.legal-info ul,
.legal-info ol {
  color: var(--text-secondary);
  margin: 1rem 0;
  padding-left: 2rem;
}

.legal-info li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.legal-link {
  color: var(--primary-cyan);
  text-decoration: none;
  transition: color 0.3s ease;
  word-break: break-word;
}

.legal-link:hover {
  color: var(--secondary-cyan);
}

.back-link {
  text-align: center;
  margin-top: 3rem;
}

/* Einbettung für iframe */

.einbettung {
  border: solid var(--secondary-dark-green) 10px;
  box-shadow: 0px 0px 25px var(--primary-light-green);
  border-radius: 30px;
  overflow: hidden;
  width: 100%;
  height: 800px;
  max-width: 100%;
}

.spotting-container .container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(
    135deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 100%
  );
  padding-top: 80px;
  position: relative;
  overflow: hidden;
  /* iOS Safari fix */
  min-height: -webkit-fill-available;
}

.footera {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
  /* Touch-optimiert */
  padding: 0.5rem;
  border-radius: 0.25rem;
  font-size: 15.3px;
}
.footera:hover {
  color: var(--primary-cyan);
}

/* Responsive Design - Mobile First Approach */

/* Sehr kleine Geräte (320px - 480px) - iPhone SE, kleine Android */

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  .nav-container {
    padding: 0.75rem;
  }
  .hero {
    min-height: 100vh;
    padding-top: 100px;
    /* Mehr Abstand für kleine Geräte */
    padding-bottom: 2rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-container {
    padding: 2rem 0.5rem;
    gap: 2rem;
  }
  .hero-title {
    font-size: clamp(1.75rem, 8vw, 2rem);
    margin-bottom: 1rem;
  }
  .hero-subtitle {
    font-size: clamp(0.9rem, 4vw, 1rem);
    margin-bottom: 2rem;
  }
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }
  .btn {
    width: 100%;
    padding: 1rem;
  }
  .section {
    padding: 3rem 0;
  }
  .section-title {
    font-size: clamp(1.5rem, 6vw, 1.75rem);
  }
  .news-grid,
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .news-card,
  .project-card,
  .contact-card {
    padding: 1.25rem;
  }
  .installation-guide,
  .legal-card {
    padding: 1.25rem;
  }
  .code-block pre {
    padding: 1rem;
    font-size: 0.75rem;
  }
  .legal-title {
    font-size: clamp(1.5rem, 8vw, 1.75rem);
  }
  .legal-card h2 {
    font-size: 1.125rem;
  }
  .legal-card h3 {
    font-size: 1rem;
  }
  .footer-links {
    gap: 1rem;
    justify-content: center;
  }
  .einbettung {
    height: 60vh;
    min-height: 400px;
  }
}

/* Kleine Geräte (481px - 768px) - Große Phones, kleine Tablets */

@media (min-width: 481px) and (max-width: 768px) {
  .hero {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 2rem;
  }
  .hero-container {
    padding: 2rem 1rem;
  }
  .hero-visual {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    transition: left 0.3s ease;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
  }
  .nav-menu.active {
    left: 0;
  }
  .nav-menu li {
    margin: 1rem 0;
  }
  .hero-buttons {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
  }
  .btn {
    width: 100%;
  }
  .contact-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .einbettung {
    height: 70vh;
    min-height: 500px;
  }
}

/* Samsung Galaxy Geräte - Spezifische Fixes */

/* Samsung Galaxy Note 20 (412x915) */

@media screen and (min-width: 412px) and (max-width: 412px) and (min-height: 915px) {
  .hero {
    min-height: 100vh;
    padding-top: 120px;
    /* Extra Abstand für Note 20 */
    padding-bottom: 3rem;
  }
  .hero-container {
    padding: 3rem 1rem;
    gap: 2.5rem;
  }
  .hero-title {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
  }
  .hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
  }
  .navbar {
    height: 85px;
    /* Etwas höhere Navbar für Note 20 */
  }
  .section {
    padding: 4.5rem 0;
  }
}

/* Samsung Galaxy S20 Ultra (411x914) */

@media screen and (min-width: 411px) and (max-width: 411px) and (min-height: 914px) {
  .hero {
    min-height: 100vh;
    padding-top: 115px;
    /* Extra Abstand für S20 Ultra */
    padding-bottom: 2.5rem;
  }
  .hero-container {
    padding: 2.5rem 1rem;
    gap: 2rem;
  }
  .hero-title {
    font-size: 2.125rem;
    margin-bottom: 1.25rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2.25rem;
  }
  .navbar {
    height: 82px;
  }
  .legal-section {
    padding: 7rem 0 4rem;
  }
  .project-card,
  .news-card {
    padding: 1.75rem;
  }
  .einbettung {
    height: 65vh;
    min-height: 500px;
  }
}

/* Samsung Galaxy S21/S22/S23 Series (360x800, 384x854) */

@media screen and (min-width: 360px) and (max-width: 384px) and (min-height: 800px) {
  .hero {
    min-height: 100vh;
    padding-top: 110px;
    padding-bottom: 2rem;
  }
  .hero-container {
    padding: 2rem 1rem;
    gap: 1.5rem;
  }
  .hero-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  .navbar {
    height: 80px;
  }
}

/* Medium Geräte (769px - 1024px) - Tablets, kleine Laptops */

@media (min-width: 769px) and (max-width: 1024px) {
  .hero {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 3rem;
  }
  .hero-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
    padding: 3rem 2rem;
  }
  .hero-visual {
    display: block;
    height: 300px;
  }
  .contact-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .news-grid,
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  .legal-title {
    font-size: 2.5rem;
  }
  .einbettung {
    height: 75vh;
    min-height: 600px;
  }
}

/* Große Geräte (1025px - 1440px) - Laptops, Desktops */

@media (min-width: 1025px) and (max-width: 1440px) {
  .hero {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 4rem;
  }
  .hero-visual {
    display: block;
  }
  .hero-container {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    text-align: left;
    padding: 3rem 2rem;
  }
  .hero-content {
    text-align: left;
  }
  .hero-title,
  .hero-subtitle {
    text-align: left;
  }
  .hero-buttons {
    justify-content: flex-start;
  }
  .contact-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .news-grid,
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

/* Extra große Geräte (1441px+) - Große Desktops, 4K Monitore */

@media (min-width: 1441px) {
  .container {
    max-width: 1400px;
  }
  .nav-container {
    max-width: 1400px;
  }
  .hero-container {
    max-width: 1400px;
  }
  .legal-content {
    max-width: 900px;
  }
  .section {
    padding: 6rem 0;
  }
  .hero {
    padding-top: 80px;
    padding-bottom: 5rem;
  }
  .hero-title {
    font-size: 4rem;
  }
  .section-title {
    font-size: 3rem;
  }
}

/* iPhone Geräte - Spezifische Fixes */

/* iPhone SE (375x667) */

@media screen and (min-width: 375px) and (max-width: 375px) and (min-height: 667px) {
  .hero {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 2rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .section-title {
    font-size: 1.75rem;
  }
  .nav-container {
    padding: 0.875rem 1rem;
  }
}

/* iPhone 12, 13, 14 (390x844) */

@media screen and (min-width: 390px) and (max-width: 390px) and (min-height: 844px) {
  .hero {
    min-height: 100vh;
    padding-top: 110px;
    padding-bottom: 2rem;
  }
  .legal-section {
    padding: 7.5rem 0 4rem;
  }
}

/* iPhone 12 Pro Max, 13 Pro Max, 14 Plus (428x926) */

@media screen and (min-width: 428px) and (max-width: 428px) and (min-height: 926px) {
  .hero {
    min-height: 100vh;
    padding-top: 110px;
    padding-bottom: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.125rem;
  }
  .news-card,
  .project-card {
    padding: 1.75rem;
  }
  .contact-card {
    padding: 1.5rem;
  }
}

/* Samsung Galaxy Tab A8 spezifischer Fix */
/* Samsung Galaxy Tab A8 - Hamburger-Menü AUSSCHALTEN */

/* Spezifisch für Samsung Galaxy Tab A8 (1200x800) */
@media screen and (min-width: 1200px) and (max-width: 1200px) and (min-height: 800px) and (max-height: 800px) {
  .hamburger {
    display: none !important;
  }

  .nav-menu {
    display: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    padding: 0 !important;
    border: none !important;
    overflow: visible !important;
    z-index: auto !important;
    gap: 2rem;
    transform: none !important;
    transition: none !important;
  }

  .nav-menu li {
    margin: 0 !important;
    width: auto !important;
    text-align: left !important;
  }

  .nav-link {
    display: inline-block !important;
    padding: 0.5rem !important;
    width: auto !important;
    text-align: left !important;
    font-size: 1rem !important;
    position: relative !important;
  }

  .nav-link::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0.5rem;
    right: 0.5rem;
    width: calc(100% - 1rem);
    height: 2px;
    background: linear-gradient(
      135deg,
      var(--primary-cyan),
      var(--primary-light-green)
    );
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: center;
  }

  .nav-link:hover::after {
    transform: scaleX(1);
  }

  .youtube-link {
    padding: 0.5rem !important;
    width: auto !important;
    justify-content: center !important;
  }
}

/* Erweiterte Regel für Tablets ab 1024px Breite - Desktop-Menü anzeigen */
@media screen and (min-width: 1024px) {
  .hamburger {
    display: none !important;
  }

  .nav-menu {
    display: flex !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    padding: 0 !important;
    border: none !important;
    overflow: visible !important;
    z-index: auto !important;
    gap: 2rem;
    transform: none !important;
    transition: none !important;
  }

  .nav-menu li {
    margin: 0 !important;
    width: auto !important;
    text-align: left !important;
  }

  .nav-link {
    display: inline-block !important;
    padding: 0.5rem !important;
    width: auto !important;
    text-align: left !important;
    font-size: 1rem !important;
    position: relative !important;
  }

  .youtube-link {
    padding: 0.5rem !important;
    width: auto !important;
    justify-content: center !important;
  }
}

/* Hamburger-Menü nur für kleine Geräte (unter 1024px) */
@media screen and (max-width: 1023px) {
  .hamburger {
    display: flex !important;
  }

  .nav-menu {
    display: none !important;
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    transition: left 0.3s ease;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 999;
  }

  .nav-menu.active {
    display: flex !important;
    left: 0;
  }

  .nav-menu li {
    margin: 1rem 0;
    width: 100%;
    text-align: center;
  }

  .nav-link {
    display: block;
    padding: 1rem;
    width: 100%;
    text-align: center;
    font-size: 1.1rem;
  }

  .nav-link::after {
    display: none;
  }

  .youtube-link {
    padding: 1rem;
    width: 100%;
    justify-content: center;
  }
}

/* Spezielle Regel für iPad-ähnliche Tablets (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .hamburger {
    display: flex !important;
  }

  .nav-menu {
    display: none !important;
  }

  .nav-menu.active {
    display: flex !important;
  }
}

/* Override für alle vorherigen widersprüchlichen Regeln */
@media screen and (min-width: 1024px) {
  .nav-menu.active {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    flex-direction: row !important;
    padding: 0 !important;
    border: none !important;
  }
}

/* Hamburger-Menü für Tablet-Größen erzwingen */

@media screen and (min-width: 800px) and (max-width: 1280px) {
  .hamburger {
    display: flex !important;
  }
  .nav-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    transition: left 0.3s ease;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 999;
  }
  .nav-menu.active {
    display: flex !important;
    left: 0;
  }
  .nav-menu li {
    margin: 1rem 0;
    width: 100%;
    text-align: center;
  }
  .nav-link {
    display: block;
    padding: 1rem;
    width: 100%;
    text-align: center;
  }
}

/* Zusätzliche Regel für Samsung Galaxy Tab A8 im Landscape Modus */

@media screen and (min-width: 1280px) and (max-width: 1280px) and (orientation: landscape) {
  .hamburger {
    display: flex !important;
  }
  .nav-menu {
    display: none;
  }
}

/* Sicherheitsregel - Hamburger für alle Tablets unter 1400px */

@media screen and (max-width: 1399px) {
  .hamburger {
    display: flex !important;
  }
  .nav-menu {
    display: none;
  }
  .nav-menu.active {
    display: flex !important;
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 999;
  }
}

/* iPad Mini, iPad (768x1024) */

@media screen and (min-width: 768px) and (max-width: 834px) and (min-height: 1024px) {
  .hamburger {
    display: none;
  }
  .nav-menu {
    position: static;
    height: auto;
    background: transparent;
    flex-direction: row;
    padding: 0;
    border: none;
  }
  .hero {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 3rem;
  }
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    padding: 3rem 2rem;
  }
  .hero-visual {
    display: block;
    height: 350px;
    margin: 0 auto;
  }
  .news-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  .contact-content {
    grid-template-columns: repeat(2, 1fr);
  }
  .einbettung {
    height: 80vh;
    min-height: 650px;
  }
}

/* iPad Air, iPad Pro (820x1180, 1024x1366) */

@media screen and (min-width: 820px) and (max-width: 1024px) {
  .hero {
    padding-top: 80px;
    padding-bottom: 4rem;
  }
  .hero-container {
    grid-template-columns: 1fr 0.8fr;
    text-align: left;
    padding: 3rem 2rem;
  }
  .hero-content {
    text-align: left;
  }
  .hero-title,
  .hero-subtitle {
    text-align: left;
  }
  .hero-buttons {
    justify-content: flex-start;
  }
  .hero-visual {
    display: block;
  }
  .news-grid,
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
  .section {
    padding: 5rem 0;
  }
}

/* Landscape Orientierung für Mobile - Verbesserte Fixes */

@media screen and (max-width: 926px) and (orientation: landscape) and (max-height: 428px) {
  .hero {
    min-height: 100vh;
    padding-top: 80px;
    padding-bottom: 1rem;
  }
  .hero-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }
  .hero-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }
  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  .hero-buttons {
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
  }
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  .hero-visual {
    display: none;
  }
  .section {
    padding: 2rem 0;
  }
  .navbar {
    padding: 0.25rem 0;
    height: 60px;
  }
  .nav-container {
    padding: 0.25rem 1rem;
  }
  .legal-section {
    padding: 4rem 0 2rem;
  }
  .einbettung {
    height: 40vh;
    min-height: 250px;
  }
}

/* High DPI Displays (Retina, Samsung AMOLED) */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-visual {
    /* Optimierte Animationen für High-DPI */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  .floating-card {
    /* Schärfere Schatten für Retina Displays */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }
  .btn-primary:hover {
    box-shadow: 0 12px 40px rgba(34, 211, 238, 0.3);
  }
}

/* Dark Mode Präferenz (falls System Dark Mode) */

@media (prefers-color-scheme: dark) {
  /* Bereits im Dark Mode - keine Änderungen nötig */
}

/* Reduzierte Bewegung für Accessibility */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .floating-card {
    animation: none;
  }
  .btn-primary:hover,
  .news-card:hover,
  .project-card:hover,
  .contact-card:hover {
    transform: none;
  }
}

/* High Contrast für bessere Accessibility */

@media (prefers-contrast: high) {
  :root {
    --border-color: #ffffff;
    --text-secondary: #e2e8f0;
    --shadow-medium: 0 4px 6px rgba(255, 255, 255, 0.1);
    --shadow-large: 0 10px 15px rgba(255, 255, 255, 0.15);
  }
  .btn-secondary {
    border-width: 3px;
  }
  .nav-link::after {
    height: 3px;
  }
}

/* Touch Geräte - verbesserte Touch Targets */

@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .youtube-link,
  .hamburger,
  .project-link,
  .news-link,
  .legal-link,
  .footer-link {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
  }
  .nav-link {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
  }
  /* Größere Touch-Bereiche für Links */
  .project-link,
  .news-link {
    padding: 0.5rem 0;
    margin: 0.25rem 0;
  }
  /* Hover-Effekte deaktivieren für Touch */
  .btn-primary:hover,
  .news-card:hover,
  .project-card:hover,
  .contact-card:hover {
    transform: none;
  }
  /* Focus States für Touch Navigation */
  .btn:focus,
  .nav-link:focus,
  .project-link:focus,
  .news-link:focus {
    outline: 2px solid var(--primary-cyan);
    outline-offset: 2px;
  }
}

/* Print Styles */

@media print {
  .navbar,
  .hero-visual,
  .hamburger,
  .youtube-link,
  .einbettung {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .hero {
    min-height: auto;
    padding: 2rem 0;
  }
  .section {
    padding: 2rem 0;
    break-inside: avoid;
  }
  .legal-card,
  .project-card,
  .news-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .code-block {
    background: #f5f5f5 !important;
    border: 1px solid #ccc;
  }
  .code-block pre {
    color: #000 !important;
  }
  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
  .gradient-text {
    -webkit-text-fill-color: unset !important;
    color: black !important;
  }
}

/* Performance Optimierungen */

.hero-visual,
.floating-card,
.news-card,
.project-card,
.contact-card {
  contain: layout style paint;
}

/* Scroll-Performance */

.hero,
.section {
  contain: layout;
}

/* Lazy Loading Support */

.news-image img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

.news-image img[loading="lazy"].loaded {
  opacity: 1;
}

/* Focus Management für bessere Accessibility */

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-cyan);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.3s;
}

.skip-link:zentrierung:focus {
  top: 0;
}

/* Verbesserte Lesbarkeit */

p,
li {
  max-width: 75ch;
}

/* Smooth Scrolling nur wenn unterstützt */

@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}

/* Grid Fallback für ältere Browser */

@supports not (display: grid) {
  .news-grid,
  .projects-grid,
  .contact-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
  }
  .news-card,
  .project-card,
  .contact-info {
    flex: 1 1 300px;
    min-width: 300px;
  }
}

/* Backdrop-filter Fallback */

@supports not (backdrop-filter: blur(10px)) {
  .navbar {
    background: var(--bg-primary);
  }
}

/* Container Query Support für moderne Browser */

@supports (container-type: inline-size) {
  .projects-grid,
  .news-grid {
    container-type: inline-size;
  }
  @container (max-width: 600px) {
    .project-card,
    .news-card {
      padding: 1.25rem;
    }
  }
}
