/* Admin interface */
.admin-audio-player { display: none; }
.admin-page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    max-width: 100%;
}
.admin-page-heading .page-heading { margin-bottom: 0; }
.admin-logout-form { flex-shrink: 0; }
.admin-logout-button {
    padding: 8px 14px;
    background: #e8ddd0;
    border: 0;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    font-weight: 600;
}
.admin-logout-button:hover,
.admin-logout-button:focus-visible { background: #d8c8b8; }
.admin-notice { background: #d4edda; color: #155724; padding: 12px; border-radius: 6px; margin-bottom: 20px; }
.admin-login-wrap { max-width: 400px; margin: 60px auto; }
.admin-login-card { border: 2px solid #e8ddd0; padding: 30px; border-radius: 8px; background: #fafafa; }
.admin-login-title { margin-top: 0; color: #333; }
.admin-login-field { margin-bottom: 20px; }
.admin-login-label { display: block; margin-bottom: 8px; font-weight: 600; }
.admin-input-compact { width: 100%; padding: 10px; border: 2px solid #e8ddd0; border-radius: 6px; }
.admin-button-primary-wide { width: 100%; padding: 12px; background: #c97546; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.admin-tabs { display: flex; gap: 10px; margin-bottom: 30px; border-bottom: 2px solid #e8ddd0; padding-bottom: 10px; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.admin-muted { color: #8b7d71; }
.admin-list { display: flex; flex-direction: column; gap: 10px; }
.admin-theme-row { border: 2px solid #e8ddd0; padding: 12px; border-radius: 6px; background: #f9f9f9; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.admin-flex-grow { flex: 1; }
.admin-theme-edit-link { color: inherit; text-decoration: none; }
.admin-theme-edit-link:hover strong,
.admin-theme-edit-link:focus-visible strong { text-decoration: underline; }
.admin-theme-actions { display: flex; gap: 8px; }
.admin-inline-form { display: inline; }
.admin-theme-move-button { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; background: #e8ddd0; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.admin-theme-delete-button { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box; background: #ffcccc; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; }
.admin-add-link { display: inline-block; margin-top: 20px; padding: 10px 20px; background: #c97546; color: white; border-radius: 6px; text-decoration: none; }
.admin-collection-link { text-decoration: none; color: inherit; flex: 1; }
.admin-collection-count { color: #8b7d71; font-size: 14px; }
.admin-collection-actions { display: flex; gap: 4px; align-items: center; }
.admin-collection-move-button { width: 28px; height: 28px; padding: 0; background: #e8ddd0; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; }
.admin-collection-delete-button { width: 28px; height: 28px; padding: 0; background: #ffcccc; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; }
.admin-detail-heading { margin-bottom: 16px; }
.admin-theme-form { display: flex; flex-direction: column; gap: 8px; }
.admin-theme-field { display: flex; align-items: center; gap: 10px; }
.admin-theme-field-label { font-weight: 600; min-width: 110px; }
.admin-theme-input { flex: 1; padding: 8px; border: 2px solid #e8ddd0; border-radius: 6px; }
.admin-theme-field-description { display: flex; align-items: flex-start; gap: 10px; }
.admin-theme-field-label-offset { font-weight: 600; min-width: 110px; margin-top: 8px; }
.admin-theme-textarea { flex: 1; padding: 8px; border: 2px solid #e8ddd0; border-radius: 6px; min-height: 60px; }
.admin-form-actions { display: flex; gap: 10px; margin-top: 12px; }
.admin-form-primary { flex: 1; padding: 10px; background: #c97546; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.admin-form-secondary { flex: 1; padding: 10px; background: #e8ddd0; color: #333; border-radius: 6px; text-decoration: none; text-align: center; }
.admin-music-form { display: flex; flex-direction: column; gap: 16px; }
.admin-file-name { background: #f0f0f0; padding: 10px; border-radius: 6px; font-family: monospace; word-break: break-all; }
.admin-field-label { display: block; margin-bottom: 6px; font-weight: 600; }
.admin-field-label-with-button { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.admin-field-label-with-button .admin-field-label { margin-bottom: 0; }
.admin-code-textarea { width: 100%; padding: 10px; border: 2px solid #e8ddd0; border-radius: 6px; font-family: monospace; min-height: 80px; }
.admin-track-description-input { width: 100%; padding: 10px; border: 2px solid #e8ddd0; border-radius: 6px; font: inherit; line-height: 1.5; min-height: 96px; resize: vertical; }
.admin-button-primary { padding: 12px; background: #c97546; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; }
.admin-button-secondary { padding: 12px; background: #e8ddd0; color: #333; border-radius: 6px; text-decoration: none; text-align: center; }
.admin-track-heading { font-size: 18px; margin: 0 0 20px 0; }
.admin-track-list { display: flex; flex-direction: column; gap: 4px; }
.admin-track-info { flex: 1; min-width: 0; }
.admin-track-name { font-weight: 600; }
.admin-track-edit-link { display: block; color: inherit; text-decoration: none; }
.admin-track-edit-link:hover .admin-track-name,
.admin-track-edit-link:focus-visible .admin-track-name { text-decoration: underline; }
.admin-track-metadata { color: #8b7d71; margin-left: 6px; }
.admin-track-actions { display: flex; gap: 4px; flex-shrink: 0; }
.admin-track-action {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
}
.admin-track-play-button { background: #c97546; color: white; }
.admin-track-delete-button { background: #ffcccc; }

.admin-tab {
    padding: 10px 20px;
    background: #e8ddd0;
    color: #333;
    border-radius: 4px 4px 0 0;
    text-decoration: none;
    font-weight: 600;
}
.admin-tab.is-active { background: #c97546; color: white; }
.admin-collection-row {
    border: 2px solid #e8ddd0;
    padding: 12px;
    border-radius: 6px;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.admin-collection-row.is-selected { border-color: #c97546; background: #ffe8d6; }
.admin-track-row {
    border: 1px solid #e8ddd0;
    padding: 6px 8px;
    border-radius: 4px;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.admin-track-row.is-active { border-color: #d4edda; background: #f0f8f5; }
.admin-track-toggle.is-active { background: #d4edda; }
.admin-track-toggle.is-inactive { background: #e8ddd0; }
.admin-track-order-button {
    background: #e8ddd0;
}
.admin-track-order-button:disabled { cursor: not-allowed; opacity: 0.45; }
@media (min-width: 681px) and (hover: hover) {
    .admin-track-edit-link[data-description] { position: relative; }
    .admin-track-edit-link[data-description]:hover,
    .admin-track-edit-link[data-description]:focus-visible { z-index: 20; }
    .admin-track-edit-link[data-description]:hover::after,
    .admin-track-edit-link[data-description]:focus-visible::after {
        content: attr(data-description);
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        z-index: 21;
        width: max-content;
        max-width: min(360px, calc(100vw - 40px));
        padding: 10px 12px;
        border-radius: 5px;
        background: #333;
        color: #fff;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.45;
        white-space: normal;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        pointer-events: none;
    }
}
.admin-track-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}
.admin-track-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.admin-sync-form { margin: 0; }
.admin-sync-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    background: #e8ddd0;
    border: 0;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    line-height: normal;
    text-decoration: none;
}
.admin-sync-button:hover,
.admin-sync-button:focus-visible { background: #d8c8b8; }
.admin-collection-back { display: none; }

@media (max-width: 680px) {
    .admin-columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
    .admin-columns > * { min-width: 0; }
    .admin-columns.is-editing-theme .admin-theme-list-column { display: none; }
    .admin-columns.is-collection-detail .admin-collection-list-column { display: none; }
    .admin-track-toolbar { align-items: stretch; }
    .admin-sync-form,
    .admin-collection-back {
        flex: 0 0 calc((100% - 8px) / 2);
        min-width: 0;
    }
    .admin-sync-form { display: flex; }
    .admin-sync-form .admin-sync-button { width: 100%; box-sizing: border-box; }
    .admin-collection-back {
        display: inline-flex;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        white-space: normal;
    }
}

/* Beschreibungsvorschlag-Modal */
.admin-suggest-button {
    margin-left: 10px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-suggest-button:hover {
    background: #e8e8e8;
    border-color: #ccc;
}

.admin-suggest-button:active {
    background: #d0d0d0;
}

.admin-suggestion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Wenn display: flex inline gesetzt wird, verwende flex */
.admin-suggestion-modal[style*="display: flex"] {
    display: flex !important;
}

.admin-suggestion-modal-hidden {
    display: none !important;
}

.admin-suggestion-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-suggestion-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-suggestion-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.admin-suggestion-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.admin-suggestion-close:hover {
    background: #f5f5f5;
    color: #333;
}

.admin-suggestion-modal-body {
    padding: 20px;
    flex: 1;
}

.admin-suggestion-label {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

.admin-suggestion-text {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    line-height: 1.6;
    color: #333;
    font-size: 0.95rem;
}

.admin-suggestion-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.admin-button-primary,
.admin-button-secondary {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.admin-button-primary {
    background: #1976d2;
    color: white;
}

.admin-button-primary:hover {
    background: #1565c0;
}

.admin-button-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.admin-button-secondary:hover {
    background: #e0e0e0;
}

/* HTML Toolbar für Beschreibungen */
.admin-html-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #e8ddd0;
    border-radius: 4px;
}

.admin-html-btn {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.admin-html-btn:hover,
.admin-html-btn:focus-visible {
    background: #e8ddd0;
    border-color: #c97546;
}

/* Description Preview im Modal */
.admin-description-preview {
    background: #fff !important;
    color: #2a251e !important;
    border: 1px solid #f0ebe5 !important;
}

.admin-description-preview p {
    margin: 0 0 0.5em 0;
    color: #2a251e;
}

.admin-description-preview p:last-child {
    margin-bottom: 0;
}

.admin-description-preview strong {
    font-weight: 600;
    color: #2a251e;
}

.admin-description-preview em {
    font-style: italic;
    color: #2a251e;
}

.admin-description-preview h3,
.admin-description-preview h4,
.admin-description-preview h5 {
    margin: 0.5em 0 0.3em 0;
    font-size: 0.95rem;
    color: #2a251e;
}

.admin-description-preview ul,
.admin-description-preview ol {
    margin: 0.5em 0 0.5em 1.2em;
    padding: 0;
}

.admin-description-preview li {
    margin-bottom: 0.3em;
    color: #2a251e;
}

.admin-description-preview blockquote {
    margin: 0.5em 0;
    padding-left: 8px;
    border-left: 2px solid #c97546;
    color: #2a251e;
}

/* HTML-Editor Modal */
.admin-description-editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.admin-description-editor-modal.is-open {
    display: flex;
}

.admin-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.admin-modal-content {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    margin: auto;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 2px solid #e8ddd0;
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #8b7d71;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.admin-modal-close:hover {
    background: #f0ebe5;
    color: #333;
}

.admin-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-description-editor-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e8ddd0;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
}

.admin-description-editor-textarea:focus {
    outline: none;
    border-color: #c97546;
    box-shadow: 0 0 0 3px rgba(201, 117, 70, 0.1);
}

.admin-modal-preview-label {
    font-weight: 600;
    color: #333;
    margin-top: 8px;
}

.admin-description-editor-preview {
    background: #f9f9f9;
    border: 1px solid #e8ddd0;
    border-radius: 6px;
    padding: 16px;
    min-height: 100px;
    color: #2a251e;
    line-height: 1.6;
    overflow-y: auto;
    max-height: 250px;
}

.admin-description-editor-preview p {
    margin: 0 0 0.5em 0;
    color: #2a251e;
}

.admin-description-editor-preview p:last-child {
    margin-bottom: 0;
}

.admin-description-editor-preview strong {
    font-weight: 600;
    color: #2a251e;
}

.admin-description-editor-preview em {
    font-style: italic;
    color: #2a251e;
}

.admin-description-editor-preview h3,
.admin-description-editor-preview h4,
.admin-description-editor-preview h5 {
    margin: 0.5em 0 0.3em 0;
    font-size: 0.95rem;
    color: #2a251e;
}

.admin-description-editor-preview ul,
.admin-description-editor-preview ol {
    margin: 0.5em 0 0.5em 1.2em;
    padding: 0;
}

.admin-description-editor-preview li {
    margin-bottom: 0.3em;
    color: #2a251e;
}

.admin-description-editor-preview blockquote {
    margin: 0.5em 0;
    padding-left: 8px;
    border-left: 2px solid #c97546;
    color: #2a251e;
}

.admin-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 2px solid #e8ddd0;
    justify-content: flex-end;
}

.admin-modal-save-btn {
    padding: 10px 24px;
    background: #c97546;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-modal-save-btn:hover,
.admin-modal-save-btn:focus-visible {
    background: #b06a3f;
    outline: none;
}

.admin-modal-cancel-btn {
    padding: 10px 24px;
    background: #e8ddd0;
    color: #333;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-modal-cancel-btn:hover,
.admin-modal-cancel-btn:focus-visible {
    background: #d8c8b8;
    outline: none;
}

.admin-description-buttons {
    display: flex;
    gap: 8px;
}

.admin-edit-html-button {
    padding: 8px 12px;
    background: #c97546;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.admin-edit-html-button:hover,
.admin-edit-html-button:focus-visible {
    background: #b06a3f;
}

.admin-description-preview-box {
    background: #f9f9f9;
    border: 1px solid #e8ddd0;
    border-radius: 6px;
    padding: 12px;
    color: #2a251e;
    line-height: 1.6;
    min-height: 60px;
}

.admin-track-description-input-hidden {
    display: none;
}
