
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #121212;
    color: white;
    font-family: Arial, sans-serif;
}

/* Grundlayout */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 5%;
    background: #202020;
    flex-wrap: wrap;
}

.topbar h1 {
    margin: 0;
}

.topbar form {
    display: inline-block;
    margin-left: 15px;
}

.login-container,
.voting-container {
    width: min(1000px, 92%);
    margin: 40px auto;
}

.login-container {
    max-width: 420px;
    padding: 30px;
    background: #252525;
    border-radius: 12px;
}

.admin-container {
    width: 90%;
    max-width: 1100px;
    margin: 40px auto;
}

/* Formulare */

input,
select {
    width: 100%;
    padding: 13px;
    margin: 8px 0 20px;
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 6px;
    font-size: 16px;
}

label {
    display: block;
    font-weight: bold;
    margin-top: 15px;
}

button,
.secondary-button {
    display: inline-block;
    padding: 12px 20px;
    border: 0;
    border-radius: 6px;
    background: #444;
    color: white;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.secondary-button:hover {
    background: #555;
}

.submit-button {
    background: #286b45;
}

.submit-button:hover {
    background: #348557;
}

.danger-button {
    background: #8d2929;
}

.danger-button:hover {
    background: #ad3636;
}

.inline-form {
    display: inline;
}

.login-back {
    text-align: center;
    margin-top: 20px;
}

/* Abstimmung */

.vote-card,
.admin-card {
    padding: 30px;
    margin: 25px 0;
    background: #252525;
    border-radius: 12px;
}

.vote-card h2 {
    margin-top: 0;
    font-size: 28px;
}

.vote-card .submit-button {
    width: 100%;
    margin-top: 15px;
}

.category-navigation {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    flex-wrap: wrap;
}

.category-list {
    flex: 1;
    min-width: 220px;
}

.category-counter {
    color: #aaa;
}

.arrow-navigation {
    display: flex;
    justify-content: space-between;
    margin: 25px 0;
}

.category-overview {
    margin-top: 40px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.category-tile {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 18px;
    background: #252525;
    color: white;
    border: 2px solid transparent;
    border-radius: 10px;
    text-decoration: none;
}

.category-tile:hover {
    background: #303030;
}

.category-tile.selected {
    border-color: #777;
}

.category-tile small {
    color: #aaa;
}

.category-tile.completed {
    border: 2px solid #35c759;
}

/* Adminbereich */

.admin-section {
    background: #252525;
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
}

.admin-section h2 {
    margin-top: 0;
}

.admin-section form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-section input,
.admin-section textarea {
    padding: 12px;
    border: 1px solid #555;
    border-radius: 5px;
    background: #181818;
    color: white;
    font: inherit;
}

.admin-section textarea {
    resize: vertical;
}

.admin-section button,
.admin-button {
    display: inline-block;
    width: fit-content;
    padding: 12px 20px;
    margin-top: 10px;
    border: none;
    border-radius: 5px;
    background: #555;
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.admin-section button:hover,
.admin-button:hover {
    background: #777;
}

.admin-section table {
    width: 100%;
    border-collapse: collapse;
}

.table-wrapper {
    overflow-x: auto;
}

/* Tabellen */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #444;
    text-align: left;
}

th {
    color: #bbb;
}

.result-category {
    margin: 25px 0;
}

.survey-comment {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    min-width: 180px;
    max-width: 400px;
}

/* Meldungen */

.success,
.error,
.notice {
    padding: 15px;
    margin: 15px 0;
    border-radius: 8px;
}

.success {
    background: #193b29;
    color: #b7ebc8;
}

.error {
    background: #4a2020;
    color: #ffc2c2;
}

.notice {
    background: #3e351c;
    color: #f5df9b;
}

.success-message {
    color: #80d080;
}

.error-message {
    color: #ff7777;
}

/* Umfrage */

.survey-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 25px;
    padding: 18px 22px;
    background: #252525;
    border: 1px solid #444;
    border-radius: 8px;
}

.survey-strip h3 {
    margin: 0 0 6px;
}

.survey-strip p {
    margin: 0;
    color: #bbb;
}

.survey-hint {
    color: #aaa;
    font-size: 0.9rem;
}

.survey-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
}

