/* Dieses Stylesheet sorgt für eine einheitliche und moderne Optik. */

/* === Grundlegendes Layout === */
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f8f9fa;
    color: #1A3761;
}

.main-header {
    background: #1A3761;
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(26,55,97,0.07);
}

.logo {
    height: 56px;
    margin-right: 18px;
    background: white;
    border-radius: 10px;
    padding: 4px;
}

.teamname {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.main-nav {
    display: flex;
    gap: 20px;
    background: #163058;
    padding: 10px 24px;
    align-items: center;
}
.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 5px;
    transition: background 0.2s;
}
.main-nav a:hover {
    background: #224481;
}

.main-nav .active {
    background: #dbeafe;     /* Helles Blau, fällt klar auf */
    color: #1A3761 !important;   /* Schrift wird dunkelblau */
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(26,55,97,0.10);
}

.user-info {
    margin-left: 32px;
    font-size: 0.95rem;
    color: #d9ecff;
}
.main-content {
    max-width: 900px;
    margin: 32px auto 24px auto;
    padding: 24px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(26,55,97,0.04);
    min-height: 350px;
}

.main-footer {
    text-align: center;
    color: #888;
    font-size: 0.96rem;
    padding: 18px 0 14px 0;
    background: #f1f3f8;
    border-top: 1px solid #d6dae3;
    margin-top: 60px;
}
.header-content {
    display: flex;
    align-items: center;
    padding: 10px 24px;
}

h1, h2, h3, h4 {
    text-align: center;
    font-family: Arial, sans-serif;
    color: #333;
    font-weight: bold;
    margin-bottom: 20px;
}

h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

nav a {
    margin-right: 15px;
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
}

/* === Tabellen === */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    border-bottom: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    font-size: 16px;
}

th {
    background-color: #007bff;
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    text-align: left;
}

td {
    font-size: 16px;
}

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

tr:hover {
    background-color: #f1f1f1;
}

/* === Buttons === */
button {
    padding: 8px 12px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

button.delete {
    background-color: #dc3545;
    color: #fff;
}

button.delete:hover {
    background-color: #c82333;
}
/* === Input-Felder === */
input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 95%;
    padding: 10px;
    margin-top: 8px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 16px;
}

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

/* === Nachrichten === */
.alert {
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

#successMessage {
    background-color: #28a745;
    color: white;
}

#errorMessage {
    background-color: #dc3545;
    color: white;
}

/* === Filter & Sortierung === */
#filterInput {
    padding: 8px;
    width: 50%;
    margin-top: 20px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

#resetButton {
    padding: 8px 12px;
    margin-left: 10px;
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
}

#resetButton:hover {
    background-color: #5a6268;
}

/* === Dropdown-Menü === */
.dropdown {
    display: inline-block;
    position: relative;
    margin-top: 20px;
}

.dropbtn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 1;
}

.dropdown-content a {
    color: black;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #ddd;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown:hover .dropbtn {
    background-color: #3e8e41;
}

/* === Tabs === */
.tab-container {
    margin-bottom: 20px;
}

.tablink {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    margin-right: 5px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
}

.tablink:hover {
    background-color: #45a049;
}

.tabcontent {
    display: none;
    margin-top: 20px;
}

/* === Fehlerseite === */
.error-container {
    text-align: center;
    margin-top: 100px;
}

.error-title {
    color: #dc3545;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
}

.error-message {
    font-size: 20px;
    color: #333;
    margin-bottom: 40px;
}

.error-button {
    background-color: #4CAF50;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.error-button:hover {
    background-color: #45a049;
}

/* === Pyramidendarstellung === */
.pyramide {
    text-align: center;
    margin-top: 40px;
}

.pyramide .ebene {
    margin: 20px 0;
}

.pyramide .spieler {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 8px;
    font-weight: bold;
    min-width: 0 0 5px rgba(0,0,0,0.2);
}

form {
    max-width: 600px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 8px;
    }
    .logo {
        height: 40px;
        margin-bottom: 4px;
        margin-right: 0;
    }
    .teamname {
        font-size: 1.1rem;
    }
    .main-nav {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 8px;
    }
    .main-content {
        padding: 12px 2vw;
        margin: 16px 0 12px 0;
        min-height: 250px;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* --- Buttons --- */
button, .btn, input[type="submit"], input[type="button"] {
    background: #1A3761;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(26,55,97,0.04);
}
button:hover, .btn:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background: #224481;
    box-shadow: 0 4px 18px rgba(26,55,97,0.10);
}

