/* Accessibility Widget Styles */
.accessibility-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.accessibility-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #3498db;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    z-index: 10001;
}

.accessibility-toggle:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.accessibility-toggle:focus {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.accessibility-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border: 1px solid #e1e8ed;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 10002;
}

.accessibility-panel.active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.accessibility-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 15px;
    border-bottom: 1px solid #e1e8ed;
}

.accessibility-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.accessibility-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.accessibility-close:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.accessibility-close:focus {
    outline: 2px solid #3498db;
    outline-offset: 1px;
}

.accessibility-content {
    padding: 20px;
}

.accessibility-group {
    margin-bottom: 25px;
}

.accessibility-group:last-child {
    margin-bottom: 0;
}

.accessibility-group h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

/* Profile Options */
.profile-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.profile-option:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-icon {
    color: #6c757d;
    flex-shrink: 0;
}

.profile-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
}

.profile-desc {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Toggle Switches */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #3498db;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Setting Rows */
.setting-row {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.setting-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.setting-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2c3e50;
}

.setting-value {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* Sliders */
.slider-container {
    margin-top: 8px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.option-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.option-card:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.option-header svg {
    color: #6c757d;
}

.option-header span {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2c3e50;
}

.option-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    color: #2c3e50;
    cursor: pointer;
}

.option-select:focus {
    outline: 2px solid #3498db;
    border-color: #3498db;
}

.option-button {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.option-button:hover {
    background: #2980b9;
}

.option-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Footer */
.accessibility-footer {
    margin-top: 20px;
    padding: 16px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

.reset-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reset-button:hover {
    background: #5a6268;
}

.reset-button:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Accessibility States */

/* Disability Profiles */
body.a11y-blindness {
    /* Enhanced screen reader support with high contrast and large text */
    font-size: 1.8em !important;
    line-height: 2 !important;
    font-weight: bold !important;
    background: #000 !important;
    color: #fff !important;
}

body.a11y-blindness * {
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.a11y-blindness .accessibility-panel {
    background: #000 !important;
    border-color: #fff !important;
}

body.a11y-blindness .accessibility-toggle {
    background: #fff !important;
    color: #000 !important;
}

body.a11y-blindness .test-section {
    background: #1a1a1a !important;
    border-color: #fff !important;
}

body.a11y-blindness .color-box {
    border: 3px solid #fff !important;
}

body.a11y-blindness .test-button,
body.a11y-blindness .focus-test-elements button,
body.a11y-blindness .option-button {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}

body.a11y-visually-impaired {
    font-size: 1.3em !important;
    line-height: 1.6 !important;
    letter-spacing: 0.05em !important;
}

body.a11y-visually-impaired * {
    font-size: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

body.a11y-motor-impaired {
    /* Larger click targets and better keyboard navigation */
    cursor: pointer !important;
}

body.a11y-motor-impaired button, 
body.a11y-motor-impaired a, 
body.a11y-motor-impaired input,
body.a11y-motor-impaired select {
    min-height: 48px !important;
    min-width: 48px !important;
    padding: 16px !important;
    font-size: 1.1em !important;
    margin: 8px !important;
    border: 3px solid #3498db !important;
    border-radius: 8px !important;
}

body.a11y-motor-impaired .test-section {
    padding: 3rem !important;
    margin: 2rem 0 !important;
    border: 3px solid #3498db !important;
}

body.a11y-motor-impaired .color-box {
    min-height: 60px !important;
    min-width: 100px !important;
    padding: 20px !important;
    margin: 10px !important;
    border: 3px solid #000 !important;
    cursor: pointer !important;
}

body.a11y-motor-impaired .test-link {
    min-height: 44px !important;
    display: inline-block !important;
    padding: 12px 16px !important;
    margin: 8px !important;
    border: 2px solid #3498db !important;
    border-radius: 8px !important;
}

body.a11y-dyslexia {
    font-family: 'OpenDyslexic', 'Comic Sans MS', cursive !important;
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}

body.a11y-dyslexia * {
    font-family: inherit !important;
    letter-spacing: inherit !important;
    word-spacing: inherit !important;
}

body.a11y-cognitive-learning {
    /* Simplified interface with clear focus indicators */
}

body.a11y-cognitive-learning * {
    transition-duration: 0.5s !important;
    animation-duration: 0.5s !important;
}

body.a11y-cognitive-learning *:focus {
    outline: 4px solid #ff6b6b !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #fff, 0 0 0 8px #ff6b6b !important;
}

body.a11y-color-blind {
    /* Enhanced patterns and shapes for color blind users */
    filter: grayscale(100%) contrast(150%) !important;
}

body.a11y-color-blind * {
    text-decoration: underline !important;
    background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,0.1) 5px, rgba(255,255,255,0.1) 10px) !important;
}

body.a11y-color-blind .color-box {
    position: relative;
    overflow: hidden;
}

body.a11y-color-blind .color-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,0.3) 5px, rgba(255,255,255,0.3) 10px);
}

body.a11y-adhd {
    /* Reduced distractions and better focus management */
    background: #f8f9fa !important;
}

body.a11y-adhd * {
    animation: none !important;
    transition: none !important;
}

body.a11y-adhd .animated-elements {
    opacity: 0.3 !important;
}

body.a11y-adhd .blinking-text {
    animation: none !important;
    color: #666 !important;
}

body.a11y-adhd *:focus {
    outline: 4px solid #ff6b6b !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #fff, 0 0 0 8px #ff6b6b !important;
}

body.a11y-adhd .test-section {
    background: #fff !important;
    border: 2px solid #ff6b6b !important;
}

body.a11y-seizure-epileptic {
    /* Safe visual environment */
    filter: contrast(80%) brightness(90%) !important;
}

body.a11y-seizure-epileptic * {
    animation: none !important;
    transition: none !important;
}

body.a11y-seizure-epileptic .animated-elements,
body.a11y-seizure-epileptic .blinking-text,
body.a11y-seizure-epileptic .fake-gif {
    display: none !important;
}

body.a11y-seizure-epileptic video,
body.a11y-seizure-epileptic img[src*="gif"] {
    display: none !important;
}

body.a11y-seizure-epileptic .test-section {
    background: #f0f0f0 !important;
    border: 1px solid #ccc !important;
}

body.a11y-seizure-epileptic::after {
    content: '⚠️ Güvenli Görüntü Modu Aktif - Yanıp sönen içerik gizlendi';
    position: fixed;
    top: 10px;
    right: 10px;
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    border: 1px solid #ffeaa7;
}

/* Contrast Options */
body.a11y-high-contrast {
    background: #000 !important;
    color: #fff !important;
}

body.a11y-high-contrast * {
    background: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.a11y-high-contrast .accessibility-panel {
    background: #000 !important;
    border-color: #fff !important;
}

body.a11y-high-contrast .accessibility-toggle {
    background: #fff !important;
    color: #000 !important;
}

body.a11y-inverted-contrast {
    filter: invert(1) hue-rotate(180deg) !important;
}

body.a11y-inverted-contrast img,
body.a11y-inverted-contrast video {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Cursor Options */
body.a11y-large-cursor,
body.a11y-large-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 d="M2 2 L2 28 L12 20 L18 28 L22 26 L16 18 L28 18 L2 2 Z" fill="white" stroke="black" stroke-width="2"/></svg>') 2 2, auto !important;
}

body.a11y-extra-large-cursor,
body.a11y-extra-large-cursor * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path d="M3 3 L3 42 L18 30 L27 42 L33 39 L24 27 L42 27 L3 3 Z" fill="white" stroke="black" stroke-width="3"/></svg>') 3 3, auto !important;
}

/* Links Options */
body.a11y-highlighted-links a {
    background: #ffeb3b !important;
    color: #000 !important;
    padding: 2px 4px !important;
    border-radius: 2px !important;
}

body.a11y-underlined-links a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
}

/* Motion Options */
body.a11y-reduced-motion * {
    animation-duration: 0.1s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.1s !important;
}

body.a11y-paused-motion * {
    animation-play-state: paused !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Enhanced Focus Indicators */
body.a11y-motor-impaired *:focus,
body.a11y-cognitive-learning *:focus {
    outline: 3px solid #3498db !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 1px #fff !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .accessibility-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .accessibility-toggle {
        width: 50px;
        height: 50px;
    }
    
    .accessibility-panel {
        width: 300px;
        bottom: 70px;
        right: -50px;
    }
}

@media (max-width: 480px) {
    .accessibility-panel {
        width: 280px;
        right: -70px;
    }
}

/* Screen Reader Support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Animation for panel opening */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus trap styling */
.accessibility-panel:focus-within {
    outline: none;
}

/* High contrast mode media query support */
@media (prefers-contrast: high) {
    .accessibility-panel {
        border: 2px solid;
    }
    
    .accessibility-toggle {
        border: 2px solid;
    }
}

/* ==========================================================================
   Düzce Üniversitesi (duzce.edu.tr) uyarlamaları
   ========================================================================== */
.accessibility-widget { font-family: "Raleway", 'Segoe UI', Tahoma, sans-serif; }
.accessibility-toggle { background: #166EC6; }
.accessibility-toggle:hover { background: #003366; }
.accessibility-toggle:focus-visible { outline: 3px solid #003366; outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.accessibility-toggle svg { width: 32px; height: 32px; }

/* Panel küçük ekranlarda ekran dışına taşmasın */
@media (max-width: 768px) {
    .accessibility-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 80px;
        width: auto;
        max-height: calc(100vh - 110px);
    }
}

/* Satır yüksekliği ayarı (temada satır yükseklikleri px ile verildiği için) */
body.a11y-line-height .out-container,
body.a11y-line-height .out-container * {
    line-height: var(--a11y-line-height) !important;
} 
/* ==========================================================================
   Düzce Üniversitesi (duzce.edu.tr) uyarlamaları
   ========================================================================== */
.accessibility-toggle { background: #166EC6; }
.accessibility-toggle:hover { background: #003366; }
.accessibility-toggle:focus-visible { outline: 3px solid #003366; outline-offset: 3px; box-shadow: 0 0 0 3px #fff; }
.accessibility-toggle svg { width: 30px; height: 30px; }

/* Panel küçük ekranlarda ekran dışına taşmasın */
@media (max-width: 768px) {
    .accessibility-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 80px;
        width: auto;
        max-height: calc(100vh - 110px);
    }
}

/* Satır yüksekliği ayarı (temada satır yükseklikleri px ile verildiği için) */
body.a11y-line-height .out-container,
body.a11y-line-height .out-container * {
    line-height: var(--a11y-line-height) !important;
}
