/**
 * Erişilebilirlik CSS
 * WCAG 2.2 Uyumluluğu
 */

/* ==================== SKIP LINK ==================== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color, #1e6b45);
    color: #ffffff !important;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0 0 8px 8px;
    z-index: 100000;
    transition: top 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--highlight-color, #e67e22);
    outline-offset: 2px;
}

/* ==================== ERİŞİLEBİLİRLİK ARAÇ ÇUBUĞU ==================== */
.accessibility-toolbar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.accessibility-toggle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: var(--primary-color, #1e6b45);
    color: #ffffff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.accessibility-toggle:hover,
.accessibility-toggle:focus {
    background: var(--primary-dark, #155a39);
    outline: 3px solid var(--highlight-color, #e67e22);
    outline-offset: 2px;
    width: 56px;
}

.accessibility-panel {
    position: absolute;
    left: 56px;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.accessibility-panel:not([hidden]) {
    opacity: 1;
    visibility: visible;
}

.accessibility-panel[hidden] {
    display: none;
}

.accessibility-header {
    background: var(--primary-color, #1e6b45);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accessibility-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.accessibility-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.accessibility-close:hover,
.accessibility-close:focus {
    background: rgba(255, 255, 255, 0.2);
    outline: 2px solid #ffffff;
}

.accessibility-body {
    padding: 20px;
    max-height: calc(80vh - 60px);
    overflow-y: auto;
}

.accessibility-group {
    margin-bottom: 20px;
}

.accessibility-group > label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 10px;
}

/* Yazı Boyutu Butonları */
.accessibility-buttons {
    display: flex;
    gap: 8px;
}

.acc-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.acc-btn:hover,
.acc-btn:focus {
    border-color: var(--primary-color, #1e6b45);
    background: #e8f5e9;
    outline: none;
}

.acc-btn:focus {
    box-shadow: 0 0 0 3px rgba(30, 107, 69, 0.3);
}

.acc-btn.active {
    background: var(--primary-color, #1e6b45);
    color: #ffffff;
    border-color: var(--primary-color, #1e6b45);
}

/* Kontrast Seçenekleri */
.accessibility-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.acc-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.95rem;
}

.acc-option:hover,
.acc-option:focus {
    border-color: var(--primary-color, #1e6b45);
    background: #f0f9f4;
    outline: none;
}

.acc-option[aria-pressed="true"] {
    background: var(--primary-color, #1e6b45);
    color: #ffffff;
    border-color: var(--primary-color, #1e6b45);
}

/* Toggle Switches */
.accessibility-toggles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.acc-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 0;
}

.acc-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.acc-toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.acc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.acc-toggle input:checked + .acc-toggle-slider {
    background: var(--primary-color, #1e6b45);
}

.acc-toggle input:checked + .acc-toggle-slider::before {
    transform: translateX(22px);
}

.acc-toggle input:focus + .acc-toggle-slider {
    box-shadow: 0 0 0 3px rgba(30, 107, 69, 0.3);
}

.acc-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #333;
}

/* Footer */
.accessibility-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
}

.acc-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f44336;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.acc-reset:hover,
.acc-reset:focus {
    background: #d32f2f;
    outline: 3px solid rgba(244, 67, 54, 0.5);
}

.acc-info-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--primary-color, #1e6b45);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.acc-info-link:hover,
.acc-info-link:focus {
    background: #f0f9f4;
    text-decoration: underline;
}

/* ==================== ERİŞİLEBİLİRLİK MODLARI ==================== */

/* Yüksek Kontrast Modu - Güçlendirilmiş */
body.high-contrast {
    --primary-color: #000000 !important;
    --secondary-color: #000000 !important;
    --text-color: #000000 !important;
    background: #ffffff !important;
    color: #000000 !important;
}

/* Tüm arka planları beyaz yap */
body.high-contrast *:not(.accessibility-toolbar):not(.accessibility-panel):not(.accessibility-header):not(.acc-option[aria-pressed="true"]):not(.acc-btn.active):not(.acc-toggle-slider) {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Tüm metinleri siyah yap */
body.high-contrast p,
body.high-contrast span,
body.high-contrast div,
body.high-contrast li,
body.high-contrast td,
body.high-contrast th,
body.high-contrast label,
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6,
body.high-contrast strong,
body.high-contrast b,
body.high-contrast i,
body.high-contrast em {
    color: #000000 !important;
    background-color: transparent !important;
}

/* Header ve navigasyon */
body.high-contrast header,
body.high-contrast .header,
body.high-contrast .main-header,
body.high-contrast .top-bar,
body.high-contrast nav,
body.high-contrast .navbar,
body.high-contrast .nav-item {
    background: #ffffff !important;
    color: #000000 !important;
}

/* Footer */
body.high-contrast footer,
body.high-contrast .footer,
body.high-contrast .main-footer {
    background: #ffffff !important;
    color: #000000 !important;
}

/* Linkler - mavi ve altı çizili */
body.high-contrast a {
    color: #0000ff !important;
    text-decoration: underline !important;
    background: transparent !important;
}

body.high-contrast a:hover,
body.high-contrast a:focus {
    color: #000080 !important;
    background: #ffff00 !important;
}

/* Butonlar - siyah kenarlık, beyaz arka plan */
body.high-contrast button,
body.high-contrast .btn,
body.high-contrast input[type="submit"],
body.high-contrast input[type="button"] {
    background: #ffffff !important;
    color: #000000 !important;
    border: 3px solid #000000 !important;
}

body.high-contrast button:hover,
body.high-contrast .btn:hover {
    background: #000000 !important;
    color: #ffffff !important;
}

/* Kartlar ve bölümler */
body.high-contrast .card,
body.high-contrast .section,
body.high-contrast section,
body.high-contrast article,
body.high-contrast aside {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

/* Form elementleri */
body.high-contrast input,
body.high-contrast select,
body.high-contrast textarea {
    background: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #000000 !important;
}

/* Mega menü ve dropdown */
body.high-contrast .mega-menu,
body.high-contrast .dropdown-menu,
body.high-contrast .submenu {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
}

body.high-contrast .mega-menu a,
body.high-contrast .dropdown-menu a,
body.high-contrast .dropdown-item {
    color: #0000ff !important;
    background: #ffffff !important;
}

body.high-contrast .mega-menu a:hover,
body.high-contrast .dropdown-item:hover {
    background: #ffff00 !important;
    color: #000000 !important;
}

/* Slider ve carousel */
body.high-contrast .slider,
body.high-contrast .carousel,
body.high-contrast .swiper,
body.high-contrast .owl-carousel {
    background: #ffffff !important;
}

/* Kenarlıklar */
body.high-contrast * {
    border-color: #000000 !important;
}

/* Görseller */
body.high-contrast img {
    filter: contrast(1.2) !important;
    border: 1px solid #000000 !important;
}

/* İkonlar */
body.high-contrast i,
body.high-contrast .bi,
body.high-contrast [class*="icon"] {
    color: #000000 !important;
}

/* Placeholder */
body.high-contrast ::placeholder {
    color: #666666 !important;
}

/* Koyu Mod */
body.dark-mode {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

body.dark-mode .card,
body.dark-mode .section,
body.dark-mode section {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}

body.dark-mode a {
    color: #6db3f2 !important;
}

body.dark-mode .main-header,
body.dark-mode .top-bar {
    background: #0d0d0d !important;
}

/* Koyu modda footer */
body.dark-mode footer,
body.dark-mode .footer,
body.dark-mode .main-footer {
    background: #0d0d0d !important;
}

body.dark-mode footer a,
body.dark-mode .footer a,
body.dark-mode .main-footer a {
    color: #6db3f2 !important;
}

/* Koyu modda sarı butonlar okunabilir kalsın */
body.dark-mode .btn-warning,
body.dark-mode .btn-yellow,
body.dark-mode [class*="btn-yellow"] {
    background: #ffc107 !important;
    color: #000000 !important;
}

/* Koyu modda paragraflar ve metinler */
body.dark-mode p,
body.dark-mode span:not(.badge),
body.dark-mode div:not(.btn):not(.badge),
body.dark-mode li,
body.dark-mode td,
body.dark-mode th,
body.dark-mode label {
    color: #e0e0e0 !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
    color: #ffffff !important;
}

/* Bağlantıları Vurgula */
body.highlight-links a:not(.btn):not(.acc-btn):not(.acc-option):not(.acc-reset):not(.accessibility-toggle):not(.accessibility-close) {
    background: #ffff00 !important;
    color: #000000 !important;
    padding: 2px 4px !important;
    text-decoration: underline !important;
    outline: 2px solid #000000 !important;
}

/* Footer'daki linkler için özel stil - sarı zemin üzerinde görünür olsun */
body.highlight-links footer a,
body.highlight-links .footer a,
body.highlight-links .main-footer a {
    background: #000000 !important;
    color: #ffff00 !important;
    padding: 2px 6px !important;
    text-decoration: underline !important;
    outline: 2px solid #ffff00 !important;
}

/* Sarı butonlar için ters kontrast */
body.highlight-links .btn-warning,
body.highlight-links .btn-yellow,
body.highlight-links [style*="background: #f"] a,
body.highlight-links [style*="background-color: #f"] a {
    background: #000000 !important;
    color: #ffff00 !important;
}

/* Okunabilir Font */
body.readable-font,
body.readable-font * {
    font-family: 'OpenDyslexic', 'Comic Sans MS', 'Arial', sans-serif !important;
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

/* Okunabilir font açıkken metin rengi korunsun */
body.readable-font p,
body.readable-font span,
body.readable-font div,
body.readable-font li,
body.readable-font td,
body.readable-font th,
body.readable-font label,
body.readable-font h1,
body.readable-font h2,
body.readable-font h3,
body.readable-font h4,
body.readable-font h5,
body.readable-font h6 {
    color: inherit !important;
}

/* Satır Aralığı Artır */
body.increased-line-height,
body.increased-line-height p,
body.increased-line-height li,
body.increased-line-height span {
    line-height: 2 !important;
}

/* Animasyonları Durdur - Menüler hariç */
body.stop-animations *:not(.dropdown-menu):not(.mega-menu):not(.submenu):not(.nav-dropdown):not([class*="dropdown"]):not([class*="menu"]),
body.stop-animations *::before,
body.stop-animations *::after {
    animation: none !important;
    animation-duration: 0s !important;
}

/* Transition'ı tamamen kaldırmak yerine çok kısa yap - menüler çalışsın */
body.stop-animations * {
    transition-duration: 0.01s !important;
    animation-duration: 0.01s !important;
}

/* Dropdown ve mega menüler normal çalışsın */
body.stop-animations .dropdown-menu,
body.stop-animations .mega-menu,
body.stop-animations .mega-menu-inner,
body.stop-animations .submenu,
body.stop-animations .nav-dropdown,
body.stop-animations [class*="dropdown"],
body.stop-animations .navbar-nav .dropdown-menu,
body.stop-animations .nav-item .dropdown-menu,
body.stop-animations .has-dropdown .mega-menu,
body.stop-animations .ebelediye-dropdown {
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease !important;
}

/* Hover durumları çalışsın */
body.stop-animations .nav-item:hover > .dropdown-menu,
body.stop-animations .nav-item:hover > .mega-menu,
body.stop-animations .has-dropdown:hover > .mega-menu,
body.stop-animations .dropdown:hover > .dropdown-menu,
body.stop-animations .has-submenu:hover > .submenu,
body.stop-animations .topbar-ebelediye:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Nav item hover için de */
body.stop-animations .nav-item.has-dropdown:hover .mega-menu {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Büyük İmleç */
body.large-cursor,
body.large-cursor * {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path fill="%23000" d="M5.5 3.21V20.8l4.58-4.59L13.5 23l2.5-1-3.42-6.77L18.21 15z"/></svg>'), auto !important;
}

/* Yazı Boyutu Değişkenleri */
body.font-size-small {
    font-size: 14px !important;
}

body.font-size-normal {
    font-size: 16px !important;
}

body.font-size-large {
    font-size: 18px !important;
}

body.font-size-xlarge {
    font-size: 20px !important;
}

body.font-size-xxlarge {
    font-size: 22px !important;
}

/* ==================== FOCUS GÖSTERGELERİ ==================== */
*:focus {
    outline: 3px solid var(--highlight-color, #e67e22) !important;
    outline-offset: 2px !important;
}

*:focus:not(:focus-visible) {
    outline: none !important;
}

*:focus-visible {
    outline: 3px solid var(--highlight-color, #e67e22) !important;
    outline-offset: 2px !important;
}

/* Buton ve Link Focus */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--highlight-color, #e67e22) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px rgba(230, 126, 34, 0.25) !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .accessibility-toolbar {
        bottom: 20px;
        top: auto;
        left: 20px;
        transform: none;
    }
    
    .accessibility-toggle {
        position: relative;
        transform: none;
        top: auto;
        border-radius: 50%;
        width: 56px;
        height: 56px;
    }
    
    .accessibility-panel {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 90px;
        top: auto;
        transform: none;
        width: auto;
        max-height: 70vh;
    }
}

/* ==================== PRINT ==================== */
@media print {
    .accessibility-toolbar,
    .skip-link {
        display: none !important;
    }
}
