:root {
    --bg: #0f1117;
    --sidebar: #151922;
    --card: #1c2230;
    --text: #e6e6e6;
    --muted: #9ca3af;
    --accent: #ff6a00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ------------------------------------------------------------------------------------------------------ */
/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--sidebar);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid #222;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent);
    margin-left: 15px;
}

/* ------------------------------------------------------------------------------------------------------ */
/* Sidebar */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 250px;
    height: calc(100% - 60px);
    background: var(--sidebar);
    padding: 20px;
    transition: 0.3s ease;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar a {
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 6px;
    display: block;
    transition: 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
    background: var(--card);
    color: white;
}

/* Sidebar Anpassungen */
.sidebar li {
    margin-bottom: 5px; /* Etwas weniger Abstand für kompaktere Gruppen */
}

/* Sidebar Untermenü - Standardmäßig versteckt */
.sidebar .submenu {
    display: block; /* Initial geschlossen */
    list-style: none;
    padding-left: 30px; /* Stärkere Einrückung */
    margin-top: 5px;
    margin-bottom: 10px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.sidebar .submenu li {
    margin-bottom: 2px;
}

.sidebar .submenu a {
    font-size: 13px; /* Etwas kleinere Schrift für Unterpunkte */
    padding: 6px 12px;
    color: var(--muted);
    opacity: 0.8;
}

.sidebar .submenu a:hover {
    background: rgba(255, 255, 255, 0.05); /* Leichterer Hover-Effekt */
    color: white;
    opacity: 1;
}

/* Aktiver Unterpunkt (optional) */
.sidebar .submenu a.active-sub {
    color: var(--accent); /* Falls du eine Akzentfarbe definiert hast */
    font-weight: 600;
}

/* Klasse zum Anzeigen (wird per JS gesteuert) */
.sidebar .submenu.open {
    display: block;
}

/* Styling für den Pfeil */
.arrow {
    float: right;
    font-size: 10px;
    transition: transform 0.3s;
    opacity: 0.5;
}

/* Diese Klasse wird nun zum Schließen verwendet, falls gewünscht */
.sidebar .submenu.closed {
    display: none;
}

/* Drehung des Pfeils wenn offen */
.submenu-toggle.active {
    transform: rotate(180deg);
}
.menu-parent.active .arrow {
    transform: rotate(180px); /* Pfeil dreht sich beim Öffnen */
}

/* Container für Link + Pfeil */
.menu-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-link {
    flex-grow: 1; /* Der Link nutzt den restlichen Platz */
}

/* Der Button zum Aufklappen */
.submenu-toggle {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 8px 15px;
    cursor: pointer;
    font-size: 10px;
    transition: transform 0.3s, color 0.2s;
	transform: rotate(180deg);
}

.submenu-toggle:hover {
    color: white;
}

/* Mobil-Optimierung: Größere Klickflächen */
@media (max-width: 768px) {
    .sidebar .submenu a {
        padding: 10px 15px;
        font-size: 14px; /* Auf dem Handy besser lesbar */
    }
}

/* ------------------------------------------------------------------------------------------------------ */
/* Main Content */
.main {
    margin-left: 250px;
    padding: 100px 40px 40px 40px;
    max-width: 900px;
	margin-top: 80px;
	box-sizing: border-box;
    padding-top: 20px; 
}

.main h1 {
    font-size: 32px;
    margin-bottom: 20px;
}

.main h2 {
    margin-top: 40px;
    margin-bottom: 10px;
    font-size: 20px;
}

.main p {
    color: var(--muted);
    line-height: 1.6;
}

.main ul {
    margin-left: 20px;
    margin-top: 10px;
}
/* ------------------------------------------------------------------------------------------------------ */
/* Right Nav */
.right-nav {
    position: fixed;
    right: 0;
    top: 100px;
    width: 220px;
    padding: 20px;
    color: var(--muted);
}

.right-nav h4 {
    margin-bottom: 15px;
    color: white;
    font-size: 14px;
}

.right-nav a {
    display: block;
    text-decoration: none;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.right-nav a:hover {
    color: var(--accent);
}
/* Reserviert Platz für die rechte Navigation auf Desktop-Bildschirmen */
@media (min-width: 1025px) {
    .main {
        margin-right: 260px; /* 220px Breite + 40px Sicherheitsabstand */
    }
}

/* Auf dem Handy sollte die rechte Navigation meistens ausgeblendet oder 
   anders positioniert werden, damit sie nicht das ganze Bild verdeckt */
@media (max-width: 1024px) {
    .right-nav {
        display: none; /* Blendet die rechte Nav auf kleinen Schirmen aus */
    }
    .main {
        margin-right: 0; /* Nutzt die volle Breite auf dem Handy */
        padding: 15px;
    }
}


/* Menu Button */
.menu-toggle {
    display: none;
    background: var(--accent);
    border: none;
    padding: 6px 10px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

/* ------------------------------------------------------------------------------------------------------ */
/* Responsive */
@media (max-width: 1100px) {
    .right-nav {
        display: none;
    }
}

@media (max-width: 900px) {

    .menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        padding: 100px 20px 20px 20px;
    }
}

/* ------------------------------------------------------------------------------------------------------ */

/* Basis-Zustand: Nur Links innerhalb einer Card */
.card a, 
.card a:visited {
    color: #ff7f2a; /* Dein Orange */
    background: transparent; /* Falls vorher ein Background da war, hier zurücksetzen */
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-block; /* Damit Transform & Padding sauber wirken */
}

/* Hover-Zustand: Etwas heller (#ff9854) */
.card a:hover {
    color: #ff9854; /* Ein etwas helleres Orange */
    background: #ffffff; 
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(255, 106, 0, 0.2);
}

/* Aktiv-Zustand: Wenn man gerade draufdrückt */
.card a:active {
    transform: translateY(0);
}

/* Basis-Style für alle Boxen */
.info-box {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 4px;
    border-left: 6px solid; /* Der farbige Balken links */
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
}

/* ------------------------------------------------------------------------------------------------------ */
/* Farbausprägungen (Hintergrund und Balkenfarbe) */
.info-box.green {
    background-color: rgba(40, 167, 69, 0.15); /* Transparentes Grün */
    border-color: #28a745;
    color: #d4edda;
}

.info-box.red {
    background-color: rgba(220, 53, 69, 0.15); /* Transparentes Rot */
    border-color: #dc3545;
    color: #f8d7da;
}

.info-box.blue {
    background-color: rgba(0, 123, 255, 0.15); /* Transparentes Blau */
    border-color: #007bff;
    color: #cce5ff;
}

.info-box.yellow {
    background-color: rgba(255, 193, 7, 0.15); /* Transparentes Gelb */
    border-color: #ffc107;
    color: #fff3cd;
}

.info-box.orange {
    background-color: rgba(253, 126, 20, 0.15); /* Transparentes Orange */
    border-color: #fd7e14;
    color: #ffe5d0;
}

.info-box.white {
    background-color: rgba(255, 255, 255, 0.1); /* Transparentes Weiß */
    border-color: #ffffff;
    color: #ffffff;
}

/* Hervorhebung innerhalb der Boxen */
.info-box strong {
    font-weight: 700;
}

/* ------------------------------------------------------------------------------------------------------ */
/* Optimierte Karten-Übersicht für breitere Links */
.map-grid {
    display: grid;
    /* Erhöht die Mindestbreite der Boxen von 250px auf 320px */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 20px;
    margin: 20px 0;
}

.map-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px; /* Etwas mehr Innenabstand für bessere Optik */
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.map-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.map-card .map-name {
    font-weight: 700;
    font-size: 1.15em; /* Leicht vergrößert */
    color: #007bff;
    margin-bottom: 10px;
    
    /* Sicherheitsnetz: Falls es auf sehr schmalen Handys 
       immer noch zu lang ist, bricht es nun sauber um */
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
}

.map-card .map-info {
    font-size: 0.9em;
    color: #555;
    background: #f1f3f5;
    padding: 10px;
    border-radius: 6px;
    margin-top: auto; /* Schiebt die Info-Box immer nach unten */
    border-left: 3px solid #dee2e6;
}

/* Spezieller Fix für sehr kleine Displays (Mobile Portrait) */
@media (max-width: 360px) {
    .map-grid {
        grid-template-columns: 1fr; /* Volle Breite auf Kleinstgeräten */
    }
    .map-card .map-name {
        font-size: 1em; /* Schrift etwas kleiner auf Mini-Handys */
    }
}

/* ------------------------------------------------------------------------------------------------------ */
/* Styling für die große Konfigurations-Tabelle */
.meshtastic-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 30px 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.meshtastic-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
    padding: 20px;
    border-bottom: 2px solid #dee2e6;
    text-align: left;
}

.meshtastic-table td {
    padding: 18px 20px; /* Viel Abstand für bessere Lesbarkeit */
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    color: #444;
}

/* Kategorie-Spalte hervorheben */
.meshtastic-table td:first-child {
    font-weight: 600;
    color: #007bff;
    background-color: #fcfcfc;
    width: 25%;
}

/* Einstellung-Spalte */
.meshtastic-table td:nth-child(2) {
    color: #666;
    width: 30%;
}

/* Empfehlungs-Spalte (Wichtigster Teil) */
.meshtastic-table td:last-child {
    font-weight: 500;
    color: #000;
}

/* Zeilen-Hover Effekt */
.meshtastic-table tr:hover td {
    background-color: #fdfdfd;
}

/* Badge für AKTIVIERT / Empfehlungen */
.recommend-badge {
    background: #e7f3ff;
    color: #007bff;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9em;
    display: inline-block;
}

.warning-text {
    color: #dc3545;
    font-weight: 700;
}

/* Trenner für Hauptkategorien */
.category-row td {
    background: #f1f3f5 !important;
    border-bottom: 2px solid #dee2e6;
}

/* Container für mobiles Scrollen */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Erlaubt horizontales Scrollen */
    -webkit-overflow-scrolling: touch; /* Sanftes Scrollen auf iOS */
    margin-bottom: 1rem;
    border-radius: 12px;
}

/* Visueller Hinweis für mobiles Scrollen (optional) */
@media (max-width: 768px) {
    .table-responsive::after {
        content: "↔ Wischen zum Scrollen";
        display: block;
        text-align: right;
        font-size: 0.75em;
        color: #888;
        padding: 5px 0;
    }
    
    /* Etwas schmalere Abstände auf dem Handy */
    .meshtastic-table td, 
    .meshtastic-table th {
        padding: 12px 15px;
        min-width: 140px; /* Verhindert, dass Spalten zu eng werden */
    }
    
    .meshtastic-table td:first-child {
        min-width: 120px;
    }
}

/* ------------------------------------------------------------------------------------------------------ */
/* Container für das Logo unter der H1 */
/* Der Container stellt sicher, dass nichts nach rechts ausbricht */
.hero-logo-container {
    width: 100%;
    max-width: 100%;       /* Darf niemals breiter als der Bildschirm sein */
    display: flex;
    justify-content: flex-start; /* Oder 'center', falls gewünscht */
    margin: 20px 0;
    overflow: hidden;      /* Schneidet Überstände im Notfall ab */
    padding: 0;            /* Verhindert doppeltes Padding-Problem */
}

/* Das Logo passt sich nun dynamisch an */
.hero-logo {
    display: block;
    width: auto;           /* Nimmt nur so viel Platz wie nötig */
    max-width: 100%;       /* WICHTIG: Begrenzt das Bild auf die Bildschirmbreite */
    height: auto;          /* Behält das Seitenverhältnis bei */
    
    /* Falls das Logo auf dem Desktop eine feste Maximalgröße haben soll: */
    max-height: 150px;     /* Begrenzt die Höhe, damit es nicht zu riesig wird */
}

/* Zusätzlicher Fix für das Haupt-Layout, falls .main das Problem ist */
.main {
    max-width: 100vw;      /* Verhindert horizontales Scrollen der ganzen Seite */
    overflow-x: hidden;    
    padding: 20px;         /* Standard-Abstand zum Rand */
    box-sizing: border-box; /* Rechnet Padding in die Breite ein */
}

/* Anpassung für mobile Endgeräte */
@media (max-width: 600px) {
    .hero-logo {
        max-width: 250px;    /* Etwas kleiner auf kleinen Bildschirmen */
    }
    .hero-logo-container {
        margin: 15px 0 20px 0;
    }
}

/* ------------------------------------------------------------------------------------------------------ */
/* Spezielle Formatierung für die Namens-Beispiele */
.naming-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.naming-list li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #333;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    line-height: 1.6;
}

/* Der rote Highlight-Stil aus dem Bild */
.node-example {
    color: #ff4d4d; /* Ein helleres Rot für dunkle Hintergründe */
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    background: rgba(255, 77, 77, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.naming-note {
    font-size: 0.9em;
    color: #888;
    font-style: italic;
    margin-top: 10px;
}