.survey-modal[hidden] {
    display: none;
}

.survey-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 10px;
    background: #252525;
}

.survey-modal-content h2 {
    margin-top: 0;
    padding-right: 25px;
}

.survey-modal-content p {
    color: #bbb;
    line-height: 1.5;
}

.survey-modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.survey-modal-content select,
.survey-modal-content textarea,
.survey-question textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #555;
    border-radius: 5px;
    background: #181818;
    color: white;
    font: inherit;
}

.survey-modal-content textarea,
.survey-question textarea {
    resize: vertical;
}

.survey-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: none;
    background: transparent;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

.survey-question {
    padding: 20px 0;
    border-bottom: 1px solid #444;
}

.survey-question h3 {
    margin-top: 0;
}

.survey-question > p {
    margin-bottom: 20px;
}
.survey-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    overflow-y: auto;
}

.survey-modal[hidden],
.survey-modal-content[hidden] {
    display: none !important;
}

.survey-modal-content {
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    padding: 30px;
    background: #222;
    border: 1px solid #444;
    border-radius: 12px;
    box-sizing: border-box;
}

.survey-intro {
    text-align: center;
}

.survey-intro p {
    line-height: 1.6;
    margin-bottom: 25px;
}

.survey-intro button {
    margin: 5px;
}

.rating-options {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
    margin: 12px 0 20px;
}

.rating-option {
    cursor: pointer;
}

.rating-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid #666;
    border-radius: 5px;
    background: #181818;
}

.rating-option input:checked + span {
    background: #666;
    border-color: white;
    color: white;
}

.rating-option input:focus-visible + span {
    outline: 2px solid white;
    outline-offset: 2px;
}

.survey-admin-question {
    margin: 20px 0;
    padding: 20px;
    background: #1b1b1b;
    border-radius: 8px;
}

.survey-admin-question p {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Navigation der einzelnen Umfragefragen */

.survey-progress {
    margin-top: 20px;
    color: #aaa;
    font-size: 0.9rem;
}

.survey-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 25px;
}

.survey-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #666;
    border-radius: 6px;
    background: #181818;
    color: white;
    text-decoration: none;
}

.survey-tab:hover {
    background: #444;
}

.survey-tab.active {
    border: 2px solid white;
    background: #444;
}

.survey-tab.completed {
    border-color: #35c759;
    background: #193b29;
}

.survey-tab.completed.active {
    border: 2px solid #35c759;
}

.survey-save {
    width: 100%;
    margin-top: 15px;
}

.survey-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}

.survey-navigation a,
.survey-navigation button {
    min-width: 110px;
    text-align: center;
}

@media (max-width: 420px) {
    .survey-navigation a,
    .survey-navigation button {
        min-width: 0;
        padding: 11px 15px;
    }

    .survey-tabs {
        gap: 6px;
    }

    .survey-tab {
        width: 34px;
        height: 34px;
    }
}

/* Responsive Darstellung */

@media (max-width: 700px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .vote-card,
    .admin-card {
        padding: 20px;
    }

    table {
        font-size: 14px;
    }

    th,
    td {
        padding: 8px;
    }
}

@media (max-width: 600px) {
    .survey-strip {
        align-items: flex-start;
        flex-direction: column;
    }

    .survey-modal-content {
        padding: 24px 18px;
    }

    .rating-options {
        gap: 3px;
    }

    .rating-option span {
        min-height: 34px;
        font-size: 0.85rem;
    }
}

@media (max-width: 420px) {
    .category-grid {
        grid-template-columns: 1fr;
    }
}
