:root {
    --brand: #af024c;
    --brand-dark: #850139;
    --brand-soft: #f8e7ef;
    --app-bg: #f4f6f9;
    --app-text: #1f2937;
    --app-border: #e2e7ee;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    color: var(--app-text);
}

.app-navbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 2px 12px rgba(31, 41, 55, 0.04);
    backdrop-filter: blur(12px);
}

.navbar-brand {
    color: var(--app-text);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: var(--brand);
}

.nav-link {
    color: #4b5563;
    font-weight: 600;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    color: var(--brand) !important;
}

.btn {
    border-radius: 0.65rem;
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: #d89ab5;
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
}

.page-title {
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    font-weight: 800;
    letter-spacing: -0.035em;
}

.app-card {
    overflow: hidden;
    border-radius: 1rem;
}

.topic-table thead th {
    padding: 0.9rem 1rem;
    background: #fafbfc;
    color: #5b6472;
    border-bottom: 1px solid var(--app-border);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    white-space: nowrap;
}

.topic-table tbody td {
    padding: 1rem;
    border-color: var(--app-border);
}

.topic-table tbody tr:last-child td {
    border-bottom: 0;
}

.topic-table tbody tr:hover {
    background: #fcfcfd;
}

.rank-column {
    width: 72px;
}

.score-column {
    width: 90px;
}

.action-column {
    min-width: 285px;
}

.topic-cell {
    min-width: 245px;
    max-width: 380px;
}

.period-cell {
    min-width: 140px;
    max-width: 220px;
}

.rank-number {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef1f5;
    color: #4b5563;
    font-size: 0.82rem;
    font-weight: 800;
}

.category-badge {
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid #efd0dd;
}

.type-badge {
    background: #eef1f5;
    color: #4b5563;
    border: 1px solid #e0e5eb;
}

.score-pill {
    display: inline-flex;
    min-width: 3.1rem;
    height: 2.45rem;
    padding: 0 0.65rem;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

button.score-pill:hover,
button.score-pill:focus-visible {
    border-color: currentColor;
    box-shadow: 0 4px 12px rgba(31, 41, 55, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.score-pill.static {
    cursor: default;
}

.score-4,
.score-5 {
    background: #dff3e8;
    color: #146c43;
}

.score-3 {
    background: #fff2cc;
    color: #765b00;
}

.score-0,
.score-1,
.score-2 {
    background: #fde7e5;
    color: #9b251f;
}

.topic-card-title {
    line-height: 1.45;
}

.topic-meta {
    padding-top: 0.85rem;
    border-top: 1px solid var(--app-border);
}

.empty-icon,
.brand-mark {
    display: grid;
    width: 3.3rem;
    height: 3.3rem;
    place-items: center;
    border-radius: 1rem;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 1.4rem;
    font-weight: 900;
}

.form-page-container {
    max-width: 760px;
}

.topic-input {
    min-height: 170px;
    resize: vertical;
}

.form-control {
    border-color: #cfd6df;
    border-radius: 0.7rem;
    padding: 0.8rem 0.9rem;
}

.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.25rem rgba(175, 2, 76, 0.12);
}

.back-link {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.login-page {
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at top left, rgba(175, 2, 76, 0.10), transparent 32rem),
        var(--app-bg);
}

.login-container {
    max-width: 470px;
}

.score-modal-dialog {
    max-width: 620px;
}

.modal-content {
    border-radius: 1rem;
}

.modal-header,
.modal-body,
.modal-footer {
    padding-left: 1.35rem;
    padding-right: 1.35rem;
}

.modal-header {
    padding-top: 1.35rem;
}

.modal-footer {
    padding-bottom: 1.35rem;
}

.modal-eyebrow {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.publish-period-box,
.reasoning-card {
    padding: 0.9rem 1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.8rem;
    background: #fafbfc;
}

.total-score-card {
    padding: 1rem;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #f8e7ef 0%, #fbf7f9 100%);
    border: 1px solid #efd0dd;
}

.total-score-value {
    display: inline-flex;
    min-width: 5.5rem;
    min-height: 3.4rem;
    align-items: baseline;
    justify-content: center;
    gap: 0.15rem;
    border-radius: 1rem;
    font-size: 1.65rem;
    font-weight: 900;
}

.total-score-value small {
    font-size: 0.72rem;
    font-weight: 800;
}

.score-progress {
    height: 0.55rem;
    background: #e7ebf0;
}

.score-progress .progress-bar {
    background: var(--brand);
    border-radius: 999px;
}

.alert {
    border-radius: 0.85rem;
}

@media (max-width: 767.98px) {
    .app-navbar .navbar-collapse {
        padding-bottom: 0.75rem;
    }

    .navbar-nav .nav-link {
        padding: 0.65rem 0;
    }
}

@media (max-width: 575.98px) {
    .score-modal-dialog {
        margin: 0.75rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }

    .total-score-card {
        align-items: flex-start !important;
    }

    .form-page-container .card-body {
        padding: 1.25rem !important;
    }
}

/* Produktionspaket */
.content-page-container {
    max-width: 1180px;
}

.content-page-title {
    max-width: 900px;
    font-size: clamp(1.65rem, 3.5vw, 2.35rem);
}

.content-stats-card {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--app-border);
    border-radius: 0.9rem;
    background: #fff;
    color: #5b6472;
    font-size: 0.86rem;
}

.content-stats-card strong {
    color: var(--app-text);
}

.content-empty-text {
    max-width: 650px;
}

.editor-section {
    overflow: visible;
}

.editor-label {
    color: #374151;
    font-weight: 800;
}

.script-editor {
    min-height: 760px;
    resize: vertical;
    font-size: 1.02rem;
    line-height: 1.7;
}

.description-editor {
    min-height: 330px;
    resize: vertical;
    line-height: 1.6;
}

.tags-editor {
    min-height: 230px;
    resize: vertical;
    line-height: 1.55;
}

.content-action-bar {
    position: sticky;
    bottom: 1rem;
    z-index: 20;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
}

@media (max-width: 767.98px) {
    .content-stats-card {
        width: 100%;
        justify-content: space-between;
    }

    .script-editor {
        min-height: 560px;
        font-size: 1rem;
    }

    .description-editor {
        min-height: 280px;
    }

    .tags-editor {
        min-height: 190px;
    }

    .content-action-bar {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .content-stats-card {
        gap: 0.65rem;
        font-size: 0.8rem;
    }

    .editor-section .card-body {
        padding: 1.15rem !important;
    }

    .script-editor {
        min-height: 500px;
    }
}

/* Kopierfunktionen im Produktionspaket */
.field-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.copy-button {
    flex: 0 0 auto;
    min-width: 5.6rem;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.copy-button.copy-success {
    color: #146c43;
    border-color: #75b798;
    background: #d1e7dd;
}

.copy-toast {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1090;
    max-width: min(90vw, 340px);
    padding: 0.8rem 1rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    background: #1f2937;
    border-radius: 0.8rem;
    box-shadow: 0 0.75rem 2rem rgba(17, 24, 39, 0.24);
    opacity: 0;
    pointer-events: none;
    transform: translateY(0.75rem);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 575.98px) {
    .field-heading {
        align-items: center;
        gap: 0.75rem;
    }

    .copy-button {
        min-width: auto;
    }

    .copy-toast {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        max-width: none;
        text-align: center;
    }
}
