/* Grundlayout */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f5f7;
    color: #222;
}

label{
    font-size: 0.85rem;
    color: #4b5563;

}

/* Shell */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    
    background: #fff;
    color: #1f2933;
    padding: 1rem 2rem;
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.3rem;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.header-title-main {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.header-title-sub {
    font-size: 0.95rem;
    margin: 0.25rem 0 0;
    opacity: 0.9;
}

.header-logo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    height: 50px;
    width: 300px;
    object-fit: contain;
}

/* Header-Navigation / User-Menü */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    text-align: right;
}

.header-nav a {
    color: #e5e7eb;
    text-decoration: none;
    margin-left: 0.5rem;
}

.header-nav a:hover {
    text-decoration: underline;
}

/* User-Dropdown */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    cursor: pointer;
    font-size: 0.85rem;
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    margin-top: 0.35rem;
    min-width: 180px;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(15,23,42,0.15);
    padding: 0.4rem 0;
    z-index: 40;
}

.user-menu-dropdown a.link-plain {
    display: block;
    padding: 0.25rem 0.75rem;
    background: transparent;
    border-radius: 0;
    color: #6b7280;
}

.user-menu-dropdown a.link-plain:hover {
    background: #dcdddf;
}

.user-menu-dropdown hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 0.25rem 0;
}

/* Main / Content */
main {
    flex: 1;
    padding: 1rem;
}

.main-inner {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
    padding: 1rem;
}