/* --- Formulare und Eingabefelder --- */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
    border: 1px solid #aab6c7;
    border-radius: 5px;
    padding: 8px 10px;
    font-size: 1rem;
    margin-bottom: 12px;
    width: 100%;
    max-width: 420px;
    background: #f6faff;
    transition: border 0.2s;
}
input:focus, select:focus, textarea:focus {
    border: 1.5px solid #1A3761;
    outline: none;
    background: #e7f0ff;
}
label {
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
    color: #1A3761;
    letter-spacing: 0.02em;
}
/* --- Überschriften und Fließtext --- */
h1, h2, h3 {
    color: #1A3761;
    font-weight: 700;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    letter-spacing: 0.01em;
}
h1 {
    font-size: 2.1rem;
}
h2 {
    font-size: 1.5rem;
}
h3 {
    font-size: 1.18rem;
}
p {
    margin-top: 0.5em;
    margin-bottom: 1em;
    color: #1A3761;
}

/* --- Tabellen --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(26,55,97,0.06);
}
th, td {
    padding: 10px 12px;
    border: 1px solid #e6eaf0;
    text-align: left;
}
th {
    background: #e8f0fc;
    font-weight: 700;
    color: #1A3761;
}
tr:nth-child(even) {
    background: #f6faff;
}
/* --- Erfolgsmeldungen / Fehlermeldungen --- */
.alert, .message, .info, .success, .error {
    display: block;
    padding: 12px 18px;
    margin-bottom: 18px;
    border-radius: 7px;
    font-size: 1.05rem;
    font-weight: 500;
}
.success, .alert-success {
    background: #e6ffed;
    color: #228c40;
    border: 1px solid #b9e9c9;
}
.error, .alert-error {
    background: #fff1f0;
    color: #d7263d;
    border: 1px solid #f7c6c6;
}
.info, .alert-info {
    background: #e8f0fc;
    color: #174986;
    border: 1px solid #b3c7e6;
}

