/* =====================================================
   NOCTIVARIS – EINHEITLICHES COMMUNITY-LAYOUT
   Grundstruktur nach dem funktionierenden Dashboard
   ===================================================== */

.wrap {
    width: min(1500px, 94%);
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
}

main.nv-community-shell {
    display: block;
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 30px 0 0 !important;
    box-sizing: border-box;
}

main.nv-community-shell > .wrap {
    margin-top: 0 !important;
}

/* Drei echte Spalten wie im Dashboard */
.nv-community-layout {
    display: grid;
    grid-template-columns: 215px minmax(0, 1fr) 215px;
    align-items: start;
    gap: 22px;
    width: 100%;
    margin: 0;
}

.nv-sidebar-left {
    grid-column: 1;
    min-width: 0;
}

.nv-community-center {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    padding-top: 0;
    margin-top: 0;
}

/* Der rechte Wrapper ist die dritte Grid-Spalte.
   Navigation und Gruppenverwaltung liegen darin untereinander. */
.nv-sidebar-right-stack {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-self: start;
    min-width: 0;
    width: 100%;
    position: sticky;
    top: 22px;
    gap: 14px;
}

.nv-community-sidebar {
    position: sticky;
    top: 22px;
    min-width: 0;
    width: 100%;
    padding: 18px 13px;
    box-sizing: border-box;
    background: linear-gradient(145deg, #17171f, #101015);
    border: 1px solid var(--line, rgba(255,255,255,.10));
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(0,0,0,.22);
}

/* Im rechten Wrapper übernimmt dieser das Sticky-Verhalten */
.nv-sidebar-right-stack > .nv-community-sidebar {
    position: static;
}

.nv-sidebar-right-stack > #group-management {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
    box-sizing: border-box;
}

/* Navigation */
.nv-sidebar-heading {
    margin: 2px 7px 15px;
    color: var(--red, #f04459);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.nv-side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    margin: 4px 0;
    padding: 10px 9px;
    color: #d9d5dd;
    text-decoration: none;
    font-size: 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: .2s ease;
}

.nv-side-link > span:first-child {
    width: 19px;
    flex: 0 0 19px;
    color: #f04459 !important;
    text-align: center;
    font-size: 16px;
}

.nv-side-link:hover {
    color: #fff;
    background: rgba(197,29,53,.10);
    border-color: rgba(197,29,53,.28);
}

.nv-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 5px;
    color: #fff;
    background: var(--red, #f04459);
    border-radius: 20px;
    font-size: 10px;
}

.nv-sidebar-admin-heading {
    margin-top: 25px;
    padding-top: 17px;
    border-top: 1px solid rgba(255,255,255,.07);
}

/* Tablet: rechte Navigation über die gesamte Breite */
@media (max-width: 1000px) {
    .nv-community-layout {
        grid-template-columns: 175px minmax(0, 1fr);
        gap: 16px;
    }

    .nv-sidebar-left {
        grid-column: 1;
    }

    .nv-community-center {
        grid-column: 2;
    }

    .nv-sidebar-right-stack {
        grid-column: 1 / -1;
        position: static;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .nv-sidebar-right-stack > .nv-community-sidebar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px;
        width: 100%;
    }

    .nv-sidebar-right .nv-sidebar-heading,
    .nv-sidebar-right .nv-sidebar-admin-heading {
        width: 100%;
    }

    .nv-sidebar-right .nv-side-link {
        flex: 1 1 160px;
    }
}

/* Smartphone: Reihenfolge wie im Dashboard */
@media (max-width: 700px) {
    .nv-community-layout {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .nv-community-center {
        order: 1;
        width: 100%;
    }

    .nv-sidebar-left {
        order: 2;
        width: 100%;
    }

    .nv-sidebar-right-stack {
        order: 3;
        position: static;
        width: 100%;
        align-self: stretch;
    }

    .nv-community-sidebar {
        position: static;
        width: 100%;
    }

    .nv-sidebar-right-stack > .nv-community-sidebar {
        display: block;
    }
}


/* =====================================================
   NOCTIVARIS – Einheitliche Überschriften-Box
   ===================================================== */

.nv-page-heading {
    position: relative;
    overflow: hidden;
    margin: 0 0 24px;
    padding: 25px 28px;
    background: linear-gradient(145deg, #191923, #101117);
    border: 1px solid rgba(197,29,53,.30);
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0,0,0,.24),
                0 0 25px rgba(197,29,53,.05);
}

.nv-page-heading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 70px;
    height: 2px;
    background: #f04459;
}

.nv-page-heading .nv-page-eyebrow {
    margin: 0 0 9px;
    color: #f04459;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.nv-page-heading h1 {
    margin: 0 0 9px;
    color: #f2f0f3;
    font-size: clamp(25px, 3vw, 35px);
    font-weight: 900;
    letter-spacing: 3px;
    line-height: 1.2;
}

.nv-page-heading h1 span {
    color: #f04459;
}

.nv-page-heading .nv-page-subtitle {
    margin: 0;
    color: #9999a7;
    font-size: 11px;
    letter-spacing: 1.5px;
    line-height: 1.6;
}

@media (max-width: 700px) {
    .nv-page-heading {
        padding: 20px 17px;
        margin-bottom: 18px;
    }

    .nv-page-heading h1 {
        letter-spacing: 2px;
    }
}

/* =====================================================
   NOCTIVARIS – Einheitliches Community-Grunddesign
   ===================================================== */

body:not(.nv-dashboard-page) {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(69,18,31,.72), transparent 48%),
        radial-gradient(ellipse at 100% 55%, rgba(25,13,22,.85), transparent 45%),
        #08090d !important;
    color: #eeeeee !important;
}

