/* Import Inter font to match Match Planner */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1e293b;
  margin: 0;
  padding: 0;
  background-color: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  background: url("../Images/fussballfeld%20schwarz%20neu%20neu.png") center/cover no-repeat;
  background-color: #0f172a;
  color: white;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 120px;
  margin-bottom: 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Logo und Titel nebeneinander */
.header-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  height: 80px;
  width: auto;
  display: block;
}

/* Header-Buttons nach rechts */
.header-buttons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.header-buttons button {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-size: 14px;
  font-weight: 500;
}

.header-buttons button:hover {
  background-color: white;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.icon-button {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: white;
}

.icon-button:hover {
  color: red;
}

h1 {
  margin: 0;
  font-size: 24px;
}

.container {
  padding: 20px;
  margin-top: 0;
}

.category {
  margin-bottom: 20px;
}

.category h3 {
  cursor: pointer;
  background-color: #0f172a;
  /* Match Planner slate-900 */
  color: #f8fafc;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  position: -webkit-sticky;
  position: sticky;
  top: 10px;
  z-index: 100;
  margin-top: 0;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category h3::after {
  content: "▼";
  font-size: 12px;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.category h3:hover {
  background-color: #1e293b;
  transform: translateY(-1px);
}

.videos {
  display: none;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
  padding: 20px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.video-item {
  width: calc(33.33% - 20px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

@media screen and (max-width: 768px) {
  .video-item {
    width: calc(50% - 10px);
  }
}

@media screen and (max-width: 480px) {
  .video-item {
    width: 100%;
  }
}

.video-item video {
  width: 200px;
  height: auto;
  margin-bottom: 5px;
}

.video-item span {
  cursor: pointer;
  color: #334155;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  margin-top: 8px;
  transition: color 0.2s ease;
}

.video-item span:hover {
  color: #059669;
  /* Emerald 600 */
}

.trainingsplan {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

.trainingsplan h2 {
  margin-top: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 25px;
}

/* Neuer gemeinsamer Kopfbereich */
#header-info {
  text-align: center;
  margin-bottom: 25px;
  color: #334155;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

#header-info input[type="date"],
#header-info input[type="time"] {
  width: auto;
  display: inline-block;
  padding: 8px 12px;
  margin: 0;
}

.section {
  margin-bottom: 20px;
}

.section h3 {
  margin-bottom: 15px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  color: #334155;
  font-weight: 600;
}

.section ul {
  list-style: none;
  padding: 0;
}

.section ul li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  min-height: 100px;
  padding: 15px;
  gap: 15px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
}

.section ul li img {
  flex-shrink: 0;
  margin-right: 10px;
  border-radius: 6px;
  object-fit: cover;
}

.section ul li textarea {
  flex: 1;
  margin-top: 5px;
}

textarea,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"] {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #1e293b;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

button {
  background-color: #0f172a;
  color: white;
  border: none;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

button:hover {
  background-color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Spezifischer Stil für den Button "Eigene Übung (Bild) hinzufügen" */
.custom-exercise-btn {
  background-color: #059669;
  /* Match Planner Emerald */
}

.custom-exercise-btn:hover {
  background-color: #047857;
}

/* Alle Modals - vereinfacht und eindeutig */
#videoModal,
#customExerciseModal,
.auth-modal,
.reg-modal,
.abo-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#videoModal {
  z-index: 9999;
}

#customExerciseModal {
  z-index: 10001;
}

/* liegt jetzt über dem Video-Modal */

/* Modal Content Styles */
#videoModal .modal-content {
  max-width: 80%;
  max-height: 80%;
  overflow-y: auto;
  box-sizing: border-box;
  background: white;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Schließen-Button */
#videoModal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  color: black;
}

#videoModal .close:hover {
  color: red;
}

/* Video */
#videoModal video {
  width: 100%;
  max-height: 60vh;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* Buttons im Modal */
#videoModal .add-buttons {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

/* Eigene Übung (Bild) Modal */
#customExerciseModal .modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  width: 380px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Schließen (X) */
#customExerciseModal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  color: black;
}

#customExerciseModal .close:hover {
  color: red;
}

/* Überschrift im Modal */
#customExerciseModal h2 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #0f172a;
  font-weight: 700;
}

/* Dropdown-Label besser sichtbar */
#customExerciseModal label {
  font-size: 16px;
  font-weight: bold;
  display: block;
  margin-bottom: 8px;
}

/* Dropdown-Design */
#customExerciseModal select {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* Stil für den Weiter-Button */
#customExerciseModal button {
  width: 100%;
  padding: 10px;
  background-color: #102057;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 10px;
}

#customExerciseModal button:hover {
  background-color: #0c1a45;
}

#customExerciseModal input[type="text"] {
  width: 100%;
  padding: 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 15px;
  box-sizing: border-box;
}

/* Auth Modal Styles */
.auth-modal .modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  width: 380px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  color: black;
}

.auth-modal .close:hover {
  color: red;
}

.auth-modal input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

.auth-modal button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  background-color: #102057;
  color: white;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.auth-modal button:hover {
  background-color: #0c1a45;
}

/* Register Modal Styles */
.reg-modal .modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  width: 380px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reg-modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  color: black;
}

.reg-modal .close:hover {
  color: red;
}

.reg-modal input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
  box-sizing: border-box;
}

.reg-modal button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  border: none;
  background-color: #102057;
  color: white;
  font-size: 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.reg-modal button:hover {
  background-color: #0c1a45;
}

/* Abo Modal Styles */
.abo-modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  width: 380px;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.abo-modal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 22px;
  cursor: pointer;
  color: black;
}

.abo-modal .close:hover {
  color: red;
}

.abo-modal .abo-choice {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px 16px;
  font-size: 16px;
  background-color: #0f172a;
  color: white;
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.abo-modal .abo-choice:hover {
  background-color: #1e293b;
}

/* 📌 Druck-Optimierung */
@media print {
  body * {
    visibility: hidden;
  }

  .trainingsplan,
  .trainingsplan * {
    visibility: visible;
  }

  .trainingsplan {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    background-color: white;
    color: black;
    box-sizing: border-box;
    margin: 0 auto;
  }

  .trainingsplan h2 {
    font-size: 20px;
    margin-bottom: 10px;
    text-align: center;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
  }

  .trainingsplan h3 {
    font-size: 16px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
  }

  .section ul li {
    page-break-inside: avoid;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
  }

  input[type="number"] {
    margin-left: auto;
    width: 50px;
    flex-shrink: 0;
    font-size: 14px;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 3px;
    text-align: right;
  }

  textarea {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #333;
    line-height: 1.4;
    width: 100%;
    min-height: 50px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: transparent;
    resize: vertical;
    height: auto !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
  }

  div[contenteditable] {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    height: auto !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
  }

  textarea:placeholder-shown {
    display: none;
  }

  #header-info {
    display: block;
    text-align: center;
    margin-bottom: 10px;
  }

  #header-info input,
  #header-info span,
  #header-info label {
    display: inline;
    margin-right: 10px;
  }

  button,
  .move-dropdown {
    display: none !important;
  }

  label[for="current-date"],
  label[for="startTime"],
  input[type="date"],
  input[type="time"] {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: normal;
    color: #333;
    vertical-align: middle;
    line-height: 1.4;
  }

  input[type="date"],
  input[type="time"] {
    border: none;
    background: transparent;
    text-align: left;
    width: auto;
    padding: 0;
    height: 24px;
    display: inline-block;
    margin-top: -2px;
    font-size: 16px;
    font-weight: normal;
  }

  .custom-exercise-btn {
    display: none !important;
  }
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    min-height: auto;
    margin-bottom: 0;
  }

  .header-container {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .logo {
    height: 60px;
  }

  h1 {
    font-size: 20px;
    text-align: center;
  }

  .header-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
    margin-top: 15px;
  }

  .header-buttons button {
    font-size: 16px;
    padding: 10px;
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
  }

  .container {
    padding: 14px;
    margin-top: 0;
  }

  .category {
    margin-bottom: 16px;
  }

  .category h3 {
    border-radius: 10px;
    padding: 14px 12px;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    position: -webkit-sticky;
    position: sticky;
    top: 10px;
    z-index: 100;
    margin-top: 0;
  }

  .videos {
    padding: 12px;
    border-radius: 10px;
  }

  .video-item {
    width: 100% !important;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }

  .video-item img,
  .video-item video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
  }

  .video-item span {
    font-size: 15px;
    text-align: left;
    width: 100%;
  }

  .trainingsplan {
    margin: 12px;
    padding: 16px;
    border-radius: 12px;
    overflow: hidden;
  }

  #header-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 15px;
    text-align: left;
  }

  #header-info input {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    border-radius: 8px;
    padding: 8px 10px;
    border: 1px solid #cfd6e4;
  }

  .trainingsplan h2 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .section ul li {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #eee;
    background: #fff;
  }

  .section ul li img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-right: 0;
  }

  .section ul li [contenteditable="true"],
  .section ul li textarea {
    min-height: 60px;
    border-radius: 8px !important;
    padding: 8px !important;
  }

  .section ul li input[type="number"],
  .section ul li .move-dropdown,
  .section ul li button {
    height: 44px !important;
    min-height: 44px;
    border-radius: 10px !important;
    font-size: 15px;
  }

  .section ul li input[type="number"] {
    width: 100px !important;
    margin-left: 0 !important;
  }

  .section ul li button {
    width: 100%;
  }

  .section h3 {
    font-size: 17px;
    border-color: #e6e6e6;
  }

  .trainingsplan>div[style*="text-align: center"] button {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    margin: 6px 0 !important;
    font-size: 16px;
  }

  /* 🔹 VIDEO-MODAL (MOBILE): exakt mittig + etwas breiter */
  /* NEU: Modal standardmäßig versteckt lassen (wird per JS auf "flex" gesetzt) */
  #videoModal {
    position: fixed;
    inset: 0;
    display: none;
    /* <— ohne !important */
    padding: 12px;
  }

  #videoModal .modal-content {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;

    width: min(720px, 96vw) !important;
    max-width: none !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 12px !important;
    border-radius: 16px;
    align-items: stretch;
  }

  #videoModal video {
    width: 100% !important;
    max-height: 60vh;
    border-radius: 8px;
  }

  #videoModal .add-buttons {
    width: 100%;
    gap: 8px;
  }

  #videoModal .add-buttons button,
  #videoModal .modal-content button {
    width: 100% !important;
    display: block !important;
    min-height: 44px;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .auth-modal .modal-content,
  .reg-modal .modal-content,
  .abo-modal .abo-modal-content {
    width: min(92vw, 420px) !important;
    border-radius: 12px;
    padding: 18px !important;
  }

  .auth-modal input,
  .reg-modal input {
    min-height: 44px;
    border-radius: 10px;
  }

  .auth-modal button,
  .reg-modal button,
  .abo-modal .abo-choice {
    min-height: 46px;
    border-radius: 12px;
    font-size: 16px;
  }

  button {
    border-radius: 10px;
  }

  * {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.08);
  }
}

@media screen and (max-width: 600px) {
  .trainingsplan button {
    margin-bottom: 10px;
  }
}

/* Mini-Fix für sehr kleine Geräte */
@media (max-width: 380px) {
  .header-buttons button {
    font-size: 14px;
    padding: 9px 12px;
  }

  h1 {
    font-size: 20px;
  }
}

/* Desktop Video-Modal korrekt zentrieren */
@media (min-width: 769px) {
  #videoModal {
    align-items: center;
    justify-content: center;
    padding: 12px;
  }

  #videoModal .modal-content {
    width: min(720px, 92vw);
    margin: 0 auto;
  }
}

@media screen and (max-width: 768px) {
  .header-buttons button.lang-switch {
    order: -1;
    /* nach oben schieben */
    align-self: center;
    /* mittig ausrichten */
    width: auto !important;
    /* nicht so breit wie andere Buttons */
    min-height: 34px !important;
    /* etwas kleiner */
    padding: 6px 14px !important;
    /* kompakter */
    font-size: 14px !important;
    /* kleinere Schrift */
    border-radius: 9999px !important;
    /* pillenförmig */
    margin-bottom: 8px;
  }
}