.tab-container {
    margin-bottom: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

.tablink {
    background: #e8f0fc;
    color: #1A3761;
    border: 1.5px solid #1A3761;
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    padding: 11px 32px;
    font-size: 1.11rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.19s, color 0.19s, border 0.18s;
    box-shadow: 0 1px 8px rgba(26,55,97,0.03);
    position: relative;
    top: 4px;
    z-index: 2;
    outline: none;
}

.tablink:not(.active-tab):hover {
    background: #dbeafe;
    color: #1A3761;
    border-color: #224481;
}

.tablink.active-tab {
    background: #fff;
    color: #1A3761;
    border: 2.5px solid #1A3761;
    border-bottom: 3.5px solid #fff;
    z-index: 3;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(26,55,97,0.08);
}

.tabcontent {
    background: #fff;
    padding: 28px 16px 16px 16px;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 4px 22px rgba(26,55,97,0.06);
    border: 2px solid #1A3761;
    border-top: none;
    min-height: 120px;
    margin-bottom: 30px;
    z-index: 1;
}
.pyramide {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 50px;
}

.pyramide h2 {
    color: #1A3761;
    margin-bottom: 30px;
    font-size: 2rem;
    letter-spacing: 0.03em;
}

.pyramide .ebene {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 14px 0;
}

.pyramide .spieler {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(160deg, #e8f0fc 80%, #dbeafe 100%);
    color: #1A3761;
    padding: 18px 32px 13px 32px;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(26,55,97,0.09);
    font-size: 1.12rem;
    font-weight: 600;
    min-width: 60px;
    min-height: 30px;
    margin-bottom: 4px;
    border: 2.5px solid #1A3761;
    position: relative;
    transition: box-shadow 0.2s, transform 0.16s;
}

.pyramide .spieler:hover {
    box-shadow: 0 6px 24px rgba(26,55,97,0.20);
    background: #fff;
    transform: translateY(-4px) scale(1.045);
    border-color: #224481;
}

.pyramide .spieler span {
    font-size: 0.95rem;
    font-weight: 400;
    color: #224481;
    margin-top: 2px;
}

/* Responsive: Auch auf Handy als Pyramide sichtbar */
@media (max-width: 600px) {
    .pyramide .ebene {
        flex-wrap: nowrap;
		overflow-x: auto;
		justify-content: center; /* Oder center, wenn du mittig magst */
        gap: 10px;
		padding-bottom: 8px;
		scrollbar-width: thin; /* Für Firefox */
		-webkit-overflow-scrolling: touch; /* Für weiches Scrollen auf iOS */
    }
    .pyramide .spieler {
        padding: 10px 3vw;
        font-size: 0.97rem;
        min-width: 86px;
    }
}
.pyramide .ebene::-webkit-scrollbar {
    height: 7px;
}
.pyramide .ebene::-webkit-scrollbar-thumb {
    background: #dbeafe;
    border-radius: 8px;
}
.pyramide .ebene::-webkit-scrollbar-track {
    background: #e8f0fc;
    border-radius: 8px;
}
.flashes { list-style: none; padding: 0; }
.flashes li.success { color: #249924; font-weight: bold; }
.flashes li.danger  { color: #c00; font-weight: bold; }

.flashes {
  list-style: none;
  padding: 0;
  margin: 1em 0;
  max-width: 600px;
}
.flashes li.success {
  background: #e6f7e6;
  color: #249924;
  border: 1px solid #b6e4b6;
  padding: 0.5em;
  border-radius: 5px;
  margin-bottom: 5px;
  font-weight: bold;
}
.flashes li.danger {
  background: #fbeaea;
  color: #c00;
  border: 1px solid #f2bcbc;
  padding: 0.5em;
  border-radius: 5px;
  margin-bottom: 5px;
  font-weight: bold;
}
.flashes li.warning {
  background: #fffbe6;
  color: #946200;
  border: 1px solid #ffe58f;
  padding: 0.5em;
  border-radius: 5px;
  margin-bottom: 5px;
  font-weight: bold;
}
.flashes li.info {
  background: #e6f4fb;
  color: #177cb0;
  border: 1px solid #91d5ff;
  padding: 0.5em;
  border-radius: 5px;
  margin-bottom: 5px;
  font-weight: bold;
}
@media (max-width: 600px) {
  .tab-container {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .tablink {
    padding: 8px 14px;
    font-size: 0.99rem;
    min-width: 110px;
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .tablink.active-tab {
    border-width: 2px;
    font-size: 1.06rem;
  }
  /* Optionale Scrollbar-Optik (nur Chrome/iOS) */
  .tab-container::-webkit-scrollbar {
    height: 7px;
  }
  .tab-container::-webkit-scrollbar-thumb {
    background: #dbeafe;
    border-radius: 8px;
  }
  .tab-container::-webkit-scrollbar-track {
    background: #e8f0fc;
    border-radius: 8px;
  }
}
@media (max-width: 600px) {
  .tabcontent table,
  .main-content table {
    display: block;
    overflow-x: auto;
    width: 100%;
    font-size: 0.97rem;
    white-space: nowrap;
  }
  .tabcontent th, .tabcontent td {
    min-width: 90px;
  }
}
@media (max-width: 600px) {
  form, .tabcontent form {
    max-width: 98vw;
    min-width: unset;
    margin: 8px auto 12px auto;
    padding: 13px 4vw;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(26,55,97,0.07);
  }
  input, select, textarea {
    font-size: 1rem;
  }
}
@media (max-width: 600px) {
  .main-content {
    padding: 7vw 2vw 7vw 2vw;
  }
  h1, h2, h3, h4 {
    font-size: 1.1em;
  }
}
@media (max-width: 600px) {
  /* Ausnahme für die Rangliste: Tabelle soll immer randlos/klassisch aussehen */
  .main-content > table, body > table {
    display: table !important;
    overflow-x: unset !important;
    white-space: normal !important;
  }
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2.2rem;
  color: #fff !important;
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 1101;
  cursor: pointer;
}
.menu-toggle:focus, .menu-toggle:hover {
  background: #224481;
  color: #dbeafe;
  border-radius: 10px;
}

@media (max-width: 900px) {
  .menu-toggle {
    display: block;
  }
  .main-nav {
    position: fixed;
    top: 58px; /* Höhe Header */
    right: 0;
    background: #163058;
    flex-direction: column;
    align-items: flex-start;
    width: 230px;
    max-width: 85vw;
    padding: 16px 0 16px 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.17);
    border-radius: 0 0 12px 12px;
    transform: translateX(110%);
    transition: transform 0.23s cubic-bezier(0.44,1.15,0.56,1.02);
    z-index: 1100;
    min-height: 220px;
    display: flex;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
  }
  .main-nav.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
  }
  .main-header {
    position: relative;
    z-index: 1200;
  }
  .header-content {
    padding-right: 60px;
  }
  .main-nav a, .main-nav span {
    font-size: 1.09rem;
    padding: 12px 4px 12px 18px;
    width: 100%;
    display: block;
    border-radius: 8px;
    margin: 0;
  }
  .main-nav a.active, .main-nav a:hover {
    background: #dbeafe;
    color: #1A3761 !important;
  }
  .main-nav .user-info {
    display: none;
  }
}
/* Menü-Overlay für Klick außerhalb (optional, für bessere UX) */
.menu-overlay {
  display: none;
}
@media (max-width: 900px) {
  .menu-overlay.active {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(26,55,97,0.13);
    z-index: 1005;
  }
}
html, body {
  overflow-x: hidden;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  min-width: 520px; /* oder so breit wie nötig */
  width: max-content;
  display: table;
  margin-bottom: 0;
  /* Restliches Table-Design bleibt erhalten */
}
@media (max-width: 800px) {
  .table-scroll table {
    min-width: 420px;
  }
}
@media (max-width: 600px) {
  .table-scroll table {
    min-width: 320px;
    font-size: 0.96rem;
  }
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(26,55,97,0.06);
  margin: 18px 0;
  padding-bottom: 2px; /* verhindert Scrollbar-Überlagerung unten */
}

.table-scroll table {
  min-width: 520px;
  width: max-content;
  border-radius: 10px;
  overflow: hidden;
  /* entfernt die eigenen Schatten, falls noch im table gesetzt */
  box-shadow: none;
  background: transparent;
  margin-bottom: 0;
}