/* Footer */
footer {
    background: #111827;
    color: #9ca3af;
    padding: 0.75rem 2rem;
    font-size: 0.85rem;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-inner a {
    color: #e5e7eb;
    text-decoration: none;
    margin-left: 1rem;
}

.footer-inner a:hover {
    text-decoration: underline;
}

/* Formulare / Inputs */
.main-inner form div {
    margin-bottom: 1rem;
}

.main-inner input[type="text"],
.main-inner input[type="email"],
.main-inner input[type="password"] {
    max-width: 18rem;
    width: 30%;
    padding: 0.25rem 0.4rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.main-inner select {
    max-width: 18rem;
    width: 30%;
    padding: 0.2rem 0.25rem;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    font-size: 0.8rem;
}

.main-inner input:focus,
.main-inner select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.main-inner button {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.25rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.main-inner button:hover {
    background: #1d4ed8;
}

/* Links im Contentbereich */
.main-inner a {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.85rem;
    text-decoration: none;
}

.main-inner a:hover {
    background: #dbeafe;
    text-decoration: underline;
}

/* neutrale Links (z.B. Logo, Breadcrumbs, Dropdown) */
header .header-nav a,
.footer-inner a,
.link-plain {
    padding: 0;
    border-radius: 0;
    background: transparent;
    font-size: inherit;
}

/* Breadcrumbs */
.breadcrumb {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.breadcrumb a {
    background: transparent;
    padding: 0;
}

.breadcrumb-sep {
    margin: 0 0.25rem;
}

.breadcrumb-current {
    font-weight: 500;
}

/* Fragen-Karten */
.question-card-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-card {
    position: relative;
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

.question-card-text {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 0.75rem 0;
}

.question-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.question-meta-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.8rem;
}

.question-meta-tags {
    font-size: 0.8rem;
    color: #4b5563;
}

.question-card-meta-toggle-row {
    margin-bottom: 0.35rem;
}

.meta-toggle-btn {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #4b5563;
    cursor: pointer;
}

.meta-toggle-btn:hover {
    background: #f3f4f6;
}

.question-card-meta.is-collapsed {
    display: none;
}


.question-card-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    background: #f9fafb;
}

.question-card-author {
    font-size: 0.85rem;
    color: #4b5563;
}

.question-card-author a {
    color: #1d4ed8;
    text-decoration: none;
}

.question-card-author a:hover {
    text-decoration: underline;
}

/* Aktionen rechtsbündig und dezent */
.question-card-actions {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.inline-form {
    display: inline;
}

.vote-btn,
.collection-btn {
    padding: 0.1rem 0.35rem;
    font-size: 0.75rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    cursor: pointer;
}

.vote-btn:hover,
.collection-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* „Aktiv“ nur dezent */
.vote-btn.is-active {
    background: #ffffff;
    color: #111827;
    border-color: #9ca3af;
}

/* Deaktiviert */
.vote-btn.disabled,
.collection-btn.disabled {
    opacity: 0.4;
    cursor: default;
    border-color: #e5e7eb;
    color: #9ca3af;
}

/* Ranking / Badge */
.question-card-rank {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.25rem 0 0.5rem 0;
}

.question-card-badge {
    position: absolute;
    top: -0.4rem;
    right: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #f97316;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
}

/* Fade-Effekt für Gäste auf Startseite */
.question-card-list.is-faded {
    position: relative;
    max-height: 420px;
    overflow: hidden;
}

.home-fade-overlay {
    margin-top: -80px;
    padding-top: 40px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(248,250,252,0), rgba(248,250,252,1));
}

/* Login-Layer */
.login-layer {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.login-layer[hidden] {
    display: none;
}

.login-layer-inner {
    background: #ffffff;
    padding: 1.5rem;
    max-width: 420px;
    width: 90%;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(15,23,42,0.3);
}

.login-layer-inner h3 {
    margin-top: 0;
}

.disabled-link {
    pointer-events: none;
    opacity: 0.5;
}

/* Filterbereich */
.questions-filter-bar {
    margin-bottom: 1rem;
}

.questions-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.filter-toggle {
    font-size: 0.85rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    cursor: pointer;
}

.filter-panel {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.filter-category + .filter-category {
    margin-top: 0.35rem;
}

.filter-cat-toggle {
    width: 100%;
    text-align: left;
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    cursor: pointer;
    font-size: 0.85rem;
}

.filter-cat-body {
    margin-top: 0.25rem;
    padding-left: 0.5rem;
}

.filter-option {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.15rem;
}

.filter-option input[type="checkbox"] {
    margin-right: 0.3rem;
}

.filter-actions {
    margin-top: 0.5rem;
}

.filter-hint {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Aktive Filter-Zeile */
.active-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.active-filters {
    font-size: 0.8rem;
    color: #4b5563;
}

.active-filters-reset a {
    font-size: 0.8rem;
    color: #dc2626;
}

.filter-pill {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.75rem;
    margin-right: 0.3rem;
    margin-bottom: 0.15rem;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .main-inner {
        padding: 0.75rem;
    }

    .question-card-list {
        gap: 0.6rem;
    }

    .question-card {
        padding: 0.6rem 0.7rem;
    }

    .question-card-text {
        font-size: 0.95rem;
    }

    .question-card-meta {
        gap: 0.15rem;
    }

    .question-card-footer {
        padding-top: 0.35rem;
        margin-top: 0.35rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .question-card-actions {
        flex-wrap: wrap;
        gap: 0.3rem;
        margin-left: 0;
        align-self: flex-end;
    }

    .vote-btn,
    .collection-btn {
        padding: 0.08rem 0.3rem;
        font-size: 0.7rem;
    }

    .questions-search-form {
        flex-direction: column;
        gap: 0.35rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }

    .main-inner a {
        padding: 0.1rem 0.4rem;
        font-size: 0.8rem;
    }

    .question-meta-chip {
        padding: 0.1rem 0.4rem;
        font-size: 0.75rem;
    }

    .filter-panel {
        padding: 0.5rem;
    }

    .filter-cat-toggle {
        font-size: 0.8rem;
        padding: 0.2rem 0.45rem;
    }

    .filter-option {
        font-size: 0.75rem;
    }

    .active-filters-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Override: Vote- und Set-Buttons dezent darstellen --- */
.vote-btn,
.collection-btn {
    padding: 0.1rem 0.35rem !important;
    font-size: 0.75rem !important;
    border-radius: 999px !important;
    border: 1px solid #d1d5db !important;
    background: #ffffff !important;   /* kein Blau */
    color: #4b5563 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 0.15rem;
    cursor: pointer;
}

.vote-btn:hover,
.collection-btn:hover {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
}

.vote-btn.is-active {
    background: #ffffff !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

.vote-btn.disabled,
.collection-btn.disabled {
    opacity: 0.4 !important;
    cursor: default !important;
    border-color: #e5e7eb !important;
    color: #9ca3af !important;
}


.collection-layer {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.collection-layer-hidden {
    display: none;
}

.collection-layer-inner {
    background: #ffffff;
    padding: 1.5rem;
    max-width: 480px;
    width: 90%;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(15,23,42,0.3);
}

.collection-layer {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.collection-layer-hidden {
    display: none;
}

.collection-layer-inner {
    background: #ffffff;
    padding: 1.5rem;
    max-width: 520px;
    width: 90%;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(15,23,42,0.3);
}

.collection-layer-inner h3 {
    margin-top: 0;
    margin-bottom: 0.25rem;
}

.collection-layer-hint {
    font-size: 0.85rem;
    color: #4b5563;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.collection-layer-section {
    margin-bottom: 0.75rem;
}

.collection-existing-list {
    max-height: 180px;
    overflow-y: auto;
    padding: 0.25rem 0.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
}

.collection-layer-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
