/* ===================================
   Accessibility Toolkit Pro - Styles
   =================================== */

/* Widget Button */
.atk-widget-button {
    position: fixed;
    z-index: 99999;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.atk-widget-button svg {
    width: 100%;
    height: 100%;
    display: block;
}

.atk-widget-button svg path {
    fill: #ffffff;
    transition: fill 0.3s ease;
}

/* Visueller Indikator wenn Features aktiv sind */
.atk-widget-button[data-ago-features-active="true"] {
    background: #00a32a;
    animation: pulse 2s infinite;
}

.atk-widget-button[data-ago-features-active="true"]::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: #00ff00;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: blink 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 163, 42, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 163, 42, 0.6);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.atk-widget-button:hover {
    transform: scale(1.1);
}

.atk-widget-button:hover svg path {
    fill: #ffffff;
}

.atk-widget-button:focus {
    outline: 3px solid #ff0;
    outline-offset: 2px;
}

/* Positionierung */
.atk-widget-button.bottom-right {
    bottom: 20px;
    right: 20px;
}

.atk-widget-button.bottom-left {
    bottom: 20px;
    left: 20px;
}

.atk-widget-button.top-right {
    top: 20px;
    right: 20px;
}

.atk-widget-button.top-left {
    top: 20px;
    left: 20px;
}

/* Widget Panel */
.atk-panel {
    position: fixed;
    z-index: 99998;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-width: 350px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}

.atk-panel.active {
    display: block;
}

.atk-panel.bottom-right {
    bottom: 90px;
    right: 20px;
}

.atk-panel.bottom-left {
    bottom: 90px;
    left: 20px;
}

.atk-panel.top-right {
    top: 90px;
    right: 20px;
}

.atk-panel.top-left {
    top: 90px;
    left: 20px;
}

/* Panel Header */
.atk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.atk-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.atk-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atk-close:hover {
    color: #000;
}

.atk-close:focus {
    outline: 2px solid #0066cc;
    border-radius: 4px;
}

/* Sections */
.atk-section {
    margin-bottom: 25px;
}

.atk-section h4 {
    font-size: 16px;
    margin: 0 0 12px 0;
    color: #333;
    font-weight: 600;
}

/* Buttons */
.atk-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.atk-btn {
    background: #f5f5f5;
    border: 2px solid #ddd;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 100px;
    justify-content: center;
}

.atk-btn:hover {
    background: #e8e8e8;
    border-color: #0066cc;
}