/* Überschriften auf allen Community-Seiten */
.nv-page-heading {
    background: linear-gradient(145deg, #191923, #101117) !important;
    border: 1px solid rgba(197,29,53,.30) !important;
}

.nv-page-heading h1 {
    color: #f2f0f3 !important;
}

.nv-page-heading h1 span {
    color: #f04459 !important;
}

.nv-page-heading .nv-page-eyebrow {
    color: #f04459 !important;
}

.nv-page-heading .nv-page-subtitle {
    color: #9999a7 !important;
}

/* Einheitlicher Abstand unter dem Kopfbereich */
main.nv-community-shell {
    padding-top: 30px !important;
    box-sizing: border-box;
}


/* Einheitlicher Abstand zwischen Header und Seiteninhalt */
body > header {
    margin-bottom: 0 !important;
}

/* =====================================================
   NOCTIVARIS – EINHEITLICHER HINTERGRUND
   ===================================================== */

body:not(.nv-dashboard-page) {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(69,18,31,.72), transparent 48%),
        radial-gradient(ellipse at 100% 55%, rgba(25,13,22,.85), transparent 45%),
        #08090d !important;
    background-color: #08090d !important;
}



/* =====================================================
   NOCTIVARIS – DASHBOARD WELCOME-LICHTEFFEKT
   ===================================================== */

.nv-page-heading {
    background:
        radial-gradient(ellipse at 50% -10%, rgba(197,29,53,.22), transparent 65%),
        linear-gradient(145deg, rgba(30,23,31,.98), rgba(13,14,20,.99)) !important;
    border: 1px solid rgba(197,29,53,.38) !important;
    box-shadow:
        0 18px 45px rgba(0,0,0,.32),
        0 0 35px rgba(197,29,53,.08),
        inset 0 1px 0 rgba(255,255,255,.07) !important;
}

.nv-page-heading::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #fff0f2, #ff405b, transparent);
    box-shadow: 0 0 14px 2px rgba(255,55,80,.55);
    animation: welcomeLight 4s ease-in-out infinite;
}

@keyframes welcomeLight {
    from { transform: translateX(-110%); }
    to   { transform: translateX(440%); }
}

@media (prefers-reduced-motion: reduce) {
    .nv-page-heading::before {
        animation: none;
    }
}

/* Kompakte Gruppenverwaltung in der rechten Sidebar */
.nv-sidebar-group-management {
    width: 100%;
    margin: 14px 0 0;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 8px;
}

.nv-sidebar-group-management h2 {
    margin: 0 0 12px;
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: .5px;
}

.nv-sidebar-group-management h3 {
    margin: 14px 0 8px !important;
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: .4px;
}

