/* Style Switcher - MiN Accessibility Toolbar */
/* Bottom-left by default since Stefan-Entscheid 2026-09-06: house standard,
   mirrored against BackToTop (bottom-right), same --mincore-control-inset
   token (defined in Accessibility.css) so both edges never drift apart. */

.min-style-switcher {
    position: fixed;
    bottom: var(--mincore-control-inset, 1.5rem);
    left: var(--mincore-control-inset, 1.5rem);
    right: auto;
    z-index: 9999;
    font-family: system-ui, -apple-system, sans-serif;
}

.min-style-switcher--bottom-right {
    left: auto;
    right: var(--mincore-control-inset, 1.5rem);
}

.min-style-switcher--bottom-right .min-style-switcher__panel {
    left: auto;
    right: 0;
}

.min-style-switcher__trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #333;
    font-size: 1.25rem;
}

.min-style-switcher__trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.min-style-switcher__trigger:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Fix Bedienelemente (found 2026-09-06 against the real mincore probe page --
   reproduced only in the full page, not in an isolated markup snippet): this
   flex-centered trigger button's bare, unclassed <svg> collapsed to 0 width
   in Chromium once the extension-wide reset rule `svg { height: auto; }`
   (Global/base.css, framework/_reset.css) removed its intrinsic ratio while
   the default flex-item `min-width: auto`/`flex-shrink: 1` let it shrink
   away to nothing under the page's real layout constraints. Pinning size,
   min-size and flex-basis here reproduced correctly in every retest. */
.min-style-switcher__trigger svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    flex: 0 0 auto !important;
}

.min-style-switcher__trigger[aria-expanded="true"] {
    background: #2563eb;
    color: #fff;
}

.min-style-switcher__panel {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    left: 0;
    min-width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.min-style-switcher__panel[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.min-style-switcher__section {
    margin-bottom: 1rem;
}

.min-style-switcher__section:last-child {
    margin-bottom: 0;
}

.min-style-switcher__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.min-style-switcher__group {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    border-radius: 0.5rem;
    padding: 0.1875rem;
}

.min-style-switcher__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.min-style-switcher__btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #1e293b;
}

.min-style-switcher__btn:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.min-style-switcher__btn[aria-pressed="true"],
.min-style-switcher__btn.is-active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Font Size Icons */
.min-style-switcher__btn--font-sm { font-size: 0.75rem; }
.min-style-switcher__btn--font-md { font-size: 0.875rem; }
.min-style-switcher__btn--font-lg { font-size: 1.125rem; font-weight: 700; }

/* Dark Mode — global body/html styles */
html.mn-dark,
[data-theme="dark"] {
    background-color: var(--min-color-bg, #1a1a1a);
    color: var(--min-color-text, #e5e5e5);
}

html.mn-dark a,
[data-theme="dark"] a {
    color: var(--min-color-primary, #6dabf5);
}

/* High Contrast — global body/html styles */
html.mn-high-contrast {
    background-color: #000;
    color: #fff;
}

html.mn-high-contrast a {
    color: #ffff00;
}

/* Dark Mode — Style Switcher component */
html.mn-dark .min-style-switcher__trigger {
    background: rgba(30, 30, 30, 0.9);
    color: #e2e8f0;
}

html.mn-dark .min-style-switcher__panel {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
}

html.mn-dark .min-style-switcher__label {
    color: #94a3b8;
}

html.mn-dark .min-style-switcher__group {
    background: #1e293b;
}

html.mn-dark .min-style-switcher__btn {
    color: #cbd5e1;
}

html.mn-dark .min-style-switcher__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

html.mn-dark .min-style-switcher__btn[aria-pressed="true"],
html.mn-dark .min-style-switcher__btn.is-active {
    background: #334155;
    color: #f1f5f9;
}

/* High Contrast */
html.mn-high-contrast .min-style-switcher__panel {
    background: #000;
    border: 2px solid #fff;
    color: #fff;
}

html.mn-high-contrast .min-style-switcher__btn {
    color: #fff;
    border: 1px solid #fff;
}

html.mn-high-contrast .min-style-switcher__btn[aria-pressed="true"] {
    background: #fff;
    color: #000;
}

/* Sprachstufen CSS — targets EasytextContent partial classes */
html.mn-lang-normal .mincore-easytext__texter,
html.mn-lang-normal .mincore-easytext__easy { display: none !important; }
html.mn-lang-normal .mincore-easytext__normal { display: block !important; }

html.mn-lang-medium .mincore-easytext__normal,
html.mn-lang-medium .mincore-easytext__easy { display: none !important; }
html.mn-lang-medium .mincore-easytext__texter { display: block !important; }

html.mn-lang-easy .mincore-easytext__normal,
html.mn-lang-easy .mincore-easytext__texter { display: none !important; }
html.mn-lang-easy .mincore-easytext__easy { display: block !important; }

/* Default: show normal, hide variants (before JS loads) */
.mincore-easytext__normal { display: block; }
.mincore-easytext__texter,
.mincore-easytext__easy { display: none; }

/* Font Size Overrides */
html.mn-font-sm { font-size: 87.5%; }
html.mn-font-lg { font-size: 112.5%; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .min-style-switcher__panel,
    .min-style-switcher__trigger,
    .min-style-switcher__btn {
        transition: none;
    }
}

/* Print: Hide */
@media print {
    .min-style-switcher { display: none; }
}
