/* 🔁 RESET: Einheitliche Box-Darstellung */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 🌗 THEMES: LIGHT & DARK MODES -------------------------------- */

/* Light Mode */
body.light {
  background-color: #f8f9fa;
  color: #212529;
}
body.light .text-box {
  color: #FFFFFF; /* dunkle Schrift */
}
body.light .navbar {
  background-color: rgba(255, 255, 255, 0.6) !important;
  color: #000;
}

/* Dark Mode */
body.dark {
  background-color: #121212;
  color: #e9e9e9;
}
body.dark .text-box {
  color: #f8f9fa; /* helle Schrift */
  text-shadow: 2px 2px 2px rgba(0,0,0,1);
}
body.dark a {
  color: #ffc107;
}
body.dark .navbar {
  background-color: #1c1c1c !important;
}
body.dark .dropdown-menu {
  background-color: #2b2b2b;
}
body.dark .dropdown-menu a {
  color: #fff;
}
body.dark .dropdown-menu a:hover {
  background-color: #444;
}

/* 🖼️ Background Image (Dynamisch per data-bg) */
body[data-bg] {
  background-image: url('/assets/backgrounds/default.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
body[data-bg]:before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url('/assets/backgrounds/default.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.25; /* Transparenz steuerbar */
  z-index: -1;
}
body {
  position: relative;
  z-index: 0;
}

/* ✅ NAVIGATION / DROPDOWNS ----------------------------------- */
.navbar {
  min-height: 60px;
  padding-top: 20px;
  padding-bottom: 20px;
  display: flex;
  align-items: left;
  opacity: 0.8;
}

.navbar-nav {
  display: flex;
  flex-direction: row;
  gap: 1rem;
}
.navbar-nav .nav-item {
  display: flex;
  align-items: center;
}
.nav-link {
  color: #ccc !important;
  text-decoration: none;
}
.nav-link:hover {
  color: #ffc107 !important;
}

/* Dropdowns */
.dropdown-menu {
  display: none;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  min-width: 200px;
}
.nav-item.dropdown {
  position: relative;
}
.nav-item.dropdown .dropdown-menu {
  display: none;
  opacity: 1;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 90%;
  transform: translateX(-50%);
  min-width: 200px;
  margin-top: 0.0rem;
  z-index: 9999;
  transition: all 0.3s ease;
}

/* Desktop Hover */
@media (hover: hover) and (pointer: fine) {
  .nav-item.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
  }
}
/* Touch Focus */
.nav-item.dropdown:focus-within .dropdown-menu {
  display: block;
  visibility: visible;
}

/* ❌ Besuchte Links */
a:visited {
  color: inherit;
}

/* 📅 CLOCK */
#clock {
  color: #ccc;
  font-size: 0.85rem;
  white-space: nowrap;
  font-family: monospace;
}

/* 🧱 CONTAINER */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px;
}

/* ✅ TABLES ---------------------------------------- */
.table th, .table td,
.tournament-table th, .tournament-table td {
  vertical-align: middle;
  padding: 12px 8px;
}

.tournament-table,
.tournament-table.mini {
  width: 100%;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  min-width: 600px;
}
.tournament-table.mini {
  min-width: 200px;
}
.tournament-table .position-col {
  width: 40px;
}
.tournament-table.mini .position-col {
  width: 20px;
}
.tournament-table .player-cell,
.tournament-table .player-info {
  display: flex;
  flex-direction: column;
}
.tournament-table .team-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.tournament-table.mini .team-logo {
  width: 15px;
  height: 15px;
}

/* 📉 Tordifferenz */
.text-success {
  color: #28a745 !important;
}
.text-danger {
  color: #dc3545 !important;
}

/* 🏆 BADGES (Zusammengeführt) */
.badge-win,
.badge-draw,
.badge-loss {
  border-radius: 0.5em;
  padding: 0.25em 0.5em;
  font-weight: bold;
  display: inline-block;
}
.badge-win {
  background-color: #d4edda;
  color: #155724;
}
.badge-draw {
  background-color: #fff3cd;
  color: #856404;
}
.badge-loss {
  background-color: #f8d7da;
  color: #721c24;
}

/* 🧭 SPIELER-INFO */
.player-info {
  font-size: 1.1rem;
  font-weight: bold;
}
.player-info-mini {
  font-size: 0.75rem;
  font-weight: bold;
}
.team-name {
  font-size: 0.9rem;
  color: #666;
}
.logo {
  height: 28px;
  margin-right: 8px;
  vertical-align: middle;
}

/* 💾 BUTTONS ------------------------------------------ */

/* Hauptspeicher-Button */
.btn-save {
  background-color: #f1f1f1;
  color: #333;
  border: 1px solid #ccc;
  padding: 8px 16px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease;
}
.btn-save:hover {
  background-color: #e0e0e0;
}

/* Alternative Version für z.B. Formulareingaben */
.btn-save.alt {
  background-color: #007bff;
  color: white;
  border: none;
}
.btn-save.alt:hover {
  background-color: #0056b3;
}

.btn-finish-phase {
  background-color: #218838;
  border-color: #1e7e34;
  color: #fff;
}
.btn-finish-phase:hover {
  background-color: #1c7430;
  border-color: #1a6d2b;
}

/* 🟢 Kleine Buttons */
.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
}

.btn-light.text-success {
  color: green;
  border: 1px solid green;
}
.btn-light.text-danger {
  color: red;
  border: 1px solid red;
}

/* ⭐ STAR / ACTION ICONS ---------------------------------- */
.star-btn, .action-btn, .icon-button {
  background: none;
  border: none;
  cursor: pointer;
}
.star-btn {
  font-size: 1.25rem;
  padding: 2px 6px;
}
.star-btn.plus { color: green; }
.star-btn.minus { color: red; }
.star-btn:hover { opacity: 0.8; }

.action-btn {
  font-size: 1.2rem;
  margin: 0 5px;
}
.action-btn.edit { color: dodgerblue; }
.action-btn.delete { color: crimson; }
.action-btn:hover { opacity: 0.75; }

.icon-button {
  padding: 4px;
  font-size: 1.1rem;
  color: #555;
  transition: color 0.2s ease;
}
.icon-button:hover { color: #000; }
.icon-button.delete:hover { color: #d00; }

/* 🧼 INPUTS ---------------------------------- */
.naked-input {
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  padding: 4px 8px;
  font-size: 1rem;
  width: 100%;
  max-width: 300px;
}
.naked-input:focus {
  outline: none;
  border-bottom: 1px solid #ffc107;
}

/* 📐 FORMS ------------------------------------ */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  font-weight: bold;
  margin-bottom: 4px;
}
.form-group input[type="text"],
.form-group input[type="file"] {
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  padding: 6px 8px;
  font-size: 1rem;
}
.form-group input:focus {
  outline: none;
  border-bottom: 1px solid #ffc107;
}

/* 🧱 FORMULAR */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 400px;
}

/* 🧱 MATCH FORM - finale Variante */
.match-form {
  background: #ffffff;
  min-width: 800px;
  max-width: 1200px;
  width: 100%;
  transition: all 0.2s ease;
}
.match-form:hover {
  background: #f1f5f9;
}
.score-display {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 15px;
  min-width: 50px;
  text-align: center;
}

/* 🎯 LOGO OBEN LINKS */
#floating-logo {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 99999;
  pointer-events: auto;
}
#floating-logo img {
  height: 100px;
  width: auto;
  opacity: 0.70;
}