.nv-sidebar-group-management .comment {
    width: 100%;
    margin: 6px 0;
    padding: 8px;
    box-sizing: border-box;
    border-radius: 6px;
}

.nv-sidebar-group-management .comment-head {
    display: block;
    margin-bottom: 7px;
}

.nv-sidebar-group-management .comment-author,
.nv-sidebar-group-management .comment-date {
    display: block;
    font-size: 10px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.nv-sidebar-group-management .post-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nv-sidebar-group-management form {
    width: 100%;
    margin: 5px 0 0;
}

.nv-sidebar-group-management button {
    width: 100%;
    min-height: 29px;
    padding: 6px 5px;
    font-size: 9px;
    line-height: 1.3;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

.nv-sidebar-group-management .readonly-note {
    font-size: 10px;
    line-height: 1.5;
    padding: 7px;
}


/* Gruppenverwaltung optisch an die Community-Sidebars angleichen */
.nv-sidebar-group-management {
    background: linear-gradient(145deg, #17171f, #101015) !important;
    border: 1px solid var(--line, rgba(255,255,255,.10)) !important;
    border-radius: 10px !important;
    box-shadow: 0 12px 35px rgba(0,0,0,.22) !important;
    padding: 18px 13px !important;
    box-sizing: border-box;
}

.nv-sidebar-group-management h2 {
    margin: 2px 7px 15px !important;
    color: var(--red, #f04459) !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: 1.5px !important;
    line-height: 1.5;
}

/* Gruppenverwaltung: neutraler Rahmen wie die übrigen Sidebars */
.nv-sidebar-group-management {
    border: 1px solid var(--line, rgba(255,255,255,.10)) !important;
    outline: none !important;
    box-shadow: 0 12px 35px rgba(0,0,0,.22) !important;
}

/* Abstand zwischen rechter Navigation und Gruppenverwaltung */
.nv-sidebar-right-stack {
    position: sticky;
    top: 22px;
    align-self: start;
    min-width: 0;
    gap: 14px !important;
}

.nv-sidebar-right-stack > .nv-community-sidebar {
    position: static;
}

/* Sichtbarer Abstand zwischen den beiden rechten Boxen */
.nv-sidebar-right-stack > #group-management {
    margin-top: 0 !important;
}


/* Abstand zwischen Gruppenmitglied und Rollenbezeichnung */
.nv-sidebar-group-management .comment-date {
    margin-top: 5px !important;
}



/* NOCTIVARIS DASHBOARD COMMUNITY GRID V1 */

main.nv-dashboard-community-shell {
    width: min(1500px, 94%) !important;
    max-width: 1500px !important;
    padding: 46px 0 55px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}

main.nv-dashboard-community-shell > .wrap {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.nv-dashboard-community-layout {
    display: grid !important;
    grid-template-columns: 215px minmax(0, 1fr) 215px !important;
    align-items: start;
    gap: 22px !important;
    width: 100%;
}

.nv-dashboard-community-layout > .nv-sidebar-left {
    grid-column: 1;
    position: sticky;
    top: 22px;
    min-width: 0;
}

/* Dashboard: roter Rahmen nur um die linke Navigation */
.nv-dashboard-community-layout > .nv-sidebar-left .nv-community-sidebar {
    border: 1px solid var(--nv-red-border, rgba(197,29,53,.25));
}

.nv-dashboard-community-layout > .dashboard-center {
    grid-column: 2;
    min-width: 0;
    width: 100%;
}

.nv-dashboard-community-layout > .nv-sidebar-right-stack {
    grid-column: 3;
    position: sticky;
    top: 22px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    width: 100%;
}

.nv-dashboard-community-layout .nv-community-sidebar {
    position: static;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 18px 13px;
    background: linear-gradient(145deg, #17171f, #101015);
    border: 1px solid var(--nv-red-border, rgba(197,29,53,.25));
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(0,0,0,.22);
}

@media (max-width: 1000px) {
    .nv-dashboard-community-layout {
        grid-template-columns: 175px minmax(0, 1fr) !important;
        gap: 16px !important;
    }

    .nv-dashboard-community-layout > .nv-sidebar-left {
        grid-column: 1;
    }

    .nv-dashboard-community-layout > .dashboard-center {
        grid-column: 2;
    }

    .nv-dashboard-community-layout > .nv-sidebar-right-stack {
        grid-column: 1 / -1;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        width: 100%;
    }

    .nv-dashboard-community-layout > .nv-sidebar-right-stack > .nv-community-sidebar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px;
    }

    .nv-dashboard-community-layout .nv-sidebar-right .nv-sidebar-heading {
        width: 100%;
    }

    .nv-dashboard-community-layout .nv-sidebar-right .nv-sidebar-admin-heading {
        width: 100%;
    }

    .nv-dashboard-community-layout .nv-sidebar-right .nv-side-link {
        flex: 1 1 160px;
    }
}

@media (max-width: 700px) {
    main.nv-dashboard-community-shell {
        width: 92% !important;
        padding-top: 28px !important;
    }

    .nv-dashboard-community-layout {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 18px !important;
    }

    .nv-dashboard-community-layout > .dashboard-center {
        order: 1;
        width: 100%;
    }

    .nv-dashboard-community-layout > .nv-sidebar-left {
        order: 2;
        position: static;
        width: 100%;
    }

    .nv-dashboard-community-layout > .nv-sidebar-right-stack {
        order: 3;
        position: static;
        flex-direction: column;
        width: 100%;
    }

    .nv-dashboard-community-layout .nv-community-sidebar {
        position: static;
        width: 100%;
    }

    .nv-dashboard-community-layout > .nv-sidebar-right-stack > .nv-community-sidebar {
        display: block;
    }
}

/* NOCTIVARIS – Infoseiten: Breite an die mittlere Spalte anpassen */
.nv-legal-page {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 65px !important;
    box-sizing: border-box !important;
}

.nv-legal-page > .nv-legal-heading,
.nv-legal-page > .nv-legal-content-box {
    position: relative;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* Öffentliche Infoseiten */
.nv-legal-guest .nv-legal-page {
    width: min(1000px, calc(100% - 40px)) !important;
    max-width: 1000px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.nv-legal-guest .nv-public-guest {
    width: min(1000px, calc(100% - 40px)) !important;
    max-width: 1000px !important;
    margin: 0 auto 35px !important;
    padding: 24px 30px !important;
    box-sizing: border-box !important;
}

/* Dashboard: roter Rahmen direkt am linken Navigationselement */
.nv-dashboard-community-layout > aside.nv-sidebar-left.nv-community-sidebar {
    border: 1px solid rgba(197,29,53,.25) !important;
    border-radius: 10px;
}

/* Dashboard: roter Rahmen an der tatsächlichen linken Navigation */
.dashboard-layout > aside.nv-community-sidebar.nv-sidebar-left {
    border: 1px solid rgba(197,29,53,.25) !important;
    border-radius: 10px;
}


/* NOCTIVARIS: kompaktere Abstände der linken Navigation */
.nv-sidebar-left .nv-side-link {
    min-height: 37px !important;
    margin: 3px 0 !important;
    padding: 0 9px !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
}


/* NOCTIVARIS – Einheitliche rechte Navigation */
.nv-sidebar-right .nv-side-link {
    min-height: 34px !important;
    margin: 1px 0 !important;
    padding: 5px 8px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
}

.nv-sidebar-right .nv-sidebar-admin-heading {
    margin-top: 15px !important;
    padding-top: 10px !important;
}

/* NOCTIVARIS – Dashboard: rechte Navigation wie auf allen anderen Seiten */
.nv-dashboard-community-layout .nv-sidebar-right .nv-side-link {
    min-height: 34px !important;
    margin: 1px 0 !important;
    padding: 5px 8px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
}

.nv-dashboard-community-layout .nv-sidebar-right .nv-sidebar-admin-heading {
    margin-top: 15px !important;
    padding-top: 10px !important;
}


/* NOCTIVARIS PROFIL: linke Navigation beim Scrollen fixieren */
@media (min-width: 701px) {
    .nv-profile-page .nv-dashboard-community-layout > .nv-sidebar-left,
    .nv-member-page .nv-dashboard-community-layout > .nv-sidebar-left {
        position: sticky !important;
        top: 22px;
        align-self: start;
    }
}
