/* =============================
   Farben & Designvariablen (Bergwacht Bayern inspiriert)
   ============================= */
   :root {
    --primary-red: #e60005; /* DRK-Rot */
    --primary-blue: #0088ce; /* Berggrün */
    --primary-orange: #f59100; /* Bergorange */
    --text-color: #222222;
    --background: #ffffff;
    --surface: #f4f4f4;
    --border-light: #b2b2b2;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --focus-glow: rgba(230, 0, 5, 0.3);
    --error-bg: #ffe6e6;
    --error-border: #e60005;
  }
  
  /* =============================
     Reset & Basis (Desktop Default)
     ============================= */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
      Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background);
    color: var(--text-color);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility; /* Für bessere Lesbarkeit auf Desktop */
  }

  .hidden {
     visibility: hidden;
     height: 0;
  }
  
  /* =============================
     Layout Container (Desktop Default)
     ============================= */
  .container {
    max-width: 80%; /* Desktop Standardbreite */
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    background-color: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 10px 30px var(--shadow-light);
    transition: box-shadow 0.3s ease;
  }
  
  .container:hover {
    box-shadow: 0 15px 40px var(--shadow-medium);
  }
  
  /* =============================
     Typografie (Desktop Default)
     ============================= */
  h1, h2 {
    color: var(--primary-red);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: 0.03em;
    line-height: 1.2; /* Normaler Zeilenabstand für Desktop */
  }
  
  a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: color 0.25s ease;
  }
  
  a:hover,
  a:focus {
    color: var(--primary-orange);
    text-decoration: underline;
  }

  /* =============================
     Header
     ============================= */
     header {
        position: fixed;
        top: 0;
        width: 100%;
        background: linear-gradient(135deg, var(--primary-red), var(--primary-blue));
        color: var(--background);
        padding: 1rem 2rem;
        display: flex;
        align-items: center;
        border-radius: 0 0 1rem 1rem;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        z-index: 5;
      }
      
      /* Logo links */
      .logo {
        height: 50px;
        margin-right: 1.5rem;
        user-select: none;
        cursor: pointer;
        flex-shrink: 0;
      }      
      
      /* Headerbild als halbtransparenter Overlay */
      header::before {
        content: "";
        position: absolute;
        right: 0;
        top: 0;
        /* width: 40%; */
        width: 100%;
        height: 100%;
        background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=800&q=80') no-repeat center center/cover;
        opacity: 0.25;
        pointer-events: none;
        border-radius: 0 0 1rem 0;
        z-index: 0;
      }

      
      /* Header-Inhalt nach vorne */
      header > * {
        position: relative;
        z-index: 10;
      }
      
      /* Navigation links nebeneinander */
      nav {
        flex-grow: 1;
        display: flex;
        gap: 1.5rem;
        font-weight: 600;
        justify-content: flex-end;
      }
      
      /* Link Style in Header */
      nav a {
        color: var(--background);
        text-decoration: none;
        position: relative;
        padding: 0.5rem 0.75rem;
        transition: color 0.3s ease;
      }
      
      nav a::after {
        content: "→";
        position: absolute;
        right: -5px;
        top: 50%;
        transform: translateY(-50%);
        opacity: 0.5;
        transition: opacity 0.3s ease, transform 0.3s ease;
      }
      
      nav a:hover,
      nav a:focus {
        color: var(--primary-orange);
      }
      
      nav a:hover::after,
      nav a:focus::after {
        opacity: 1;
        transform: translateY(-50%) translateX(6px);
      }
      

  /* =============================
     Login-Container (Desktop Default)
     ============================= */
    .login-container {
        max-width: 400px;
        margin: 6rem auto;
        padding: 2.5rem 2rem;
        background: var(--surface);
        border-radius: 1rem;
        box-shadow: 0 12px 30px var(--shadow-medium);
        display: flex;
        flex-direction: column;
        align-items: center;
        font-family: 'Inter', sans-serif;
    }

    .login-container h1 {
        margin-bottom: 2rem;
        color: var(--primary-red);
        font-weight: 900;
        font-size: 1.8rem;
        text-align: center;
        letter-spacing: 0.05em;
    }

    form {
        width: 100%;
    }

    label {
        font-weight: 700;
        margin-bottom: 0.5rem;
        display: block;
        color: var(--text-color);
        font-size: 1em; /* Desktop Standardgröße */
    }

    input[type="text"],
    input[type="password"] {
        width: 100%;
        padding: 0.85rem 1.2rem;
        margin-bottom: 1.5rem;
        border: 2px solid var(--border-light);
        border-radius: 0.75rem;
        font-size: 1rem;
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
        min-height: auto; /* Desktop Standard */
    }

    input[type="text"]:focus,
    input[type="password"]:focus {
        border-color: var(--primary-red);
        box-shadow: 0 0 10px var(--focus-glow);
        outline: none;
    }

    .btn-red {
        width: 100%;
        background-color: var(--primary-red);
        color: var(--background);
        border: none;
        padding: 0.9rem 0;
        border-radius: 0.75rem;
        font-weight: 700;
        font-size: 1.1rem;
        cursor: pointer;
        box-shadow: 0 6px 15px rgba(230, 0, 5, 0.5);
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
        min-height: auto; /* Desktop Standard */
      }
      
      .btn-red:hover,
      .btn-red:focus {
        background-color: var(--primary-blue);
        box-shadow: 0 7px 20px rgba(0, 120, 75, 0.7);
        outline-offset: 3px;
        outline: 3px solid var(--primary-blue);
      }
      
      .error {
        width: 100%;
        background-color: var(--error-bg);
        border: 2px solid var(--error-border);
        color: #800000;
        padding: 0.8rem 1rem;
        border-radius: 0.75rem;
        font-weight: 700;
        margin-bottom: 1.5rem;
        text-align: center;
        box-shadow: 0 4px 15px rgba(230, 0, 5, 0.2);
        font-size: 1rem; /* Desktop Standard */
      }
  
  /* =============================
     Buttons (Desktop Default)
     ============================= */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-red);
    color: var(--background);
    border: none;
    padding: 0.85rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 5px 15px rgba(230, 0, 5, 0.4);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    gap: 0.5rem;
    min-height: auto; /* Desktop Standard */
  }
  
  .btn:hover,
  .btn:focus {
    background-color: var(--primary-blue);
    box-shadow: 0 7px 20px rgba(0, 120, 75, 0.7);
    outline-offset: 4px;
    outline: 3px solid var(--primary-blue);
  }
  
  .btn svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: var(--background);
    transition: transform 0.3s ease;
  }
  
  .btn:hover svg {
    transform: translateX(5px);
  }
  
  /* =============================
     Formularelemente (Desktop Default)
     ============================= */
  label {
    display: block;
    margin: 1.2rem 0 0.5rem 0;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.015em;
    color: var(--text-color);
  }
  
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  select,
  textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 1rem;
    background-color: var(--background);
    font-family: inherit;
    color: var(--text-color);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-weight: 400;
    min-height: auto; /* Desktop Standard */
  }
  
  input[type="text"]:focus,
  input[type="password"]:focus,
  input[type="number"]:focus,
  input[type="date"]:focus,
  select:focus,
  textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 10px var(--focus-glow);
  }

  textarea {
    min-height: auto; /* Desktop Standard */
    resize: vertical; 
  }
  
  /* =============================
     Fehlermeldung & Erfolg (Desktop Default)
     ============================= */
  .message {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    animation: fadeInUp 0.4s ease forwards;
    font-size: 1rem; /* Desktop Standard */
  }
  
  .message.error {
    background-color: var(--error-bg);
    border: 2px solid var(--error-border);
    color: #800000;
  }
  
  .message.success {
    background-color: #e6ffed;
    border: 2px solid var(--primary-blue);
    color: #256c2a;
  }
  
  /* =============================
     Tabellen (Desktop Default)
     ============================= */
