/*
 * Style‑Sheet für die Übefortschritt‑Webapp
 *
 * Hier werden einige Anpassungen vorgenommen, um die Anwendung ansprechender
 * und vor allem auf mobilen Geräten besser bedienbar zu gestalten. Die
 * meisten Layout‑Eigenschaften übernimmt Bootstrap, trotzdem können
 * individuelle Farben und Abstände hier definiert werden.
 */

/*
 * Basisdesign ohne externe Bibliotheken wie Bootstrap. Wir definieren
 * eigene Container‑, Formular‑ und Tabellenstile, damit die Seite
 * responsive und ansprechend wirkt – auch ohne Internetverbindung.
 */

body {
  margin: 0;
  /* leichtes Grau für den Hintergrund, inspiriert vom Corporate‑Design */
  background-color: #f4f5f7;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: #333;
}

h1,
h2,
h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #222;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Navigationsleiste */
nav.navbar {
  background-color: #2c3e50;
  border-bottom: 1px solid #e0e0e0;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Auf sehr schmalen Bildschirmen (z. B. Smartphones) Navigation untereinander stapeln */
@media (max-width: 576px) {
  nav.navbar {
    flex-direction: column;
    align-items: flex-start;
  }
  #userNav {
    margin-top: 0.5rem;
  }
}

nav.navbar .navbar-brand {
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  color: #e67e22;
}

/*
 * Benutzerbereich in der Navigationsleiste
 *
 * Der Bereich rechts oben zeigt den aktuellen Benutzer samt Abmelde‑Button. Um die
 * Lesbarkeit zu verbessern, wird die Schriftfarbe auf Weiß gesetzt und der
 * Name fett hervorgehoben. Der Abmelde‑Button ist kontrastreich gestaltet.
 */
#userNav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
}

#loggedUser {
  /* Größere Schrift zur besseren Lesbarkeit des angemeldeten Benutzers */
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

/* Spezifische Farbdefinitionen für den Abmeldebutton */
#logoutBtn {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border: 1px solid #ffffff;
  border-radius: 4px;
  background-color: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

#logoutBtn:hover {
  background-color: #ffffff;
  color: #2c3e50;
}

/* Text in der Navigationsleiste standardmäßig weiß – wird im Nutzerbereich übernommen */
.navbar-text {
  color: #ffffff;
}

/* Containers */
.container {
  width: 92%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.py-4 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-lg-0 {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.d-grid {
  display: grid;
}

.gap-2 {
  gap: 0.5rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

/* Spalten des Grids */
.col-12,
.col-md-6,
.col-lg-6 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  box-sizing: border-box;
}

/* Spalte für drei gleich breite Felder (Tempo von/bis, Dauer) */
.col-md-4 {
  flex: 0 0 100%;
  max-width: 100%;
}
@media (min-width: 768px) {
  .col-md-4 {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
}

/* Vollbreitenspalte */
.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Responsive Grid: Auf kleineren Bildschirmen volle Breite, sonst halbe Breite */
@media (min-width: 768px) {
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (min-width: 992px) {
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Formularelemente */
label.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
}

input[type='text'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background-color: #fff;
}

textarea {
  resize: vertical;
}

button {
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
  border: none;
  padding: 0.55rem 1rem;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* Buttons Varianten */
.btn-primary {
  background-color: #e67e22; /* orange Hauptfarbe */
  color: #fff;
}

.btn-primary:hover {
  background-color: #d35400;
}

.btn-success {
  background-color: #27ae60;
  color: #fff;
}

.btn-success:hover {
  background-color: #1e8449;
}

.btn-secondary {
  background-color: #2c3e50; /* dunkles Blau für sekundäre Aktionen */
  color: #fff;
}

.btn-secondary:hover {
  background-color: #243b55;
}

.btn-outline-danger {
  background-color: transparent;
  border: 1px solid #c0392b;
  color: #c0392b;
}

.btn-outline-danger:hover {
  background-color: #c0392b;
  color: #fff;
}

.btn-danger {
  background-color: #c0392b;
  color: #fff;
  border: none;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
}

.btn-danger:hover {
  background-color: #a93226;
}

/* Tabelle */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

thead th {
  background-color: #f0f0f0;
  border-bottom: 2px solid #ddd;
  padding: 0.5rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:nth-child(even) {
  background-color: #fafafa;
}

tbody td {
  padding: 0.45rem;
  border-bottom: 1px solid #e5e5e5;
  vertical-align: top;
}

/* Responsive Tabelle auf kleinen Bildschirmen */
@media (max-width: 576px) {
  thead {
    display: none;
  }
  tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 0.5rem;
    background-color: #fff;
  }
  tbody td {
    display: flex;
    justify-content: space-between;
    border-bottom: none;
    padding: 0.25rem 0;
  }
  tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 1rem;
    color: #555;
  }
}

/* Wrapper für horizontales Scrollen bei großen Tabellen auf kleinen Bildschirmen */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

/* Kartenlayout für Panels */
.card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Utility classes */
.d-none {
  display: none !important;
}

.d-block {
  display: block;
}

/* Container für Aktionsbuttons (Export, Import, Löschen) */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
}

small.text-muted {
  color: #6c757d;
  font-size: 0.8rem;
}

/* Margin utilities */
.mt-3 {
  margin-top: 1rem;
}

/* kleinerer Abstand oben */
.mt-2 {
  margin-top: 0.5rem;
}

.my-4 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* horizontale Linie */
hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 1.5rem 0;
}

/* Import Button Styling */
#importLabel {
  display: inline-block;
  cursor: pointer;
  border: 1px solid #6c757d;
  border-radius: 4px;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #6c757d;
  background-color: transparent;
  margin-bottom: 0.5rem;
}

#importLabel:hover {
  background-color: #f1f3f5;
}

/* Hide native file input */
input[type='file'] {
  display: none;
}