/* Grundlegende Styles */
body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: white;
    color: #333;
}

/* Hauptinhalt */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero-Bereich */
.hero {
    padding: 60px 30px;
    background: linear-gradient(135deg, #88c4ff 0%, #c2e9fb 100%);
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: #1e3c72;
    position: relative;
    z-index: 2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

/* Hintergrund-Elemente */
.bg-element {
    position: absolute;
    opacity: 0.1;
    z-index: 1;
}

.math-element {
    font-size: 4rem;
    top: 20px;
    right: 50px;
    transform: rotate(20deg);
    color: #1e3c72;
}

.chemistry-element {
    font-size: 4rem;
    bottom: 30px;
    left: 60px;
    transform: rotate(-15deg);
    color: #1e3c72;
}

/* Van-der-Waals-Kräfte Hero-Elemente */
.vdw-element-1 {
  font-size: 5rem;
  top: 25px;
  right: 60px;
  transform: rotate(15deg);
  color: #1e3c72;
  font-weight: bold;
  opacity: 0.2;
}

.vdw-element-2 {
  font-size: 5rem;
  bottom: 30px;
  left: 70px;
  transform: rotate(-5deg);
  color: #1e3c72;
  font-weight: bold;
  opacity: 0.2;
}

.vdw-element-3 {
  font-size: 5rem;
  top: 50px;
  left: 35%;
  transform: rotate(5deg);
  color: #1e3c72;
  opacity: 0.2;
}

/* Inhaltsbereich */
.content-section {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    border: 1px solid #c2e9fb;
}

.content-section p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* Farbige Texthervorhebungen */
.highlight-math,
.highlight-chemistry {
    color: #1e3c72;
    font-weight: 600;
}

/* Call-to-Action-Button */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(42, 82, 152, 0.3);
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(42, 82, 152, 0.4);
}

/* Themenkarten */
.topic-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
    justify-content: center;
}

.topic-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    width: calc(33.333% - 20px);
    min-width: 280px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #c2e9fb;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.card-icon {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.math-card .card-icon,
