/* --- Farbvariablen --- */
:root {
    --color-primary: #D35400;
    --color-primary-hover: #E67E22;
    --color-success: #27ae60;
    --color-bg-dark: #161412;
    --color-bg-card: #221F1C;
    --color-bg-card-hover: #2A2422;
    --color-text-light: #FFFFFF;
    --color-danger: #ff4d4d;
    --color-black: #000000;
    --color-border: #333333;
    --color-info: #3498db;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* --- Basis-Layout --- */
body {
    font-family: var(--font-body) !important;
    background-color: var(--color-bg-dark) !important;
    color: var(--color-text-light) !important;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* --- Content Layout --- */
.content-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 800px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading) !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    text-decoration: underline;
    color: var(--color-primary-hover);
}

/* --- Header & Navigation --- */

header {
    background: var(--color-black);
    padding: 10px 20px;
    /* Etwas kompakter */
    border-bottom: 2px solid var(--color-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Verhindert Überlagerung */
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo a {
    font-weight: bold;
    font-size: 1.5em;
    color: var(--color-primary);
    text-decoration: none;
    /* Kein Unterstrich */
    display: flex;
    align-items: center;
    gap: 10px;
    /* Abstand zwischen Logo-Bild und Text */
}

.logo a:hover {
    color: var(--color-success);
    text-decoration: none;
    /* Sicherstellen, dass auch beim Hover kein Unterstrich kommt */
}

.logo img {
    height: 60px;
    /* Das bestimmt die Größe des Bildes */
    width: auto;
    /* Das verhindert, dass es verzerrt wird */
    display: block;
}

/* --- Tour Bild Container --- */
.tour-image-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tour-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Dashboard & Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
}

.dash-card {
    background: var(--color-bg-card);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform 0.2s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-decoration: none;
    color: var(--color-text-light);
}

.dash-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-primary);
}

.dash-card.maintenance-active {
    border: 2px solid #ff0000 !important;
    background: rgba(255, 0, 0, 0.05) !important;
}

.dash-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.dash-card h3 {
    margin: 0;
    font-size: 1em;
    color: var(--color-primary);
}

.dash-card p {
    font-size: 0.75em;
    color: #aaa;
    margin: 0;
}

/* --- Formulare & Shop --- */
input,
select,
textarea {
    background: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    color: #fff;
    padding: 12px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px;
}

label {
    color: var(--color-primary);
    font-weight: bold;
    display: block;
    margin-top: 10px;
}

input[type="checkbox"] {
    width: auto !important;
    height: 1.2em;
    cursor: pointer;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #000;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: bold;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: none;
    border: none;
    box-sizing: border-box;
    height: 34px;
    /* Fixierte Höhe für perfekte Ausrichtung */
}

.btn-info {
    background: var(--color-info);
    color: #fff;
}

.btn-info:hover {
    background: #2980b9;
    color: #fff;
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover {
    background: #219653;
    color: #fff;
}

.btn-warning {
    background: #d35400;
    color: #fff;
}

.btn-warning:hover {
    background: #e67e22;
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #cc0000;
    color: #fff;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--color-bg-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--color-border);
}

.tooltip-trigger {
    cursor: help;
    font-size: 0.8em;
    margin-left: 5px;
    color: var(--color-primary);
    position: relative;
}

/* Tooltip beim Hover anzeigen */
.tooltip-trigger:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    width: 200px;
    font-size: 12px;
    z-index: 1000;
}

/* .content-wrapper { max-width: 1000px; margin: 0 auto; padding: 20px; } */
.content-wrapper {
    max-width: 900px;
    /* Etwas schmaler für bessere mobile Lesbarkeit */
    margin: 0 auto;
    padding: 15px;
}

.hero-section {
    padding: 80px 20px;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/images/biker_background.png');
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin-bottom: 40px;
    color: var(--color-primary);
    text-align: center;
}

.hero-title {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.hero-slogan {
    font-size: 1.2em;
    color: var(--color-primary);
    font-style: italic;
}

.section-title {
    color: var(--color-primary);
    margin-bottom: 20px;
}

.card-grid {
    display: grid;
    /* Begrenze die Anzahl der Spalten auf dem Desktop, damit es nicht "ausfranst" */
    grid-template-columns: repeat(auto-fit, minmax(280px, 350px));
    justify-content: center;
    /* Zentriert das Grid, wenn der Platz zu groß ist */
    gap: 20px;
    margin-top: 40px;
}

.card {
    background: var(--color-bg-card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    text-align: center;
}

.dash-membership-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    display: block;
}

/* Optional: Damit die Abstände in der Kachel stimmen */
.membership-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.generator-card {
    background: var(--color-bg-card);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    margin-top: 25px;
}

.mc-success {
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid var(--color-success);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: var(--color-success);
    font-weight: bold;
}

.mc-error {
    background: rgba(255, 77, 77, 0.15);
    border: 1px solid var(--color-danger);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: var(--color-danger);
    font-weight: bold;
}


/* Ergänzung für mobile Optimierung */
@media (max-width: 600px) {
    .hero-section {
        padding: 40px 10px;
        background-size: contain;
        background-repeat: no-repeat;
    }

    .hero-title {
        font-size: 1.8em;
    }
}

/* --- Slide-In Menü Optimiert --- */
.side-nav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 10000;
    /* Sehr hoch, damit es über allem liegt */
    top: 0;
    right: 0;
    background-color: var(--color-bg-card);
    /* Nutzt dein Card-Design */
    border-left: 2px solid var(--color-primary);
    /* Rahmen passend zum Header */
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 70px;
}

.side-nav.active {
    width: 250px;
}

.side-nav a {
    padding: 5px 25px;
    display: block;
    color: var(--color-primary);
    font-size: 1.2em;
    transition: 0.3s;
}

.side-nav a:hover {
    color: var(--color-primary-hover);
    text-decoration: none;
    /* Kein Unterstrich */
    background: rgba(255, 255, 255, 0.05);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 40px !important;
    cursor: pointer;
}

.menu-toggle {
    cursor: pointer;
    font-size: 30px;
    color: var(--color-primary);
}

/* Sicherstellen, dass Kacheln flexibel sind */
.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Verteilt Inhalt und Button sauber */
    height: 100%;
    /* Kacheln sind immer gleich hoch */
}

/* Button-Anpassung für Kacheln */
.card .btn {
    padding: 8px 12px;
    /* Etwas kleiner als die Standard-Buttons */
    font-size: 0.9em;
    width: 100%;
    /* Füllt die Kachelbreite perfekt aus */
    box-sizing: border-box;
    /* Wichtig: Padding wird in Breite einberechnet */
    margin-top: auto;
    /* Schiebt Button immer nach unten in der Kachel */
}

/* --- Mobile Optimierung für die Crew-Tabelle --- */
/*
@media (max-width: 600px) {
    table thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    tr { background: var(--color-bg-card); margin-bottom: 15px; padding: 15px; border-radius: 8px; border: 1px solid var(--color-border); }
    td { text-align: right; padding: 8px 0 !important; border-bottom: 1px solid #333; position: relative; }
    td::before { content: attr(data-label); float: left; font-weight: bold; color: var(--color-primary); }
    td:last-child { display: flex; flex-direction: column; gap: 10px; text-align: center; border-bottom: none; }
.logo a { font-size: 1.2em; }
}
*/
@media (max-width: 768px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
    }

    table thead {
        display: none;
    }

    /* Header verstecken */

    tr {
        background: var(--color-bg-card);
        margin-bottom: 15px;
        padding: 10px;
        border-radius: 8px;
        border: 1px solid var(--color-border);
    }

    td {
        display: flex;
        /* Label und Wert nebeneinander */
        justify-content: space-between;
        /* Label links, Wert rechts */
        align-items: center;
        padding: 8px 0 !important;
        border-bottom: 1px solid #333;
        text-align: right;
    }

    /* Das Label erscheint jetzt als Vorspann in der gleichen Zeile */
    td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--color-primary);
        margin-right: 10px;
    }

    /* Aktionen-Block: Buttons zentriert untereinander */
    td:last-child {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
        border-bottom: none;
    }
}

/* Ergänzung für mobile Optimierung */
@media (max-width: 600px) {
    .hero-section {
        padding: 40px 10px;
        background-size: contain;
        background-repeat: no-repeat;
    }

    .hero-title {
        font-size: 1.8em;
    }
}

/* --- Autocomplete für Formulare --- */
.autocomplete-items {
    position: absolute;
    border: 1px solid #333;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #222;
    max-height: 200px;
    overflow-y: auto;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #222;
    border-bottom: 1px solid #444;
    color: #fff;
}

.autocomplete-items div:hover {
    background-color: #333;
}

/* --- Utilities --- */
.opacity-low {
    opacity: 0.4;
    filter: grayscale(80%);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    main {
        padding: 15px !important;
    }
    .content-wrapper {
        padding: 15px !important;
        margin: 10px !important;
    }
    .logo img {
        height: 50px; /* Logo auf Handys etwas kleiner */
    }
    table.data-table, .table-responsive table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap; /* Verhindert das Zerquetschen von Tabellen auf Handys */
    }
    .dashboard-grid {
        grid-template-columns: 1fr; /* 1-spaltig auf kleinen Screens */
    }
    div[style*="display: flex"] {
        flex-wrap: wrap; /* Erlaubt Flex-Containern (wie in tours.php) den Umbruch */
    }
}