.table-wrapper {
    margin-top: 2rem;
    border-radius: 1rem;
    box-shadow: 0 6px 20px var(--shadow-light);
    max-width: 100%;
    overflow-x: auto; /* visible: Auf Desktop standardmäßig kein Scrollen */
  }
  
  table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; /* wichtig für zuverlässiges Scrollverhalten */
    border-spacing: 0;
    min-width: 1000px;
    border-radius: 1rem;
    /* overflow: hidden; */
    font-size: 0.85rem; /* Desktop Standard Schriftgröße für Tabellen */
    line-height: 1.5;   
    background-color: var(--surface);
    /* table-layout: auto;  */
    /* word-wrap: break-word; */
    /* overflow-wrap: break-word; */
  }


  .sticky-col {
    position: sticky;
    right: 0;
    /* background: white; */
    z-index: 2; /* damit sie über anderen Spalten bleibt */
    box-shadow: -1px 0 3px rgba(0, 0, 0, 0.1);
  }
  
  thead th {
    background-color: var(--primary-red);
    color: var(--background);
    text-align: left;
    font-weight: 700;
    font-size: smaller;
    padding: 0.8rem 1.2rem; 
    user-select: none;
    letter-spacing: 0.05em;
    /* white-space: nowrap; /* Kopfzeilen nicht umbrechen */
  }
  
  tbody td {
    padding: 0.5rem 1rem; 
    border-bottom: 1px solid var(--border-light);
    color: var(--text-color);
    white-space: normal; 
    vertical-align: top;
    font-size: smaller; /* Desktop Standard Schriftgröße für Zellen */
  }
  
  
  tbody tr {
    transition: background-color 0.2s ease;
    cursor: default;
  }
  
  tbody tr:hover {
    background-color: #f9f9f9;
  }
  
  tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-color);
  }

  /* =============================
     Warn-Farben
     ============================= */
    
    .info {
        background-color: #ffee00; 
    }

    .warn {
        background-color: #f8ad23; 
    }

    .alert {
        background-color: #f81313; 
    }

    tr.alert td {
        color: #ffffff;
    }

    tr.alert:hover td {
        color: #000000; /* Bei Hover über die ganze Zeile: schwarze Schrift für alle <td> */
    }
    

    .success {
        background-color: #14e622;
    }

  /* =============================
     Video-Element (Desktop Default)
     ============================= */
  #video {
    width: 320px;
    height: 240px;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: 0 6px 20px var(--shadow-light);
    margin-bottom: 2rem;
    border: 2px solid var(--border-light);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  }
  
  #video.focused {
    border-color: var(--primary-red);
    box-shadow: 0 0 20px var(--primary-blue);
    transform: scale(1.05);
  }

  /* =============================
      Suche Material-Liste
     ============================= */

  .sichtbar {
            display: block !important;
        }

        #suchhilfe {
            display: none;
        }

        .suchhilfe {
            background: #f9f9f9;
            border: 1px solid #ccc;
            padding: 12px 16px;
            margin-bottom: 20px;
            font-family: Arial, sans-serif;
            font-size: 14px;
            color: #333;
            border-radius: 6px;
            max-width: 600px;
        }

        .suchhilfe h3 {
            margin-top: 0;
            margin-bottom: 8px;
            font-size: 18px;
            color: #2c3e50;
        }

        .suchhilfe strong {
            color: #2c3e50;
        }

        .suchhilfe code {
            background: #e1e1e1;
            padding: 2px 6px;
            border-radius: 3px;
            font-family: monospace;
            font-size: 13px;
        }

        .suchhilfe table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 8px;
            margin-bottom: 8px;
        }

        .suchhilfe table td {
            padding: 4px 8px;
            vertical-align: top;
        }

        .suchhilfe table tr:nth-child(even) {
            background: #f2f2f2;
        }

        .suchhilfe .tip {
            font-style: italic;
            color: #555;
            margin-top: 10px;
        }
  
  /* =============================
     Responsive Design (Mobile Anpassungen - min-width)
     ============================= */

  /* Für Bildschirme bis zu 600px Breite (Mobile) */
  @media (max-width: 900px) {
    body {
      font-size: 0.95rem; /* Etwas kleinere Basisschriftgröße für Mobile */
    }
  
    /* Container anpassen */
    .container {
      margin: 1rem;
      padding: 1.5rem;
      box-shadow: 0 5px 18px var(--shadow-light);
      max-width: none; /* Auf Mobilgeräten volle Breite nutzen */
    }
  
    /* Login-Container anpassen */
    .login-container {
      margin: 3rem 1rem; /* Weniger Margin auf Mobilgeräten */
      padding: 1.5rem; /* Weniger Padding */
    }

    .login-container h1 {
      font-size: 1.6rem; /* Kleinere Überschrift */
    }
  
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;

      }
    header::before {
        width: 100%;
        height: 120px;
        opacity: 0.15;
        border-radius: 0 0 1rem 1rem;
    }
    nav {
        width: 100%;
        justify-content: space-around;
        margin-top: 1rem;

    }
  
    /* Buttons größer & voller Breite */
    .btn {
      width: 100%;
      font-size: 1.3rem;
      padding: 1.25rem 0;
      border-radius: 1.25rem;
      min-height: 52px; /* Touch-Zielgröße */
    }

    .btn-red {
      min-height: 52px; /* Touch-Zielgröße */
      font-size: 1.3rem; /* Größere Schrift für Button im Login */
      padding: 1.25rem 0;
      border-radius: 1.25rem;
    }
  
    /* Formularelemente größer */
    label {
      font-size: 1.1em; /* Labels etwas größer */
    }

    input[type="text"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
      font-size: 1.15rem;
      padding: 1.25rem 1.5rem;
      border-radius: 1.25rem;
      min-height: 52px; /* Touch-Zielgröße */
    }

    textarea {
      min-height: 120px; /* Angemessene Höhe für Textfelder auf Mobilgeräten */
    }

    .error, .message {
      font-size: 0.95rem; /* Nachrichten etwas kleiner */
      padding: 1rem; /* Etwas weniger Padding */
    }
  
    /* Video */
    #video {
      width: 100%;
      max-height: 50vh;
      border-radius: 1.5rem;
      border: 3px solid var(--primary-red);
      box-shadow: 0 0 25px var(--primary-red);
    }
  
    /* Tabellen für Mobile optimiert: Scrollbar */
    .table-wrapper {
        overflow-x: auto; /* Erlaubt horizontales Scrollen bei Bedarf */
        -webkit-overflow-scrolling: touch; /* Für flüssigeres Scrollen auf iOS */
        /* Kein max-width, die Tabelle selbst ist scrollbar */
        border-radius: 0.75rem; /* Leichte Rundung auch im Wrapper */
        box-shadow: 0 4px 15px var(--shadow-light); /* Leichter Schatten für den Wrapper */
    }
  
    table {
        width: 100%; /* Die Tabelle nimmt die Breite des Wrappers ein */
        min-width: 600px; /* Mindestbreite, damit horizontales Scrollen aktiviert wird */
        border-collapse: separate; /* Behält die separate Zellenansicht bei */
        border-spacing: 0;
        border-radius: 0.75rem; /* Rundung für die Tabelle */
        overflow: hidden; /* Wichtig für die Rundung des Inhalts */
        font-size: 1.05rem; /* Größere Schrift für bessere Lesbarkeit auf Mobilgeräten */
        line-height: 1.6; /* Etwas mehr Zeilenabstand */
        background-color: var(--background); /* Helle Hintergrundfarbe für die Tabelle selbst */
        table-layout: auto; /* Erlaubt Browser, Spaltenbreiten anzupassen */
    }
  
    thead th {
        font-size: 1rem; /* Schriftgröße der Kopfzeilen auf Mobile anpassen */
        padding: 1rem 1.2rem; /* Mehr Padding für größere Touch-Ziele */
        white-space: nowrap; /* Stellt sicher, dass die Kopfzeilen nicht umbrechen */
    }
  
    tbody td {
        padding: 0.9rem 1.2rem; /* Größerer Padding für Zelleninhalt */
        font-size: 1rem; /* Schriftgröße der Zellen auf Mobile anpassen */
        /* `border-bottom` bleibt für Trennung */
        white-space: nowrap; /* Inhalt bleibt in einer Zeile (scrollbar) */
        overflow: hidden; /* Überlaufenden Text ausblenden */
        text-overflow: ellipsis; /* Überlaufenden Text mit "..." kennzeichnen */
    }

    tbody tr {
        border-bottom: 1px solid var(--border-light); /* Trennlinie zwischen den Zeilen */
    }

    tbody tr:last-child {
        border-bottom: none; /* Letzte Zeile ohne Trennlinie */
    }
  }

  /* Zusätzliche Media Query für noch kleinere Geräte (z.B. iPhone 5/SE) */
  @media (max-width: 765px) {
    .container, .login-container {
      margin: 1rem 0.5rem; 
      padding: 1rem; 
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
      }
    header::before {
        width: 100%;
        height: 120px;
        opacity: 0.15;
        border-radius: 0 0 1rem 1rem;
    }
    nav {
        width: 100%;
        justify-content: space-around;
        margin-top: 1rem;
    }
    table {
        min-width: 480px; /* Kleinere Mindestbreite für sehr kleine Bildschirme */
        font-size: 1rem; /* Etwas kleiner für sehr kleine Geräte */
    }

    thead th, tbody td {
        padding: 0.8rem 1rem; /* Padding anpassen für sehr kleine Geräte */
        font-size: 0.95rem;
    }
  }
  
  /* =============================
     Animationen
     ============================= */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }