/* Google-ähnliches Theme
   Farben: Blau #17395B, Neutral #6B7280, Gold #F6B73C, Grün #A3C76D, Weiß #ffffff */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
@import url('icon-styles.css');

:root{
  --g-blue:#17395B;
  --g-red:#6B7280;
  --g-yellow:#F6B73C;
  --g-green:#A3C76D;
  --g-white:#ffffff;
  --bg:#f1f3f4;          /* Google surface background */
  --surface:#ffffff;
  --text:#202124;
  --muted:#5f6368;
  --border:#e0e0e0;
  --radius:12px;
  --shadow-sm:0 1px 2px rgba(0,0,0,.06), 0 1px 1.5px rgba(0,0,0,.04);
  --shadow-md:0 2px 6px rgba(0,0,0,.08), 0 12px 24px rgba(0,0,0,.06);
  --focus:0 0 0 3px rgba(26,115,232,.25);
}
*{box-sizing:border-box}
html,body{height:100%}
html {
  overflow-x: hidden !important;
  width: 100%;
}
body{
  margin:0;
  font-family:'Roboto',system-ui,-apple-system,Segoe UI,Roboto,Arial,Helvetica,sans-serif;
  color:var(--text);
  line-height:1.45;
  /* Hintergrundbild wird dynamisch von BackgroundHelper gesetzt */
  /* Fallback: Kein hardcodiertes Bild mehr, da dynamische Bilder aus Supabase verwendet werden */
  min-height: 100vh;
  overflow-x: hidden !important;
  width: 100%;
}
a{color:var(--g-blue);text-decoration:none}
a:hover{text-decoration:underline}

/* November Header Design - Glassmorphism wie Landing Page */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
}

header .container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column; /* ⚠️ Spaltenlayout - Logo und Navigation in zwei Zeilen */
  gap: 8px;
  align-items: flex-start;
  overflow-x: visible;
  width: 100%;
}

header .container .nav-logo {
  flex-shrink: 0;
}

header .container .nav-buttons {
  width: 100%;
  justify-content: flex-start;
  flex-wrap: wrap !important;
}

.nav-logo {
  height: 48px;
  width: auto;
  transition: transform 0.3s ease;
  margin-right: 0;
}

.nav-logo:hover {
  transform: scale(1.1) rotate(5deg);
}

/* Profilbild - wie Logo auf Landing Page */
.nav-profile-image {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  transition: transform 0.3s ease;
  margin-right: 0;
}

.nav-profile-image:hover {
  transform: scale(1.1) rotate(5deg);
}

.nav-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: 0;
  flex-wrap: wrap !important;
  overflow-x: visible !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.nav-buttons::-webkit-scrollbar {
  height: 4px;
}

.nav-buttons::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.nav-btn {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Navigation Buttons - wie Landing Page */

header nav a, .nav-btn{
  color:#fff;
  padding:5px 8px;
  border-radius:999px;
  font-weight:500;
  transition:all 0.3s ease;
  text-align:center;
  white-space:nowrap;
  background:rgba(255, 255, 255, 0.1);
  border:1px solid transparent;
  flex-shrink:0;
  text-decoration:none;
  font-size:0.8rem;
}
header nav a:hover, .nav-btn:hover{
  background:rgba(255, 255, 255, 0.15);
  border-color:rgba(255, 255, 255, 0.2);
  transform:translateY(-2px);
  text-decoration:none;
}

/* Buttons im Header */
header .btn {
  background: #000000;
  color: #fff;
}
header .btn:hover {
  background: #333333;
}

/* Aktiver Menüpunkt */
header nav a.active, .nav-btn.active{
  background:rgba(255, 255, 255, 0.2);
  border-color:rgba(255, 255, 255, 0.3);
  font-weight:600;
  box-shadow:0 2px 8px rgba(0,0,0,0.2);
}

.nav-dashboard-link.active{
  background:rgba(255, 255, 255, 0.2);
  border-color:rgba(255, 255, 255, 0.3);
  font-weight:600;
  box-shadow:0 2px 8px rgba(0,0,0,0.2);
}

/* Footer - Gleicher Stil wie Header */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(10, 22, 40, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0;
  margin-top: 0;
}

footer .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: visible;
  width: 100%;
}

footer nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #FFFFFF;
  width: 100%;
}

footer nav span {
  color: #FFFFFF;
}

footer nav span:not(:last-child):not(:first-child) {
  color: rgba(255, 255, 255, 0.6);
}

footer a,
footer a:visited {
  color: #FFFFFF;
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--g-green);
  text-decoration: none;
}

/* Layout */
.container{max-width:1000px;margin:24px auto;padding:0 16px}
.card{
  background:rgba(255, 255, 255, 0.95);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  padding:16px;
  margin:16px 0;
  backdrop-filter: blur(10px);
}

/* Headings mit dezenter Farbkante */
h1,h2{margin:.2rem 0 1rem}
h1{font-size:1.6rem;font-weight:700;border-bottom:3px solid rgba(26,115,232,.15);padding-bottom:.4rem}
h2{font-size:1.25rem;font-weight:700;border-bottom:2px solid rgba(26,115,232,.15);padding-bottom:.35rem}

/* Buttons (a.btn / button) */
.btn, button{
  display:inline-flex;align-items:center;justify-content:center;
  gap:.4rem;
  padding:.55rem 1rem;
  border-radius:999px;
  border:1px solid transparent;
  background:var(--g-blue);
  color:#fff;
  font-weight:500;
  cursor:pointer;
  transition:transform .02s ease-in, box-shadow .15s ease-in-out, background .15s;
  box-shadow:var(--shadow-sm);
}
.btn:hover, button:hover{filter:brightness(1.02)}
.btn:active, button:active{transform:translateY(1px)}
.btn:focus-visible, button:focus-visible{outline:none;box-shadow:var(--focus)}

/* Farbvarianten */
.btn--primary{background:var(--g-blue)}
.btn--success{background:var(--g-green)}
.btn--danger{background:var(--g-red)}
.btn--warning{background:var(--g-yellow); color:#202124}
.btn--outline{
  background:#fff;color:var(--g-blue);border-color:rgba(163,199,109,.35)
}
.btn--outline:hover{background:#f6f9fe}

/* Formulare */
label{display:block;margin:.5rem 0 .25rem;color:var(--muted);font-weight:500}
input, textarea, select{
  width:100%;
  padding:.65rem .8rem;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  outline:none;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus, select:focus{
  border-color:var(--g-blue);
  box-shadow:var(--focus);
}
input[type="file"]{padding:.5rem;background:#fff}

/* Tabellen */
table{width:100%;border-collapse:collapse;background:#fff;border-radius:12px;overflow:hidden}
thead th{
  text-align:left;
  font-weight:700;
  color:var(--muted);
  background:#f8f9fa;
  padding:12px;
  border-bottom:1px solid var(--border);
}
td{padding:12px;border-bottom:1px solid var(--border)}
tbody tr:hover{background:#f8f9ff}

/* Hinweise/Fehler (Google-Farben) */
.notice{
  background:#f6f9fe;border:1px solid rgba(26,115,232,.25);color:#174ea6;
  border-radius:12px;padding:10px;margin:10px 0
}
.errors{
  background:#fef6f6;border:1px solid rgba(234,67,53,.25);color:#8a1c13;
  border-radius:12px;padding:12px;margin:12px 0
}

/* Kleine Bild-Styles für Strecken-Icons */
img.mini{height:20px;border-radius:6px;vertical-align:middle}

/* Utilities */
.text-center{text-align:center}
.text-right{text-align:right}
.text-left{text-align:left}
.muted{color:var(--muted)}
nav a + a{margin-left:8px}
.spacer{height:12px}

/* ===== Admin: kompakte Buttons & konsistente Anordnung ===== */

.btn-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}

.actions{white-space:normal}

.btn--sm{font-size:.875rem;padding:.35rem .6rem;line-height:1.2;border-radius:8px}

.btn--icon{display:inline-flex;align-items:center;gap:.35rem}

td.actions, th.actions { width: 1%; }

/* Responsive Navigation - Wie Landing Page */
@media (max-width: 768px) {
  /* HTML und Body - Kein horizontaler Scroll */
  html,
  body {
    overflow-x: hidden !important;
    width: 100%;
  }
  
  /* Hintergrundbild für mobile Geräte optimieren */
  body {
    background-attachment: scroll;
    /* Hintergrundbild wird dynamisch von BackgroundHelper gesetzt */
  }
  
  /* Header Container - Kein Overflow, damit Seite nicht mitwandert */
  header .container {
    overflow-x: visible !important;
    padding: 10px 16px;
    width: 100%;
    max-width: 100%;
  }
  
  /* Nav-Buttons - Umbrüche erlauben für alle Buttons sichtbar */
  .nav-buttons {
    flex-wrap: wrap;  /* ⚠️ GEÄNDERT: Umbrüche erlauben */
    gap: 4px;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Profilbild kompakter */
  .nav-profile-image {
    width: 36px;
    height: 36px;
  }
  
  /* Logo kompakter - wie Profilbild */
  .nav-logo {
    height: 36px;
    width: auto;
  }
  
  /* Nav-Buttons - wie Landing Page */
  .nav-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}

/* Auch bei sehr kleinen Bildschirmen - wie User-Bereich */
@media (max-width: 480px) {
  /* HTML und Body - Kein horizontaler Scroll */
  html,
  body {
    overflow-x: hidden !important;
    width: 100%;
  }
  
  /* Header Container - Spaltenlayout beibehalten */
  header .container {
    flex-direction: column !important;  /* ⚠️ GEÄNDERT: Spaltenlayout beibehalten */
    gap: 8px;
    overflow-x: visible !important;
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
  }
  
  /* Nav-Buttons - Umbrüche erlauben für alle Buttons sichtbar */
  .nav-buttons {
    flex-wrap: wrap !important;  /* ⚠️ GEÄNDERT: Umbrüche erlauben */
    width: 100%;
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .nav-buttons::-webkit-scrollbar {
    display: none;
  }
  
  /* Footer responsive */
  footer .container {
    padding: 0 16px;
  }
  
  footer nav {
    font-size: 12px;
    gap: 12px;
  }
}

/* ============================================================================
   ADMIN TOAST NOTIFICATIONS
   ============================================================================ */

.admin-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: none;
}

.admin-toast {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  transform: translateX(400px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-left: 4px solid #28a745;
}

.admin-toast--show {
  transform: translateX(0);
  opacity: 1;
}

.admin-toast--hide {
  transform: translateX(400px);
  opacity: 0;
}

.admin-toast--success {
  border-left-color: #28a745;
  background: #f8fff9;
}

.admin-toast--error {
  border-left-color: #dc3545;
  background: #fff8f8;
}

.admin-toast--info {
  border-left-color: #17a2b8;
  background: #f0f9ff;
}

.admin-toast__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

.admin-toast--success .admin-toast__icon {
  background: #28a745;
  color: #fff;
}

.admin-toast--error .admin-toast__icon {
  background: #dc3545;
  color: #fff;
}

.admin-toast--info .admin-toast__icon {
  background: #17a2b8;
  color: #fff;
}

.admin-toast__message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  font-weight: 500;
}

.admin-toast__close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease;
  line-height: 1;
}

.admin-toast__close:hover {
  color: #333;
}

/* Badge Title - Zentrale Definition für konsistente Darstellung (1.2rem) */
.badge-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text, #333);
}

.badge-title--preview {
  font-size: 0.7rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.1;
  padding: 0 4px;
  word-wrap: break-word;
  hyphens: auto;
  color: var(--text, #333);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-toast-container {
    top: 60px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .admin-toast {
    min-width: auto;
    max-width: none;
  }
}