/* Responsive Styles für Morse-Code Trainer */

/* Basis-Styles für alle Geräte */
body {
  overflow-x: hidden; /* Horizontales Scrollen verhindern */
}

/* Touch-spezifische Anpassungen */
.touch-device button,
.touch-device .submit-btn,
.touch-device .control-btn,
.touch-device .mode-btn,
.touch-device .char-btn {
  padding: 12px 15px; /* Größere Touch-Targets */
  min-height: 48px;
  min-width: 48px;
}

/* Aktive Zustände für Touch-Geräte */
.touch-active {
  transform: scale(0.95);
  opacity: 0.8;
  transition: all 0.1s ease;
}

/* Morse-Tastatur für mobile Geräte */
.morse-keyboard {
  display: none; /* Standardmäßig ausgeblendet */
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-secondary);
  border-top: 2px solid var(--border-color);
  padding: 10px;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  user-select: none;
}

.morse-keyboard-row {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.morse-key {
  background-color: var(--bg-element);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 15px 20px;
  margin: 0 5px;
  font-size: 18px;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.morse-key:active,
.morse-key.touch-active {
  background-color: var(--bg-selected);
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.morse-key-dot {
  min-width: 80px;
}

.morse-key-dash {
  min-width: 80px;
}

.morse-key-space {
  min-width: 120px;
}

.morse-key-backspace {
  min-width: 80px;
}

.morse-touch-pad {
  display: flex;
  width: 100%;
  margin: 10px 0;
}

.morse-pad-key {
  flex: 1;
  padding: 20px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 8px;
  margin: 0 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.morse-pad-dot {
  background-color: var(--accent-color);
  color: white;
}

.morse-pad-dash {
  background-color: var(--second-accent-color, #2980b9);
  color: white;
}

/* Menu für kleine Bildschirme */
.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 24px;
  position: absolute;
  right: 20px;
  top: 20px;
  z-index: 100;
  color: var(--text-primary);
  background: none;
  border: none;
  padding: 5px;
}

/* Media Queries für verschiedene Bildschirmgrößen */

/* Kleine Tablets und große Smartphones (im Querformat) */
@media screen and (max-width: 900px) {
  .container {
    width: 90%;
    padding: 10px;
  }
  
  h1 {
    font-size: 24px;
    margin-top: 10px;
  }
  
  .main-nav ul {
    flex-wrap: wrap;
  }
  
  .main-nav li {
    margin-bottom: 5px;
  }
}

/* Smartphones (im Hochformat) */
@media screen and (max-width: 600px) {
  .container {
    width: 95%;
    padding: 5px;
  }
  
  h1 {
    font-size: 20px;
    margin: 10px 0;
  }
  
  .main-nav ul {
    flex-direction: row;
    justify-content: center;
    padding: 0;
  }
  
  .main-nav li {
    margin: 3px;
  }
  
  .main-nav a {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .content-section,
  .training-area,
  .challenge-area {
    padding: 10px;
  }
  
  .checkbox-group,
  .radio-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .checkbox-label,
  .radio-label {
    margin-bottom: 8px;
    width: 100%;
  }
  
  /* Anpassen der Referenztabelle für mobile Ansicht */
  .reference-section {
    grid-template-columns: repeat(3, 1fr);
  }
  
  /* Buttons in der Trainingsumgebung */
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .controls button {
    margin: 5px 0;
    width: 100%;
  }
  
  /* Anpassen der Challenge-UI */
  .challenge-info {
    flex-direction: column;
    text-align: center;
  }
  
  .challenge-timer, 
  .challenge-score {
    margin: 5px 0;
    width: 100%;
  }
  
  /* Für kleinere Elemente in Lernmodulen */
  .element-card,
  .method-card,
  .char-card {
    min-width: 90%;
  }
  
  /* Anpassen der Eingabefelder */
  .input-area {
    flex-direction: column;
  }
  
  .input-area input {
    margin-bottom: 10px;
    width: 100%;
  }
  
  .input-area button {
    width: 100%;
  }
  
  /* Verbesserungen für den Guide */
  .mode-options {
    flex-direction: column;
  }
  
  .mode-option {
    width: 100%;
    margin: 5px 0;
  }
  
  /* Anpassen der interaktiven Elemente */
  .learned-chars-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  #interactive-chars {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  
  .char-btn {
    padding: 8px 0;
    margin: 2px;
    min-width: 30px;
  }
}

/* Sehr kleine Geräte */
@media screen and (max-width: 320px) {
  .reference-section {
    grid-template-columns: repeat(2, 1fr);
  }
  
  #interactive-chars {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .learned-chars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Anpassungen für die Höhe (besonders für Mobilgeräte im Querformat) */
@media screen and (max-height: 500px) {
  .container {
    margin-top: 5px;
  }
  
  h1, h2, h3 {
    margin: 5px 0;
  }
  
  .content-section {
    margin-bottom: 10px;
  }
  
  /* Morse-Tastatur für Landscape-Modus anpassen */
  .morse-keyboard {
    padding: 5px;
  }
  
  .morse-keyboard-row {
    margin-bottom: 4px;
  }
  
  .morse-key {
    padding: 10px;
    min-height: 40px;
  }
}