.atk-btn:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.atk-btn.active {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.atk-btn-icon {
    font-size: 18px;
}

/* Text Size Controls */
.atk-text-size {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
}

.atk-text-size button {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.atk-text-size button:hover {
    border-color: #0066cc;
    color: #0066cc;
}

.atk-text-size button:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.atk-text-size-value {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Reset Button */
.atk-reset {
    width: 100%;
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.atk-reset:hover {
    background: #c82333;
}

.atk-reset:focus {
    outline: 3px solid #dc3545;
    outline-offset: 2px;
}

/* Accessibility Modifications */

/* WICHTIG: CSS-Fallback-Regeln sind DEAKTIVIERT weil sie mit CSS Zoom kollidieren!
   Wenn Sie Font-Size Methode verwenden möchten, aktivieren Sie diese wieder. */

/* Text Size Classes - Nur als Marker, keine Styling-Effekte mehr
body.atk-text-large *:not(.atk-panel):not(.atk-panel *):not(.atk-widget-button):not(.atk-widget-button *) {
    font-size: 1.15em !important;
}

body.atk-text-xlarge *:not(.atk-panel):not(.atk-panel *):not(.atk-widget-button):not(.atk-widget-button *) {
    font-size: 1.3em !important;
}

body.atk-text-xxlarge *:not(.atk-panel):not(.atk-panel *):not(.atk-widget-button):not(.atk-widget-button *) {
    font-size: 1.5em !important;
}
*/

/* Verhindere, dass das Widget selbst skaliert wird */
body[style*="zoom"] .atk-widget-button,
body[style*="zoom"] .atk-panel,
body.atk-text-large .atk-widget-button,
body.atk-text-large .atk-panel,
body.atk-text-xlarge .atk-widget-button,
body.atk-text-xlarge .atk-panel,
body.atk-text-xxlarge .atk-widget-button,
body.atk-text-xxlarge .atk-panel {
    zoom: 1 !important;
    font-size: 14px !important;
}

/* Halte Widget-Text konstant */
.atk-panel,
.atk-panel *,
.atk-widget-button,
.atk-widget-button * {
    font-size: inherit !important;
}

.atk-panel {
    font-size: 14px !important;
}

.atk-panel h3 {
    font-size: 20px !important;
}

.atk-panel h4 {
    font-size: 16px !important;
}

.atk-btn {
    font-size: 14px !important;
}

/* High Contrast Mode */
body.atk-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.atk-high-contrast * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.atk-high-contrast a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

body.atk-high-contrast img {
    filter: contrast(1.2) brightness(1.1);
}

/* Dark Mode */
body.atk-dark-mode {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.atk-dark-mode * {
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.atk-dark-mode a {
    color: #66b3ff !important;
}

/* Light Mode */
body.atk-light-mode {
    background: #fff !important;
    color: #000 !important;
}

body.atk-light-mode * {
    background-color: #fff !important;
    color: #000 !important;
}

/* Monochrome Mode - Nur auf main content anwenden, nicht auf fixed Elemente */
body.atk-monochrome > *:not(.atk-widget-button):not(.atk-panel) {
    filter: grayscale(100%);
}

/* Wichtig: Widget immer vom Filter ausschließen und Position sichern */
.atk-widget-button,
.atk-panel {
    position: fixed !important;
    z-index: 99999 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* Extra Schutz für das Widget */
body.atk-monochrome .atk-widget-button,
body.atk-monochrome .atk-panel,
body.atk-high-contrast .atk-widget-button,
body.atk-high-contrast .atk-panel,
body.atk-dark-mode .atk-widget-button,
body.atk-dark-mode .atk-panel {
    position: fixed !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.atk-widget-button {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Highlight Links */
body.atk-highlight-links a {
    background: #ffff00 !important;
    color: #000 !important;
    padding: 2px 4px !important;
    text-decoration: underline !important;
    font-weight: bold !important;
}

/* Readable Font */
body.atk-readable-font,
body.atk-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Dyslexia Font */
body.atk-dyslexia-font,
body.atk-dyslexia-font * {
    font-family: 'Comic Sans MS', 'OpenDyslexic', sans-serif !important;
}

/* Line Height */
body.atk-line-height-normal * {
    line-height: 1.5 !important;
}

body.atk-line-height-large * {
    line-height: 2 !important;
}

body.atk-line-height-xlarge * {
    line-height: 2.5 !important;
}

/* Letter Spacing */
body.atk-letter-spacing-normal * {
    letter-spacing: normal !important;
}

body.atk-letter-spacing-wide * {
    letter-spacing: 0.05em !important;
}

body.atk-letter-spacing-xwide * {
    letter-spacing: 0.1em !important;
}

/* Big Cursor */
body.atk-big-cursor,
body.atk-big-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="black" stroke="white" stroke-width="2" d="M2 2 L2 26 L10 18 L14 28 L18 26 L14 16 L24 16 Z"/></svg>') 2 2, auto !important;
}

body.atk-big-cursor a,
body.atk-big-cursor button {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="blue" stroke="white" stroke-width="2" d="M16 2 L16 8 M16 24 L16 30 M2 16 L8 16 M24 16 L30 16 M6 6 L11 11 M21 21 L26 26 M26 6 L21 11 M11 21 L6 26"/></svg>') 16 16, pointer !important;
}

/* Keyboard Navigation Focus */
body.atk-keyboard-nav *:focus {
    outline: 4px solid #ff0 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.5) !important;
}

/* Hide Images */
body.atk-hide-images img {
    display: none !important;
}

/* Screen Reader Only */
.atk-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .atk-panel {
        max-width: 100%;
        width: calc(100% - 20px);
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
    }
    
    .atk-widget-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .atk-btn {
        min-width: calc(50% - 4px);
    }
}

/* Scrollbar für Panel */
.atk-panel::-webkit-scrollbar {
    width: 8px;
}

.atk-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.atk-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.atk-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Print Styles */
@media print {
    .atk-widget-button,
    .atk-panel {
        display: none !important;
    }
}