.chemistry-card .card-icon,
.lottery-card .card-icon {
    background: linear-gradient(135deg, #88c4ff 0%, #c2e9fb 100%);
    color: #1e3c72;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    margin-top: 0;
    color: #333;
}

.card-content p {
    color: #666;
    margin-bottom: 15px;
}

.card-link {
    display: inline-block;
    color: #1e3c72;
    font-weight: 600;
    text-decoration: none;
    padding: 5px 0;
    position: relative;
}

.card-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #1e3c72;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}

.card-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

/* Mathematik8 spezifische Styles */
.bg-element-1,
.bg-element-2,
.bg-element-3 {
    position: absolute;
    opacity: 0.1;
    z-index: 1;
    color: white;
}

.math-element-1 {
    font-size: 5rem;
    top: 20px;
    right: 50px;
    transform: rotate(15deg);
}

.math-element-2 {
    font-size: 4rem;
    bottom: 20px;
    left: 60px;
    transform: rotate(-10deg);
}

.math-element-3 {
    font-size: 3.5rem;
    top: 70px;
    left: 30%;
    transform: rotate(5deg);
}

.content-section h2 {
    color: #1e3c72;
    margin-top: 0;
    border-bottom: 2px solid #f2f2f2;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Themenkarten für Mathematik */
.math-topic-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.math-topic-card {
    flex: 1;
    min-width: 250px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid #c2e9fb;
}

.math-topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.math-card-header {
    padding: 20px;
    background: linear-gradient(135deg, #88c4ff 0%, #c2e9fb 100%);
    color: #1e3c72;
}

.math-card-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.topic-links {
    margin-top: 15px;
}

.topic-link {
    display: block;
    padding: 8px 0;
    color: #1e3c72;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f2f2f2;
}

.topic-link:last-child {
    border-bottom: none;
}

.topic-link:hover {
    color: #88c4ff;
    padding-left: 5px;
}

.topic-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Highlight für besondere Links */
.highlight-link {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #88c4ff;
    margin: 20px 0;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.highlight-link:hover {
    background-color: #e6f2ff;
    transform: translateX(5px);
}

.highlight-link i {
    font-size: 2rem;
    margin-right: 15px;
    color: #1e3c72;
}

.highlight-link-content {
    flex: 1;
}

.highlight-link h3 {
    margin: 0 0 5px 0;
    color: #1e3c72;
}

.highlight-link p {
    margin: 0;
    font-size: 1rem;
}

.highlight-link a {
    display: inline-block;
    margin-top: 10px;
    color: #1e3c72;
    text-decoration: none;
    font-weight: 600;
}

.highlight-link a:hover {
    text-decoration: underline;
}

/* Interaktiver Bereich */
.interactive-section {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid #c2e9fb;
}

.interactive-section h2 {
    color: #1e3c72;
    margin-top: 0;
    margin-bottom: 20px;
}

.interactive-section p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Gleichungssysteme spezifische Stile */
.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px 60px 20px;
    background-color: #f9f9f9;
    min-height: calc(100vh - 150px);
}

/* Angepasste Überschriften für Gleichungssysteme */
.content-wrapper h1 {
    color: #1e3c72;
    margin-bottom: 25px;
    font-size: 2.2rem;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.content-wrapper h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #1e3c72, #88c4ff);
    border-radius: 2px;
}

.content-wrapper h2 {
    color: #2a5298;
    margin: 20px 0;
    font-size: 1.6rem;
}

.content-wrapper h3 {
    margin-top: 0;
    color: #fff;
    font-size: 1.3rem;
}

/* Einführungsbereich */
.intro-container {
    background: linear-gradient(135deg, #88c4ff 0%, #c2e9fb 100%);
    border-radius: 15px;
    color: #1e3c72;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(136, 196, 255, 0.2);
}

.intro-container p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Aufgabenkarten */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.task-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.task-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.task-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    display: flex;
    align-items: center;
}

.task-header i {
    font-size: 1.8rem;
    margin-right: 15px;
}

.task-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.task-content p {
    margin-top: 0;
    margin-bottom: 20px;
    flex-grow: 1;
    color: #555;
    line-height: 1.5;
}

.task-difficulty {
    display: flex;
    margin-bottom: 15px;
}

.difficulty-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ddd;
    margin-right: 4px;
}

.difficulty-dot.active {
    background-color: #3498db;
}

.task-btn {
    display: inline-block;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.task-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1a5276 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* Farbvariationen für die verschiedenen Aufgabenkarten */
.task-card:nth-child(1) .task-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.task-card:nth-child(2) .task-header {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.task-card:nth-child(3) .task-header {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
}

.task-card:nth-child(4) .task-header {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

/* Angepasster Footer für Gleichungssysteme */
.page-footer {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hilfe-Button */
.help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #3498db;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
    z-index: 1000;
}

.help-button:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Lotto-spezifische Hero-Elemente */
.lotto-element-1 {
  font-size: 4.5rem;
  top: 25px;
  right: 60px;
  transform: rotate(15deg);
  color: #1e3c72;
}

.lotto-element-2 {
  font-size: 5rem;
  bottom: 30px;
  left: 70px;
  transform: rotate(-5deg);
  color: #1e3c72;
  font-weight: bold;
}

.lotto-element-3 {
  font-size: 3.5rem;
  top: 40px;
  left: 25%;
  transform: rotate(10deg);
  color: #1e3c72;
}

/* Chemie-spezifische Hero-Elemente */
.chem-element-1 {
  font-size: 5rem;
  top: 20px;
  right: 50px;
  transform: rotate(15deg);
  color: #1e3c72;
}

.chem-element-2 {
  font-size: 4rem;
  bottom: 20px;
  left: 60px;
  transform: rotate(-10deg);
  color: #1e3c72;
}

.chem-element-3 {
  font-size: 3.5rem;
  top: 70px;
  left: 30%;
  transform: rotate(5deg);
  color: #1e3c72;
}

/* Vierfeldertafel-spezifische Hero-Elemente */
.vierfeldertafel-element-1 {
  font-size: 5rem;
  top: 25px;
  right: 60px;
  transform: rotate(15deg);
  color: #1e3c72;
  font-weight: bold;
}

.vierfeldertafel-element-2 {
  font-size: 3.5rem;
  bottom: 30px;
  left: 70px;
  transform: rotate(-10deg);
  color: #1e3c72;
}

.vierfeldertafel-element-3 {
  font-size: 4rem;
  top: 50px;
  left: 35%;
  transform: rotate(5deg);
  color: #1e3c72;
}

/* Molekül-Animation Styles */
.molecule-container {
  perspective: 800px;
  width: 300px;
  height: 300px;
  margin: 0 auto 20px auto;
  padding: 20px;
}

.molecule {
  position: relative;
  transform-style: preserve-3d;
  width: 100%;
  height: 100%;
  animation: rotate 20s infinite linear;
}

.atom {
  position: absolute;
  width: 40px;
  height: 40px;
  background-color: #88c4ff;
  color: #1e3c72;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 18px;
  z-index: 10;
}

.bond {
  position: absolute;
  background-color: #c2e9fb;
  transform-origin: top left;
  z-index: 5;
}

@keyframes rotate {
  from {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
  }
}

/* Animation für visuelle Effekte */
@keyframes highlightCell {
  0% { background-color: #ffffff; }
  50% { background-color: #c2e9fb; }
  100% { background-color: #e8f0fe; }
}

.highlight-animation {
  animation: highlightCell 1.5s ease-in-out;
}

/* Quiz-Stile */
.quiz-container {
  background-color: #f9f9fa;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #c2e9fb;
}

.quiz-question {
  background-color: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #c2e9fb;
}

.quiz-options {
  margin: 10px 0;
}

.quiz-options label {
  display: block;
  padding: 8px;
  margin: 5px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.quiz-options label:hover {
  background-color: #e8f0fe;
}

.quiz-results {
  background-color: #f0f7ff;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  border-left: 4px solid #88c4ff;
}

.correct {
  color: #2e7d32;
  font-weight: bold;
}

.incorrect {
  color: #c62828;
  font-weight: bold;
}

/* Tabellen-Stil */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background-color: white;
}

table th, table td {
  padding: 10px;
  text-align: left;
  border: 1px solid #c2e9fb;
}

table th {
  background-color: #e8f0fe;
  color: #1e3c72;
  font-weight: bold;
}

/* Slider-Container und Controls */
.slider-container {
  margin: 20px auto;
  max-width: 500px;
  text-align: center;
}

.zoom-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-size: 14px;
  color: #555;
}

#zoomSlider {
  width: 100%;
  margin: 10px 0;
}

.zoom-display {
  margin-bottom: 20px;
}

.controls-container {
  display: flex;
  justify-content: center;
  margin: 15px 0 25px;
}

/* Canvas und Animation Stile */
.canvas-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px 0;
}

canvas {
  background-color: #ffffff;
  border: 2px solid #c2e9fb;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  max-width: 100%;
}

/* Animation-Section Stile */
.animation-section {
  padding-top: 20px;
}

.animation-section h2 {
  color: #1e3c72;
  margin-bottom: 15px;
}

/* Listen-Stile */
ul, ol {
  padding-left: 2.5rem !important;  /* Erhöhter Einzug für Listen */
  margin-bottom: 20px !important;
}

li {
  margin-bottom: 8px !important;  /* Abstand zwischen Listeneinträgen */
  line-height: 1.7 !important;    /* Übereinstimmend mit Absatztext */
}

/* Verschachtelte Listen */
ul ul, ol ol, ul ol, ol ul {
  margin-top: 8px !important;
  margin-bottom: 0 !important;
  padding-left: 2rem !important;  /* Einzug für verschachtelte Listen */
}

/* Anpassung für Content-Sections */
.content-section ul,
.content-section ol {
  padding-left: 3rem !important;  /* Noch mehr Einzug in Content-Bereichen */
}

/* Listen in Cards */
.card-content ul,
.card-content ol {
  padding-left: 2rem !important;
}

/* Definition Lists */
dl {
  padding-left: 1.5rem !important;
  margin-bottom: 20px !important;
}

dt {
  font-weight: bold !important;
  color: #1e3c72 !important;  /* Passend zur Farbpalette */
  margin-bottom: 5px !important;
}

dd {
  margin-left: 1.5rem !important;
  margin-bottom: 15px !important;
}

/* Lotto- und Stochastik-spezifische Stile */
/* Container und Sektionen für Lotto */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section, .math-container {
  background-color: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  margin-bottom: 30px;
  border: 1px solid #c2e9fb;
}

.math-container {
  border-left: 4px solid #88c4ff;
}

.top-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.top-section {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background-color: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  margin-bottom: 30px;
  border: 1px solid #c2e9fb;
}

.top-section .controls {
  margin-top: auto;
  text-align: center;
}

/* Tippschein (Lotterieschein) */
.lottery-slip {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 5px !important;
  max-width: 300px !important;
  margin: 10px 0 !important;
}

.slip-number {
  border: 1px solid #ccc !important;
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  text-align: center !important;
  line-height: 40px !important;
  background-color: #fff !important;
  color: #333 !important;
  font-weight: bold !important;
  transition: background-color 0.3s ease !important;
}

/* Angekreuzte (getippte) Zahlen im Tippschein */
.slip-number.marked {
  background-color: #88c4ff !important;
  color: #1e3c72 !important;
}

/* Bei Übereinstimmung: Mischung mit Lichteffekt */
.slip-number.matched {
  background: linear-gradient(90deg, #88c4ff 50%, #c2e9fb 50%) !important;
  animation: pulse 1s ease-in-out infinite !important;
  color: #1e3c72 !important;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 5px rgba(255,255,255,0.5);
  }
  50% {
    box-shadow: 0 0 15px rgba(255,255,255,1);
  }
  100% {
    box-shadow: 0 0 5px rgba(255,255,255,0.5);
  }
}

/* Lotterie-Kugeln */
.lottery-ball {
  display: inline-block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #c2e9fb;
  color: #1e3c72;
  text-align: center;
  line-height: 40px;
  font-weight: bold;
  margin: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

/* Gezogene Kugeln (Ziehung) */
.lottery-ball.selected {
  background-color: #88c4ff;
  color: #1e3c72;
  transform: scale(1.1);
}

.lottery-ball.superzahl {
  background-color: #c2e9fb;
}

/* Lottomaschine */
.lottery-machine {
  background-color: transparent;
  border: none;
  padding: 20px;
  margin: 20px 0;
  position: relative;
  min-height: 200px;
}

/* Ziehtrommel */
.lottery-drum {
  background-color: #f2f2f2;
  border-radius: 50%;
  width: 300px;
  height: 300px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.ball-container {
  margin-top: 20px;
  text-align: center;
}

.controls button {
  background-color: #88c4ff;
  color: #1e3c72;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  margin: 5px;
  transition: all 0.3s ease;
}

.controls button:hover {
  background-color: #1e3c72;
  color: white;
  transform: translateY(-3px);
}

.controls button:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

/* Animation der schwimmenden Kugeln */
.floating-balls {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.floating-ball {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Mathematische Formatierungen */
.formula {
  text-align: center;
  margin: 15px 0;
  font-size: 1.1em;
}

.fraction {
  display: inline-block;
  vertical-align: middle;
  text-align: center;
  margin: 0 3px;
}

.fraction > span {
  display: block;
}

.fraction > span:first-child {
  border-bottom: 1px solid black;
  padding-bottom: 2px;
  margin-bottom: 2px;
}

/* Quiz-Stile */
.quiz-question {
  background-color: #f5f7fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #c2e9fb;
}

.quiz-options {
  margin: 10px 0;
}

.quiz-option {
  margin: 8px 0;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
}

.quiz-option:hover {
  background-color: #e8f0fe;
}

.quiz-option input[type="radio"] {
  margin-right: 10px;
}

.quiz-feedback {
  margin-top: 10px;
  padding: 10px;
  border-radius: 4px;
  display: none;
}

.quiz-feedback.correct {
  background-color: #e8f5e9;
  border-left: 4px solid #2e7d32;
}

.quiz-feedback.incorrect {
  background-color: #ffebee;
  border-left: 4px solid #c62828;
}

.quiz-feedback.warning {
  background-color: #fff8e1;
  border-left: 4px solid #f9a825;
}

/* Ergebnisboxen */
.result-box {
  background-color: #e8f5e9;
  border-left: 4px solid #2e7d32;
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
  display: none;
}

/* Formularelemente */
.form-control {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  margin: 5px;
}

select.form-control {
  min-width: 120px;
}

.controls-btn {
  background-color: #88c4ff;
  color: #1e3c72;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  margin: 10px 5px;
  transition: all 0.3s ease;
}

.controls-btn:hover {
  background-color: #1e3c72;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Lösung ausblenden/anzeigen */
.show-solution-btn {
  background-color: #f5f7fa;
  border: 1px solid #88c4ff;
  color: #1e3c72;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  margin: 10px 0;
  transition: all 0.3s ease;
}

.show-solution-btn:hover {
  background-color: #e8f0fe;
  color: #1e3c72;
}

.solution {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-top: 10px;
  border: 1px solid #c2e9fb;
}

/* Tabellen-Styling für Vergleichstabelle */
#probability-comparison {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#probability-comparison th {
  background-color: #88c4ff;
  color: #1e3c72;
}

#probability-comparison tr:nth-child(1) {
  background-color: #e8f0fe;
}

#probability-comparison tr:nth-child(even) {
  background-color: #f5f7fa;
}

#probability-comparison tr:hover {
  background-color: #e8f0fe;
}

/* Simulation Progress Bar */
#progress-bar-container {
  overflow: hidden;
}

#progress-bar {
  transition: width 0.3s ease;
}


/* Angepasste Listen-Styles aus style-chemie11.css */

/* Listen in speziellen Containern - zusätzliche Einrückung */
.formula-box ul, .example-box ul, .attention ul, .strategy-box ul, .flex-item ul,
.card-content ul, .card-content ol {
    padding-left: 25px !important;
}

/* Highlight-Boxen aus style-chemie11.css */
.formula-box, .example-box, .attention, .strategy-box, .result-box {
    border-left: 5px solid;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.formula-box {
    background-color: #e6f2ff;
    border-left-color: #1e3c72;
    font-family: 'Courier New', monospace;
}

.formula-box.highlight {
    background-color: #e8f0fe;
}

.example-box {
    background-color: #e8f8f5;
    border-left-color: #2ecc71;
}

.strategy-box {
    background-color: #e6f2ff;
    border-left-color: #1e3c72;
}

.attention {
    background-color: #fdedec;
    border-left-color: #e74c3c;
}

.result-box {
    background-color: #e6f2ff;
    border-left-color: #1e3c72;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

/* Reaktionsergebnis-Boxen */
.reaction-result {
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
}

.exotherm {
    background-color: #d4edda;
    border-left: 4px solid #2ecc71;
}

.endotherm {
    background-color: #f8d7da;
    border-left: 4px solid #e74c3c;
}

/* Energy Visualization */
.energy-container {
    height: 300px;
    position: relative;
    margin: 40px auto;
    max-width: 500px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.energy-diagram {
    position: relative;
    height: 100%;
    width: 100%;
    background-color: #f8f9fa;
    overflow: hidden;
}

.energy-arrow {
    position: absolute;
    width: 80%;
    height: 5px;
    background-color: #1e3c72;
    left: 10%;
    top: 50%;
    transform: translateY(-50%);
}

.energy-arrow::before {
    content: '';
    position: absolute;
    right: -15px;
    top: -7.5px;
    border-style: solid;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent #1e3c72;
}

.energy-state {
    position: absolute;
    width: 150px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 5px;
    font-weight: 600;
}

.reactants {
    top: 60%;
    left: 15%;
    background-color: #88c4ff;
    color: #1e3c72;
}

.products {
    top: 30%;
    right: 15%;
    background-color: #1e3c72;
    color: white;
}

.energy-label {
    position: absolute;
    transform: rotate(-90deg);
    left: -10px;
    top: 50%;
    transform-origin: center;
    font-weight: 600;
    color: #1e3c72;
}

.reaction-label {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-weight: 600;
    color: #1e3c72;
}

/* Molekülmodelle */
.molecule-models {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.molecule-model {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.molecule-model:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.molecule-model img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.molecule-model:hover img {
    filter: brightness(0.7);
}

.molecule-model-label {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: rgba(30, 60, 114, 0.8);
    color: white;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.molecule-model:hover .molecule-model-label {
    bottom: 0;
    background: rgba(30, 60, 114, 1);
}

/* Berechnungs-Container */
.calculation-container {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #e6f2ff;
}

/* Formular-Styling */
#calcForm {
    padding: 20px;
    border-radius: 10px;
    margin: 0;
}

/* Buttons nun gefärbt */
.button {
    display: inline-block;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(42, 82, 152, 0.3);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(42, 82, 152, 0.4);
    background: linear-gradient(135deg, #2a5298 0%, #3a62b8 100%);
}

/* Verbesserte Formatierung für die Formel-Eingabe */
#calcForm .formula-input {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 25px 0;
    font-size: 18px;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

#calcForm .formula-input span {
    font-weight: bold;
    font-size: 20px;
    color: #1e3c72;
}

#calcForm .formula-input input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 18px;
    border: 2px solid #c2e9fb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#calcForm .formula-input input:focus {
    border-color: #1e3c72;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.2);
}

#calcForm .formula-input label {
    font-weight: bold;
    color: #333;
    margin-left: 5px;
    font-family: 'Times New Roman', serif; /* Für chemische Formeln */
}

/* Menü-CSS */
/* Grundlegende Reset-Styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        /* Menü-Container */
        .menu-container {
            width: 100%;
            background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            position: fixed; /* Geändert von sticky zu fixed für bessere Kontrolle */
            top: 0;
            z-index: 1000;
            transition: transform 0.4s ease, opacity 0.3s ease; /* Transition für Scroll-Effekt */
        }
        
        /* Klasse für ausgeblendetes Menü beim Scrollen */
        .menu-hidden {
            transform: translateY(-100%);
            opacity: 0.9;
        }
        
        /* Logo und Menü flexibel ausrichten */
        .nav-wrapper {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px; /* Reduzierter seitlicher Abstand */
        }
        
        /* Logo-Styling */
        .logo {
            padding: 15px 0;
            font-size: 1.8rem;
            font-weight: 700;
            color: white;
            text-decoration: none;
            display: flex;
            align-items: center;
            transition: all 0.3s ease;
            white-space: nowrap; /* Verhindert Umbruch im Titel */
        }
        
        .logo:hover {
            transform: scale(1.05);
        }
        
        .logo img {
            height: 40px;
            margin-right: 10px;
        }
        
        /* Logo anpassen für mobile Ansicht */
        @media screen and (max-width: 768px) {
            .logo {
                font-size: 1.4rem;
                padding: 12px 0;
            }
            
            .logo img {
                height: 30px;
            }
        }
        
        /* Logo anpassen für mittlere Bildschirmgrößen */
        @media screen and (max-width: 1100px) and (min-width: 769px) {
            .logo {
                font-size: 1.2rem;
                padding: 12px 0;
                white-space: nowrap; /* Verhindert Umbruch im Titel */
            }
            
            .logo img {
                height: 30px;
                margin-right: 5px; /* Geringerer Abstand zwischen Logo und Text */
            }
        }
        
        /* Hauptmenü */
        .main-menu {
            display: flex;
            list-style: none;
        }
        
        .main-menu li {
            position: relative;
            transition: all 0.3s ease;
        }
        
        .main-menu li a,
        .main-menu li .menu-item {
            display: flex;
            align-items: center;
            padding: 20px 15px;
            color: white;
            text-decoration: none;
            font-weight: 500;
            font-size: 1rem;
            transition: all 0.3s ease;
            position: relative;
            cursor: pointer;
            white-space: nowrap; /* Verhindert Zeilenumbrüche im Menütext */
        }
        
        /* Größere Schrift für die oberste Ebene */
        .main-menu > li > a,
        .main-menu > li > .menu-item {
            font-size: 1.15rem;
            font-weight: 600;
        }
        
        /* Unterstrich für normale Links */
        .main-menu li a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 3px;
            bottom: 10px;
            left: 50%;
            background-color: #6a92e4;
            transition: all 0.3s ease;
            transform: translateX(-50%);
            border-radius: 5px;
        }
        
        .main-menu li a:hover::after,
        .main-menu li a.active::after {
            width: 70%;
        }
        
        /* Dropdown-Menüs */
        .dropdown {
            position: relative;
        }
        
        /* Icon für Menüelemente */
        .menu-icon {
            margin-right: 6px;
            font-size: 1.1em;
            display: inline-block;
            flex-shrink: 0; /* Verhindert das Schrumpfen des Icons */
        }
        
        /* Unterstrich für Dropdown-Menüs */
        .dropdown > .menu-item > .underline {
            position: absolute;
            width: 0;
            height: 3px;
            bottom: 10px;
            left: 50%;
            background-color: #6a92e4;
            transition: all 0.3s ease;
            transform: translateX(-50%);
            border-radius: 5px;
        }
        
        .dropdown:hover > .menu-item > .underline {
            width: 70%;
        }
        
        /* Dropdown-Pfeile */
        .dropdown-arrow {
            font-size: 0.7em;
            margin-left: 5px;
            flex-shrink: 0; /* Verhindert das Schrumpfen des Pfeils */
        }
        
        .nested-dropdown-arrow {
            font-size: 0.7em;
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
        }
        
        /* Dropdown-Content */
        .dropdown-content {
            display: none;
            position: absolute;
            background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
            min-width: 200px; /* Breitere Dropdown-Menüs */
            box-shadow: 0 8px 16px rgba(0,0,0,0.2);
            z-index: 1;
            border-radius: 0 0 5px 5px;
            transform-origin: top center;
            transform: scaleY(0);
            opacity: 0;
            transition: all 0.3s ease;
        }
        
        .dropdown:hover .dropdown-content {
            display: block;
            transform: scaleY(1);
            opacity: 1;
        }
        
        .dropdown-content a {
            padding: 15px;
            display: block;
            text-align: left;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        
        .dropdown-content a:last-child {
            border-bottom: none;
        }
        
        .dropdown-content a:hover {
            background-color: rgba(255,255,255,0.2);
        }
        
        /* Nested Dropdown */
        .nested-dropdown {
            position: relative;
        }
        
        /* Nested Dropdown Content */
        /* Nested Dropdown Content */
        .nested-dropdown-content {
            display: none;
            position: absolute;
            left: 100%;
            top: 0;
            background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
            min-width: 210px; /* Breitere verschachtelte Dropdown-Menüs */
            box-shadow: 0 8px 16px rgba(0,0,0,0.2);
            z-index: 1;
            border-radius: 0 5px 5px 0;
            transform-origin: left center;
            transform: scaleX(0);
            opacity: 0;
            transition: all 0.3s ease;
        }
        
        .nested-dropdown:hover .nested-dropdown-content {
            display: block;
            transform: scaleX(1);
            opacity: 1;
        }
        
        /* Aktiver Menüpunkt */
        .main-menu li a.active {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        /* Hover-Effekte */
        .main-menu li a:hover,
        .main-menu li .menu-item:hover {
            background-color: rgba(255, 255, 255, 0.15);
            transform: translateY(-3px);
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        }
        
        /* Mobile Hamburger-Icon */
        .menu-toggle {
            display: none;
            cursor: pointer;
            color: white;
            font-size: 2rem;
            padding: 10px;
            z-index: 1100; /* Höherer z-index */
            text-align: center;
            line-height: 1;
        }
        
        /* Hamburger-Icon NUR in der mobilen Ansicht anzeigen */
        @media screen and (max-width: 768px) {
            .menu-toggle {
                display: block;
                position: absolute;
                top: 50%;
                right: 20px;
                transform: translateY(-50%);
            }
        }
        
        /* Platzhalter für den Hauptinhalt, um unter dem fixed Menü Platz zu schaffen */
        .menu-spacer {
            height: 70px; /* Anpassen an die Höhe des Menüs */
        }
        
        /* iPad-spezifische Anpassungen (10.2 Zoll und 13 Zoll) */
        @media only screen and (min-device-width: 768px) and (max-device-width: 1366px) and (-webkit-min-device-pixel-ratio: 2) {
            /* Kompakteres Menü für iPads */
            .nav-wrapper {
                padding: 0 8px; /* Noch stärker reduzierter Rand links und rechts */
                max-width: 100%; /* Volle Breite nutzen */
            }
            
            .logo {
                font-size: 1.1rem;
                padding: 12px 0;
            }
            
            .logo img {
                height: 28px;
                margin-right: 4px;
            }
            
            .main-menu > li > a,
            .main-menu > li > .menu-item {
                padding: 20px 6px; /* Sehr kompakte Abstände */
                font-size: 0.9rem;
            }
            
            .menu-icon {
                font-size: 0.9em;
                margin-right: 2px;
            }
            
            /* Speziell für das letzte Menüelement (Impressum) */
            .main-menu > li:last-child > a {
                padding-right: 4px; /* Besonders geringer Abstand rechts */
            }
            
            /* Anpassungen für iPad 10.2 im Hochformat */
            @media only screen and (max-device-width: 820px) and (orientation: portrait) {
                .logo {
                    font-size: 1rem;
                }
                
                .main-menu > li > a,
                .main-menu > li > .menu-item {
                    padding: 20px 5px;
                    font-size: 0.85rem;
                }
                
                .menu-icon {
                    font-size: 0.85em;
                    margin-right: 2px;
                }
            }
            
            /* Größere iPads (13 Zoll) - feiner abgestufte Anpassungen */
            @media only screen and (min-device-width: 1024px) {
                .main-menu > li > a,
                .main-menu > li > .menu-item {
                    padding: 20px 10px;
                    font-size: 1rem;
                }
            }
        }
        
        /* Mittlere Bildschirmgrößen - kompakteres Menü */
        @media screen and (max-width: 1100px) and (min-width: 769px) {
            .main-menu > li > a,
            .main-menu > li > .menu-item {
                padding: 20px 8px;
                font-size: 0.95rem;
            }
            
            .menu-icon {
                font-size: 0.9em;
                margin-right: 3px;
            }
        }
        
        /* Responsive Design für mobile Geräte */
        @media screen and (max-width: 768px) {
            .nav-wrapper {
                flex-direction: column;
                align-items: flex-start;
                position: relative; /* Wichtig für die Positionierung */
                min-height: 60px; /* Minimale Höhe für die Navigation */
            }
            
            .main-menu {
                display: none;
                flex-direction: column;
                width: 100%;
                background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
                padding-bottom: 10px;
                max-height: 80vh;
                overflow-y: auto;
                position: absolute; /* Absolute Positionierung */
                top: 100%; /* Direkt unter der Navigationsleiste */
                left: 0;
                z-index: 1000; /* Hoher z-index */
                box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Schatten hinzufügen */
            }
            
            .main-menu.show {
                display: flex;
                animation: slideDown 0.5s ease forwards;
            }
            
            .main-menu li {
                width: 100%;
            }
            
            /* Kleinere Schrift und Abstand für mobile Ansicht */
            .main-menu li a,
            .main-menu li .menu-item {
                padding: 12px 15px;
                width: 100%;
                text-align: left;
                font-size: 0.95rem;
            }
            
            /* Auch die Hauptmenüpunkte kompakter machen */
            .main-menu > li > a,
            .main-menu > li > .menu-item {
                font-size: 1.05rem;
            }
            
            .main-menu li a::after,
            .dropdown > .menu-item > .underline {
                bottom: 5px;
            }
            
            /* Mobile Dropdown */
            .dropdown-content,
            .nested-dropdown-content {
                position: static;
                display: none;
                opacity: 1;
                transform: scaleY(1);
                box-shadow: none;
                background: rgba(0, 0, 0, 0.1);
                padding-left: 10px;
            }
            
            .dropdown-content.show,
            .nested-dropdown-content.show {
                display: block;
            }
            
            .dropdown-content a,
            .nested-dropdown-content a {
                padding: 10px 15px;
                font-size: 0.9rem;
            }
            
            /* Dropdown-Pfeil für Mobile */
            .dropdown-arrow {
                position: absolute;
                right: 15px;
                top: 12px;
            }
            
            .nested-dropdown-arrow {
                content: '▼';
                right: 15px;
            }
            
            .nested-dropdown-content {
                left: 0;
            }
            
            /* Kleinere Icons in mobiler Ansicht */
            .menu-icon {
                font-size: 1em;
                margin-right: 5px;
            }
            
            /* Platzhalter für den Hauptinhalt bei mobiler Ansicht */
            .menu-spacer {
                height: 60px; /* Anpassen an die Höhe des mobilen Menüs */
            }
        }
        
        /* Animation für Mobile-Menü */
        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        /* Animation für Desktop-Menü */
        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        /* Jedes Menüelement mit Verzögerung animieren */
        .main-menu li {
            opacity: 0;
            animation: fadeIn 0.5s ease forwards;
        }
        
        .main-menu li:nth-child(1) { animation-delay: 0.1s; }
        .main-menu li:nth-child(2) { animation-delay: 0.2s; }
        .main-menu li:nth-child(3) { animation-delay: 0.3s; }
        .main-menu li:nth-child(4) { animation-delay: 0.4s; }
        .main-menu li:nth-child(5) { animation-delay: 0.5s; }
        .main-menu li:nth-child(6) { animation-delay: 0.6s; }
        
/* iPad-spezifische Anpassungen für Querformat */
@media only screen 
  and (min-device-width: 768px) 
  and (max-device-width: 1366px) 
  and (orientation: landscape) 
  and (-webkit-min-device-pixel-ratio: 2) {
    
    /* Grundlegendes Container-Styling für mehr Platz */
    .nav-wrapper {
        padding: 0 15px; /* Mehr Platz an den Seiten */
        max-width: 100%; /* Volle Breite nutzen */
    }
    
    /* Logo optimieren für mehr Platz */
    .logo {
        font-size: 1.4rem; /* Größere Schrift im Querformat */
        padding: 12px 0;
    }
    
    .logo img {
        height: 35px; /* Größeres Logo im Querformat */
        margin-right: 8px;
    }
    
    /* Hauptmenü-Elemente größer machen */
    .main-menu > li > a,
    .main-menu > li > .menu-item {
        padding: 20px 12px; /* Mehr horizontaler Abstand */
        font-size: 1.1rem; /* Größere Schrift */
    }
    
    .menu-icon {
        font-size: 1.1em;
        margin-right: 6px;
    }
    
    /* Dropdown-Inhalte anpassen */
    .dropdown-content {
        min-width: 220px; /* Breiteres Dropdown im Querformat */
    }
    
    .nested-dropdown-content {
        min-width: 230px; /* Breiteres verschachteltes Dropdown */
    }
    
    /* Spezifische Anpassungen für iPad 13 Zoll */
    @media only screen and (min-device-width: 1024px) {
        .main-menu > li > a,
        .main-menu > li > .menu-item {
            padding: 20px 15px; /* Noch mehr Abstand */
            font-size: 1.2rem; /* Noch größere Schrift */
        }
        
        .logo {
            font-size: 1.5rem; /* Größeres Logo */
        }
        
        .logo img {
            height: 38px; /* Größeres Logo-Bild */
        }
        
        .dropdown-content,
        .nested-dropdown-content {
            min-width: 240px; /* Noch breitere Dropdowns */
        }
    }
}

/* Spezifische Anpassung für iPad 10.2 im Querformat */
@media only screen 
  and (min-device-width: 768px) 
  and (max-device-width: 1024px) 
  and (orientation: landscape) 
  and (-webkit-min-device-pixel-ratio: 2) {
    
    .main-menu > li > a,
    .main-menu > li > .menu-item {
        padding: 20px 10px; /* Etwas weniger Abstand als beim 13 Zoll */
        font-size: 1.05rem; /* Etwas kleinere Schrift */
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    /* Sicherstellen, dass alle Menüpunkte gut lesbar sind */
    .dropdown-content a,
    .nested-dropdown-content a {
        padding: 12px;
        font-size: 1rem;
    }
}

/* Fix für Touch-Geräte, um Hover-Effekte besser zu unterstützen */
@media (hover: none) {
    .main-menu li a:hover::after,
    .dropdown:hover > .menu-item > .underline {
        width: 70%; /* Unterstreichung sofort anzeigen */
    }
    
    .main-menu li a:active,
    .main-menu li .menu-item:active {
        background-color: rgba(255, 255, 255, 0.2); /* Stärkerer aktiver Zustand */
    }
    
    /* Verbesserte Touch-Bereiche */
    .main-menu li a,
    .main-menu li .menu-item {
        padding-top: 22px;
        padding-bottom: 22px;
    }
}

/* Stile für Nested-Dropdown-Menüs, die nach links geöffnet werden */
.nested-dropdown-content.open-left {
    left: auto;
    right: 100%;
    transform-origin: right center;
}

/* Stile für die Transform-Animation bei links geöffneten Menüs */
.nested-dropdown:hover .nested-dropdown-content.open-left {
    transform: scaleX(1);
    opacity: 1;
}

/* Verbesserte Positionierung für Nested-Dropdowns auf dem iPad */
@media only screen 
  and (min-device-width: 768px) 
  and (max-device-width: 1366px) 
  and (-webkit-min-device-pixel-ratio: 2) {
    
    /* Zusätzliche Spezifität für iPads, um sicherzustellen, dass die 
       Links-Richtung korrekt funktioniert */
    .nested-dropdown-content.open-left {
        left: auto !important;
        right: 100% !important;
    }
    
    /* Leicht verbreiterte Dropdowns für iPad-Nutzung */
    .nested-dropdown-content {
        min-width: 230px;
    }
}

/* Sinus-Funktions-Seite Styling */
.geogebra-container {
    width: 100%;
    height: 600px; /* Exakt gleiche Höhe wie im GeoGebra-Parameters */
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.geogebra-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block; /* Verhindert zusätzlichen Platz unter dem iframe */
}

.parameter-box {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 5px;
  margin: 20px 0;
  border-left: 4px solid #3498db;
}

.formula {
  background-color: #f0f8ff;
  padding: 15px;
  border-radius: 5px;
  margin: 15px 0;
  text-align: center;
  font-size: 1.2em;
  overflow-x: auto;
}

.parameter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.parameter-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
  transition: transform 0.2s;
}

.parameter-card:hover {
  transform: translateY(-5px);
}

.parameter-card h3 {
  color: #2980b9;
  margin-top: 0;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.example-section {
  margin: 40px 0;
}

.example-box {
  background-color: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin: 15px 0;
}

.example-title {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 10px;
  color: #333;
}

.bg-element {
  position: absolute;
  opacity: 0.05;
  font-size: 4rem;
  z-index: 0;
}

.sinus-element-1 {
  top: 10%;
  left: 5%;
  transform: rotate(-10deg);
}

.sinus-element-2 {
  top: 30%;
  right: 8%;
  transform: rotate(15deg);
}

.sinus-element-3 {
  bottom: 15%;
  left: 10%;
  transform: rotate(5deg);
}

.exercise-box {
  background-color: #e8f4f8;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.solution-btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.2s;
}

.solution-btn:hover {
  background-color: #2980b9;
}

.solution-content {
  display: none;
  background-color: #f0f0f0;
  padding: 15px;
  border-radius: 5px;
  margin-top: 15px;
}

.note-box {
  background-color: #fffacd;
  border-left: 4px solid #ffd700;
  padding: 15px;
  margin: 15px 0;
  border-radius: 5px;
}

/* Responsive Anpassungen */
@media (max-width: 992px) {
  .parameter-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
  
  .formula {
    font-size: 1.1em;
  }
}

@media (max-width: 768px) {
  .geogebra-container {
    padding-bottom: 75%; /* Höheres Verhältnis für mobile Geräte */
  }
  
  .parameter-grid {
    grid-template-columns: 1fr;
  }
  
  .parameter-card {
    padding: 15px;
  }
  
  .formula {
    font-size: 1em;
    padding: 10px;
  }
  
  .example-box, .exercise-box {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .geogebra-container {
    padding-bottom: 100%; /* Quadratisches Verhältnis für sehr kleine Bildschirme */
  }
  
  .bg-element {
    font-size: 3rem;
  }
  
  .parameter-box, .note-box {
    padding: 12px;
  }
}

/* Diese CSS-Regeln können Sie am Ende Ihrer style.css hinzufügen */

/* Mobile Menü: Sicherstellen, dass es beim Umschalten korrekt angezeigt wird */
@media (max-width: 768px) {
    .main-menu {
        display: none; /* Standardmäßig versteckt auf mobilen Geräten */
    }
    
    .main-menu.show {
        display: block !important; /* Explizites Styling für iOS */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 999;
        background: white; /* Oder Ihre Menü-Hintergrundfarbe */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    /* Verbesserte Touch-Bereiche für mobile Geräte */
    .menu-toggle,
    .dropdown .menu-item,
    .nested-dropdown .menu-item {
        padding: 12px !important;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0,0,0,0); /* Entfernt das Highlight beim Tippen auf iOS */
    }
    
    /* Größerer klickbarer Bereich für Dropdown-Pfeile */
    .dropdown-arrow, 
    .nested-dropdown-arrow {
        padding: 10px;
    }
}

/* Styling für den Menü-Container im ausgeblendeten Zustand */
.menu-container.menu-hidden {
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
}

.menu-container {
    transform: translateY(0);
    transition: transform 0.3s ease-in-out;
}

/* Fix für iOS-Safari-spezifische Probleme */
@supports (-webkit-touch-callout: none) {
    /* CSS-Regeln speziell für iOS-Geräte */
    .menu-toggle {
        -webkit-appearance: none; /* Entfernt das Standard-Aussehen auf iOS */
    }
    
    /* Verbessertes Dropdown-Verhalten für iOS */
    .dropdown-content,
    .nested-dropdown-content {
        -webkit-transform: translateZ(0); /* Aktiviert die GPU-Beschleunigung auf iOS */
    }
}

/* Verbesserte Sichtbarkeit des Hamburger-Icons */
.menu-toggle {
    font-size: 30px; /* Größeres Icon */
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    color: #fff; /* Weiße Farbe für das Icon */
    background-color: transparent; /* Transparenter Hintergrund */
    text-shadow: 0 0 2px #000; /* Textschatten für bessere Lesbarkeit */
}

/* Kontrastfarben für das mobile Menü */
@media (max-width: 768px) {
    .main-menu,
    .main-menu.show {
        background-color: #2a4680; /* Dunkelblauer Hintergrund, passend zum Header */
    }
    
    /* Alle Menü-Texte im mobilen Modus immer weiß */
    .main-menu li a,
    .main-menu .menu-item,
    .main-menu .dropdown .menu-item span,
    .main-menu .dropdown a,
    .main-menu .dropdown-content a,
    .main-menu .nested-dropdown a,
    .main-menu .nested-dropdown-content a {
        color: #fff !important; /* Weiße Schrift für besseren Kontrast */
    }
    
    /* Dropdown-Icons immer weiß */
    .main-menu .dropdown-arrow,
    .main-menu .nested-dropdown-arrow {
        color: #fff !important;
    }
    
    /* Untermenü-Hintergründe */
    .main-menu .dropdown-content,
    .main-menu .nested-dropdown-content {
        background-color: #3a5795 !important; /* Etwas helleres Blau für Untermenüs */
    }
    
    /* Aktive/Hover-Zustände mit gutem Kontrast */
    .main-menu li a:hover,
    .main-menu li a:active,
    .main-menu li a:focus,
    .main-menu .menu-item:hover,
    .main-menu .dropdown-content a:hover,
    .main-menu .nested-dropdown-content a:hover {
        background-color: #4a67a5 !important; /* Helleres Blau beim Hover */
        color: #fff !important;
    }
    
    /* Aktive Menüpunkte hervorheben */
    .main-menu li a.active,
    .main-menu .dropdown-content a.active,
    .main-menu .nested-dropdown-content a.active {
        background-color: #4a67a5 !important;
        color: #fff !important;
        font-weight: bold;
    }
}

/* Verbesserte Responsive Styles für mobile Geräte, insbesondere iPhone im Hochformat */
@media screen and (max-width: 480px) {
  /* Anpassung der h1-Größe für mobile Geräte */
  h1, .hero h1, .content-wrapper h1 {
    font-size: 2rem !important; /* Kleinere Schriftgröße für alle h1 */
    word-wrap: break-word; /* Erlaube Wortumbrüche für sehr lange Wörter */
    overflow-wrap: break-word; /* Alternative Eigenschaft für Wortumbrüche */
    hyphens: auto; /* Automatische Silbentrennung aktivieren */
    line-height: 1.3; /* Zeilenhöhe reduzieren */
    margin-left: 10px; /* Seitenränder hinzufügen */
    margin-right: 10px;
  }
  
  /* Anpassung des Hero-Bereichs für mobile Geräte */
  .hero {
    padding: 30px 15px; /* Reduzierter Innenabstand */
    margin-bottom: 20px;
  }
  
  /* Auch für anderen Content-Überschriften kleiner machen */
  .content-section h2, 
  .interactive-section h2 {
    font-size: 1.4rem !important;
    line-height: 1.3;
    word-wrap: break-word;
  }
  
  /* Abstände in Content-Bereichen reduzieren */
  .content-section,
  .interactive-section {
    padding: 20px;
  }
  
  /* Hintergrund-Elemente auf mobilen Geräten verkleinern oder verstecken */
  .bg-element {
    font-size: 2.5rem !important; /* Kleinere Hintergrund-Elemente */
    opacity: 0.07 !important; /* Noch transparenter */
  }
}

/* Spezifische Anpassungen für sehr kleine Bildschirme (iPhone SE / kleine iPhones) */
@media screen and (max-width: 375px) {
  h1, .hero h1, .content-wrapper h1 {
    font-size: 1.8rem !important; /* Noch kleinere Schriftgröße */
  }
  
  .content-section h2, 
  .interactive-section h2 {
    font-size: 1.3rem !important;
  }
  
  /* Container-Abstände reduzieren */
  .main-content {
    padding: 20px 10px;
  }
  
  /* Nur die wichtigsten Hintergrund-Elemente behalten */
  .bg-element:not(.math-element-1):not(.chem-element-1):not(.lotto-element-1) {
    display: none;
  }
}

/* Zusätzliche Anpassungen für die Lesbarkeit auf mobilen Geräten */
@media screen and (max-width: 480px) {
  p, .content-section p {
    font-size: 1rem !important; /* Bessere Lesbarkeit für Fließtext */
    line-height: 1.5;
  }
  
  /* Abstand zwischen Textelementen verringern */
  .content-section p {
    margin-bottom: 15px;
  }
  
  /* Menü-Anpassungen für bessere mobile Nutzung */
  .main-menu li a, 
  .main-menu li .menu-item {
    padding: 10px 15px;
  }
}

/* Fix für unerwünschte Unterstreichungen in Dropdown-Menüs */
.dropdown-content a,
.nested-dropdown-content a {
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

/* Nur aktive Links in Dropdown-Menüs hervorheben */
.dropdown-content a.active,
.nested-dropdown-content a.active {
    background-color: #4a67a5 !important;
    font-weight: bold !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

/* Beseitigung aller weiteren Unterstreichungen/dekorativen Elemente */
.dropdown-content a::after,
.nested-dropdown-content a::after,
.dropdown-content a::before,
.nested-dropdown-content a::before,
.dropdown-content a .underline,
.nested-dropdown-content a .underline {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Explizite Override für Mathematik und Recht Dropdown-Elemente */
.dropdown:nth-child(1) .dropdown-content a,
.dropdown:nth-child(4) .dropdown-content a {
    text-decoration: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

/* Hover-Effekt für Dropdown-Menüpunkte (Unterstreichung beim Überfahren) */
.dropdown-content a:hover,
.nested-dropdown-content a:hover {
    position: relative;
}

.dropdown-content a:hover::after,
.nested-dropdown-content a:hover::after {
    content: '';
    display: block !important;
    position: absolute;
    width: 70% !important;
    height: 2px !important;
    background-color: #6a92e4;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
    animation: fadeIn 0.2s ease-in-out;
}

/* Animation für den Unterstrich */
@keyframes fadeIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 70%;
        opacity: 1;
    }
}