/* 🧭 SPIELTAG-STYLING / TOOLTIPS -------------------------- */
.spieltag-container {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 15px;
  padding: 4px 0px;
  margin-bottom: 5px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.spieltag-header,
.spieltag-header_rueck,
.group-header {
  display: flex-block;
  padding: 6px 12px;
  width: 200px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  background: linear-gradient(45deg, #ffffff 60%, #708090 100%);
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-top: 5px;
  margin-bottom: 0px;
}

.group-header {
  background: linear-gradient(45deg, #ffffff 30%, #708090 200%);
  width: 80px;
  margin-top: 0px;
}

.add-header {
  display: inline-block;
  padding: 6px 12px;
  width: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  background: linear-gradient(45deg, #ffffff 60%, #708090 100%);
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-top: 0;
  margin-bottom: 0;
  text-decoration: none;
}
.gradient-title {
  font-size: 1.8rem;
  font-weight: bold;
  background: linear-gradient(to right, #222, #444);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.section-header {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(3px);
  border-bottom: 1px solid #ccc;
  padding: 10px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header-second {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(3px);
  border-bottom: 1px solid #ccc;
  padding: 10px 20px;
  margin-bottom: 12px;
  align-items: center;
}

.section-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.header-line {
  border-bottom: 1px solid #ccc;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
/* Meta (rechts) */
.header-meta {
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  line-height: 1.4;
}

.header-mode {
  color: black;
  font-size: 1rem;
  position: absolute;
  right: 70;
  top: 30;
  -webkit-background-clip: text;
  -webkit-text-fill-color: black;
}

.header-date {
  color: black;
  font-size: 0.85rem;
  position: absolute;
  right: 0;
  top: 32;
  -webkit-background-clip: text;
  -webkit-text-fill-color: black;
  font-weight: 400;
}

.trophy-box {
  position: relative;
  display: inline-block;
}
.trophy-box .custom-tooltip {
  visibility: hidden;
  width: 300px;
  background-color: #111;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
  position: absolute;
  z-index: 99;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.85rem;
  white-space: pre-line;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}
.trophy-box:hover .custom-tooltip {
  visibility: visible;
  opacity: 1;
}
.custom-tooltip img {
  width: 250px;
  height: 250px;
  margin-bottom: 6px;
}
.logo-img {
  max-width: 500px;
  height: auto;
}
.spieltag-button-overview {
  display: flex-block;
  padding: 5px 40px;
  width: 180px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #333;
  background: linear-gradient(45deg, #ffffff 60%, #708090 100%);
  border: 1px solid #ddd;
  border-radius: 5px;
  margin-top: -15px;
  margin-bottom: 0px;
}
/* 📌 STICKY SIDEBAR */
@media (min-width: 768px) {
  .sticky-sidebar {
    position: sticky;
    top: 1rem;
    z-index: 10;
  }
}
.list-group.sticky-top {
  position: relative;
}

/* 📱 RESPONSIVE MINI-TABLE FLOATING */
.mini-table-floating {
  position: absolute;
  top: 0;
  left: -100%;
  width: 250px;
  margin-left: -10px;
  transform: translateX(-10px);
  z-index: -10;
}
@media (max-width: 600px) {
  .mini-table-floating {
    transform: translateX(-5px);
    display: none;
  }
}

/* ✅ HR SPACING */
hr {
  margin-top: 2rem;
  margin-bottom: 2rem;
}
/* 1️⃣: Container aufbrechen → volle Breite */
.gallery-wrapper {
    width: 1500px;
    max-width: 1500px;
    margin: 20px auto 10px -200px;  /* <<< Zentriert automatisch */
    padding: 10px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(0px);
}


/* 2️⃣: Innerer Container, der nicht zu breit wird */
.gallery-container {
    max-width: 1450px;
    margin: auto;
}

/* 3️⃣: Header im Stil des Turnier-Designs */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.gallery-header h4 {
    font-weight: 600;
    margin: 0;
}

/* 4️⃣: Galerie-Karten im Trophäen-Stil */
.gallery-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
    background: #fff;
    transition: transform .2s;
}

.gallery-card:hover {
    transform: translateY(-3px);
}

/* 5️⃣: Bild-Vorschaustil */
.gallery-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* 6️⃣: Meta-Bereich */
.gallery-meta {
    padding: 10px 12px;
    font-size: 14px;
}

/* 7️⃣: Kommentarzähler gut sichtbar */
.gallery-meta .comments {
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 6px;
}

/* 8️⃣: Uploader + Datum — dezent */
.gallery-meta .meta-small {
    font-size: 12px;
    color: #777;
    line-height: 1.3;
}

.gallery-meta .uploader {
    color: #555;
    text-decoration: none;
}

.gallery-meta .uploader:hover {
    text-decoration: underline;
}

/* 9️⃣: Delete-Button */
.delete-form {
    padding: 0 12px 12px;
}
/* Gallery Modal — Kommentar Styling */
.comments-list { display:block; gap:12px; }
.comment-item {
  padding:12px;
  border-radius:8px;
  border:1px solid rgba(0,0,0,0.06);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.comment-item.deleted {
  opacity: 0.55;
  background: #f8f9fa;
  text-decoration: line-through;
}
.comment-meta { display:flex; justify-content:space-between; align-items:center; gap:6px; }
.comment-author { font-weight:100; color:#111; }
.comment-date { font-size:12px; color:#777; }
.comment-text { margin-top:1px; font-weight:600; color:#111; font-size:20px; }
.comment-actions { margin-left:8px; display:flex; gap:6px; align-items:center; }
.comment-actions button { font-size:12px; padding:4px 8px; }
.comment-original-tooltip {
  display:inline-block;
  margin-left:8px;
  color:#0d6efd;
  cursor:pointer;
  font-size:12px;
}
.comment-editarea { width:100%; min-height:80px; margin-top:8px; }
.comment-empty { color:#888; font-style:italic; padding:8px; }
.modal-title { align: right; }
