/* Vollständige Styles für CollapsiblePdfPanel und PdfViewer als globales Stylesheet */

.as24-pdf-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 480px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    background: var(--mud-palette-surface);
    overflow: hidden;
    animation: as24-pdf-panel-enter 0.25s ease-out;
}

@keyframes as24-pdf-panel-enter {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.as24-pdf-panel__header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--mud-palette-primary) 6%, var(--mud-palette-surface));
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.as24-pdf-panel__title {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.as24-pdf-panel__filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.as24-pdf-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    display: flex;
}

.as24-pdf-panel__body > * {
    flex: 1 1 auto;
    min-width: 0;
}

.as24-pdf-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.as24-pdf-viewer__body {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: scroll;
    padding: 4px;
    cursor: grab;
    scrollbar-width: auto;
    scrollbar-color: auto;
}

.as24-pdf-viewer__body::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
}

.as24-pdf-viewer__body::-webkit-scrollbar-track {
    background: transparent;
}

.as24-pdf-viewer__body::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--mud-palette-text-primary) 30%, transparent);
    border: 2px solid transparent;
    border-radius: 6px;
    background-clip: padding-box;
}

.as24-pdf-viewer__body::-webkit-scrollbar-thumb:hover {
    background-color: color-mix(in srgb, var(--mud-palette-text-primary) 50%, transparent);
    background-clip: padding-box;
}

@supports not selector(::-webkit-scrollbar) {
    .as24-pdf-viewer__body {
        scrollbar-width: auto;
        scrollbar-color: color-mix(in srgb, var(--mud-palette-text-primary) 32%, transparent) transparent;
    }
}

.as24-pdf-viewer__body.as24-pdf-panning,
.as24-pdf-viewer__body.as24-pdf-panning * {
    cursor: grabbing !important;
    user-select: none !important;
}

.as24-pdf-viewer__canvas {
    display: block;
    min-width: 0;
    overflow: hidden;
}

.as24-pdf-viewer {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
}

.as24-pdf-viewer__toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
    border-bottom: 1px solid var(--mud-palette-lines-default);
    flex-shrink: 0;
}

.as24-pdf-viewer__page-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
}

.as24-pdf-viewer__page-total {
    color: var(--mud-palette-text-secondary);
    user-select: none;
}

.as24-pdf-viewer__zoom-label {
    min-width: 40px;
    text-align: center;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    color: var(--mud-palette-text-secondary);
    user-select: none;
}

.as24-pdf-viewer__search {
    flex: 1 1 auto;
    min-width: 80px;
    max-width: 220px;
    margin: 0 4px;
}

.as24-pdf-viewer__match-count {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    user-select: none;
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
}

.as24-pdf-viewer__match-count--none {
    color: color-mix(in srgb, var(--mud-palette-error) 70%, var(--mud-palette-text-secondary));
    font-style: italic;
}

.as24-pdf-viewer__body {
    background: color-mix(in srgb, var(--mud-palette-text-primary) 4%, var(--mud-palette-surface));
}

.as24-pdf-viewer__state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    gap: 8px;
}

.as24-pdf-viewer__canvas {
    display: block;
    overflow: hidden;
}

.as24-pdf-page {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: white;
    margin-bottom: 12px;
}

.as24-pdf-page .textLayer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 1;
    line-height: 1;
    text-size-adjust: none;
    forced-color-adjust: none;
    transform-origin: 0 0;
}

.as24-pdf-page .textLayer span,
.as24-pdf-page .textLayer br {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: grab;
    transform-origin: 0% 0%;
}

.as24-pdf-page .textLayer ::selection {
    background: color-mix(in srgb, var(--mud-palette-primary) 35%, transparent);
}

.as24-pdf-page .textLayer .as24-pdf-highlight {
    background: color-mix(in srgb, #D3F19E 60%, transparent);
    border-radius: 2px;
    color: transparent;
}

.as24-pdf-page .textLayer .as24-pdf-search-match {
    background: color-mix(in srgb, #FFEB3B 65%, transparent);
    border-radius: 2px;
    color: transparent;
    box-shadow: 0 0 0 1px color-mix(in srgb, #F59E0B 40%, transparent);
}

.as24-pdf-page .textLayer .as24-pdf-highlight.as24-pdf-search-match {
    background: color-mix(in srgb, #FFEB3B 80%, transparent);
}

.as24-pdf-page .textLayer .as24-pdf-search-match--active {
    background: color-mix(in srgb, #FF9800 75%, transparent) !important;
    box-shadow: 0 0 0 2px #F57C00, 0 0 12px 2px color-mix(in srgb, #FF9800 50%, transparent) !important;
    animation: as24-pdf-active-pulse 0.6s ease-out;
}

@keyframes as24-pdf-active-pulse {
    0%   { transform: scale(1.0); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1.0); }
}
