/* =====================================================================
   RideTree - Dark Theme, Mobile-First
   ===================================================================== */

:root {
    --bg: #0d0f12;
    --bg-elevated: #15181d;
    --bg-card: #1b1f26;
    --bg-input: #12151a;
    --border: #2a2f38;
    --text: #eef1f5;
    --text-muted: #9aa3af;
    --accent: #ff6a00;
    --accent-hover: #ff8a33;
    --danger: #e5484d;
    --success: #3ecf8e;
    --radius: 10px;
    --nav-height: 60px;
    --bottomnav-height: 64px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
p { line-height: 1.6; color: var(--text-muted); }

img { max-width: 100%; display: block; }

.page-content {
    min-height: calc(100vh - var(--nav-height) - var(--bottomnav-height));
    padding: 20px 16px calc(var(--bottomnav-height) + 24px);
    max-width: 1100px;
    margin: 0 auto;
}

/* --------------------------- Top / Bottom Nav --------------------------- */

.topnav {
    display: none;
}

.bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottomnav-height);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottomnav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.bottomnav__item i { font-size: 18px; }
.bottomnav__item.active { color: var(--accent); }

@media (min-width: 768px) {
    .bottomnav { display: none; }

    .topnav {
        display: block;
        height: var(--nav-height);
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .topnav__inner {
        max-width: 1100px;
        margin: 0 auto;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
    }

    .topnav__logo {
        color: var(--text);
        font-weight: 700;
        font-size: 18px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .topnav__logo i { color: var(--accent); }

    .topnav__links { display: flex; align-items: center; gap: 24px; }
    .topnav__links a { color: var(--text-muted); font-weight: 500; }
    .topnav__links a.active { color: var(--text); }
    .topnav__links a:hover { color: var(--text); }

    .topnav__cta {
        background: var(--accent);
        color: #fff !important;
        padding: 8px 18px;
        border-radius: 8px;
    }
    .topnav__cta:hover { background: var(--accent-hover); }

    .page-content { padding-bottom: 40px; min-height: calc(100vh - var(--nav-height) - 200px); }
}

/* --------------------------------- Footer -------------------------------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 16px calc(var(--bottomnav-height) + 24px);
    background: var(--bg-elevated);
}

@media (min-width: 768px) { .site-footer { padding: 32px 16px; } }

.site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 600px) {
    .site-footer__inner { flex-direction: row; justify-content: space-between; align-items: center; }
}

.site-footer__brand { font-weight: 700; }
.site-footer__brand i { color: var(--accent); margin-right: 6px; }
.site-footer__brand p { margin: 4px 0 0; font-size: 13px; }

.site-footer__links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer__links a { color: var(--text-muted); font-size: 14px; }
.site-footer__links a:hover { color: var(--text); }

.site-footer__copy {
    max-width: 1100px;
    margin: 16px auto 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* -------------------------------- Cookie Banner -------------------------------- */

.cookie-banner {
    position: fixed;
    bottom: calc(var(--bottomnav-height) + 12px);
    left: 12px;
    right: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    z-index: 200;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

@media (min-width: 768px) {
    .cookie-banner { bottom: 20px; left: auto; right: 20px; max-width: 380px; }
}

.cookie-banner p { font-size: 13px; margin: 0 0 12px; color: var(--text-muted); }

/* ---------------------------------- Buttons --------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

.btn--secondary { background: transparent; border-color: var(--border); color: var(--text); }
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { opacity: .9; }

.btn--small { padding: 8px 14px; font-size: 13px; }
.btn--block { width: 100%; }

/* ----------------------------------- Cards ----------------------------------- */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

/* ----------------------------------- Forms ------------------------------------ */

.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-row {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

@media (min-width: 640px) {
    .form-row--2 { flex-direction: row; }
    .form-row--2 > .form-group { flex: 1; }
}

.checkbox-item, .radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    cursor: pointer;
    font-size: 14px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

/* Honeypot-Feld für Bot-Schutz - für echte Nutzer unsichtbar */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ----------------------------------- Alerts ------------------------------------ */

.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alert--success { background: rgba(62,207,142,.1); border-color: var(--success); color: var(--success); }
.alert--error { background: rgba(229,72,77,.1); border-color: var(--danger); color: var(--danger); }
.alert--info { background: rgba(255,106,0,.08); border-color: var(--accent); color: var(--accent); }

/* ------------------------------------ Auth ------------------------------------- */

.auth-page {
    display: flex;
    justify-content: center;
    padding-top: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-card h1 { font-size: 22px; }
.auth-card__footer { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* ------------------------------------- Hero ------------------------------------ */

.hero {
    text-align: center;
    padding: 40px 0 24px;
}

.hero h1 { font-size: 30px; }
.hero p { font-size: 16px; max-width: 560px; margin: 0 auto 24px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (min-width: 768px) {
    .hero { padding: 64px 0 40px; }
    .hero h1 { font-size: 42px; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 32px 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 8px;
    text-align: center;
}

.stat-card__value { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat-card__label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 32px 0;
}

@media (min-width: 700px) {
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-card { text-align: center; }
.feature-card i { font-size: 28px; color: var(--accent); margin-bottom: 10px; }

/* ----------------------------------- Profile ----------------------------------- */

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .profile-header { flex-direction: row; text-align: left; }
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--bg-card);
}

.profile-name { font-size: 22px; font-weight: 700; }
.profile-username { color: var(--text-muted); font-size: 14px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px;
}

.badge--accent { border-color: var(--accent); color: var(--accent); }

.social-icons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.social-icons a {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
}
.social-icons a:hover { border-color: var(--accent); color: var(--accent); }

.motorrad-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.motorrad-gallery__item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--border);
}

.motorrad-gallery__item img { width: 100%; height: 100%; object-fit: cover; }

.motorrad-gallery__remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
}

.avatar-upload { display: flex; align-items: center; gap: 16px; }
.avatar-upload img {
    width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border);
}

/* ------------------------------------- Map -------------------------------------- */

#karte-map {
    width: 100%;
    height: 60vh;
    min-height: 380px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.map-popup { color: #1a1a1a; text-align: center; min-width: 160px; }
.map-popup img {
    width: 56px; height: 56px; border-radius: 50%; object-fit: cover; margin: 0 auto 6px;
}
.map-popup .map-popup__name { font-weight: 700; margin-bottom: 2px; }
.map-popup .map-popup__meta { font-size: 12px; color: #555; }

/* ----------------------------------- Ranking ------------------------------------ */

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ranking-table th, .ranking-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.ranking-table th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; }
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table .rank-pos { color: var(--accent); font-weight: 700; width: 32px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs a {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
}
.tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------------------- Admin ------------------------------------- */

.admin-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 900px) {
    .admin-layout { flex-direction: row; }
    .admin-sidebar { width: 220px; flex-shrink: 0; }
    .admin-content { flex: 1; min-width: 0; }
}

.admin-sidebar a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 4px;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--bg-card); color: var(--text); }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th, .admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.admin-table th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; }

.table-wrap { overflow-x: auto; }

.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
}
.status-pill--active { background: rgba(62,207,142,.15); color: var(--success); }
.status-pill--banned { background: rgba(229,72,77,.15); color: var(--danger); }

/* --------------------------------- Misc / Error page --------------------------------- */

.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 24px;
}
.error-page i { font-size: 48px; color: var(--accent); }

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }
