/* Стилі для системи доступності */

/* Кнопка налаштувань доступності */
.accessibility-toggle {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 9999;
    background: transparent;
    color: #ffffff;
    border: none;
    padding: 8px;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

/* Мобільні стилі для кнопки доступності */
@media (max-width: 768px) {
    .accessibility-toggle {
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        font-size: 18px;
        z-index: 10001; /* Вище за меню */
    }
}

.accessibility-toggle:hover {
    color: #4ade80;
    transform: translateY(-1px);
}

.accessibility-toggle:hover i {
    color: #4ade80;
}

.accessibility-toggle i {
    font-size: 20px;
    color: #ffffff;
}



/* Панель налаштувань (зверху справа) */
.accessibility-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: #0f1115;
    z-index: 10000;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    overflow-y: auto;
    border-left: 3px solid #4ade80;
}

.accessibility-panel.show {
    right: 0;
}

.accessibility-panel-header {
    background: #4ade80;
    color: #000000;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.accessibility-panel-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #000000;
}

.accessibility-panel-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #000000;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-panel-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.accessibility-panel-content {
    padding: 25px;
    background: #0f1115;
}

/* Секції налаштувань */
.accessibility-section {
    margin-bottom: 30px;
}

.accessibility-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #e7e9ee;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #232836;
}

/* Кнопки розміру тексту */
.text-size-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.text-size-btn {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #232836;
    background: #0f1115;
    color: #e7e9ee;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 16px;
}

.text-size-btn:hover {
    border-color: #4ade80;
    background: #1a1d23;
}

.text-size-btn.active {
    background: #4ade80;
    color: #000000;
    border-color: #4ade80;
}

/* Перемикачі */
.toggle-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #232836;
}

.toggle-switch:last-child {
    border-bottom: none;
}

.toggle-label {
    font-size: 16px;
    font-weight: 500;
    color: #e7e9ee;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #232836;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #9aa3b2;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4ade80;
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: #ffffff;
}

/* Кнопка повернення до стандартної версії */
.reset-button {
    width: 100%;
    padding: 15px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.reset-button:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Стилі для різних режимів доступності */
body.high-contrast {
    background: #000 !important;
    color: #fff !important;
}

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

body.high-contrast .navbar {
    background: #000 !important;
    border-bottom: 2px solid #fff !important;
}

body.high-contrast .card {
    background: #000 !important;
    border: 2px solid #fff !important;
}

body.grayscale {
    filter: grayscale(100%);
}

/* Збільшення тексту - застосовується тільки до основного контенту сайту */
body.large-text {
    font-size: 1.2em !important;
}

body.large-text * {
    font-size: inherit !important;
}

body.large-text h1, 
body.large-text h2, 
body.large-text h3, 
body.large-text h4, 
body.large-text h5, 
body.large-text h6 {
    font-size: 1.3em !important;
}

body.large-text p,
body.large-text span,
body.large-text div,
body.large-text a,
body.large-text li,
body.large-text td,
body.large-text th {
    font-size: 1.2em !important;
}

body.large-text .btn,
body.large-text button,
body.large-text input,
body.large-text textarea,
body.large-text select {
    font-size: 1.2em !important;
}

body.larger-text {
    font-size: 1.4em !important;
}

body.larger-text * {
    font-size: inherit !important;
}

body.larger-text h1, 
body.larger-text h2, 
body.larger-text h3, 
body.larger-text h4, 
body.larger-text h5, 
body.larger-text h6 {
    font-size: 1.5em !important;
}

body.larger-text p,
body.larger-text span,
body.larger-text div,
body.larger-text a,
body.larger-text li,
body.larger-text td,
body.larger-text th {
    font-size: 1.4em !important;
}

body.larger-text .btn,
body.larger-text button,
body.larger-text input,
body.larger-text textarea,
body.larger-text select {
    font-size: 1.4em !important;
}

/* Виключаємо панель налаштувань з збільшення тексту */
body.large-text .accessibility-panel,
body.larger-text .accessibility-panel {
    font-size: 14px !important;
}

body.large-text .accessibility-panel *,
body.larger-text .accessibility-panel * {
    font-size: inherit !important;
}

body.large-text .accessibility-panel h3,
body.larger-text .accessibility-panel h3 {
    font-size: 20px !important;
}

body.large-text .accessibility-panel h4,
body.larger-text .accessibility-panel h4 {
    font-size: 18px !important;
}

body.large-text .accessibility-panel .text-size-btn,
body.larger-text .accessibility-panel .text-size-btn {
    font-size: 16px !important;
}

body.large-text .accessibility-panel .toggle-label,
body.larger-text .accessibility-panel .toggle-label {
    font-size: 16px !important;
}

body.large-text .accessibility-panel .reset-button,
body.larger-text .accessibility-panel .reset-button {
    font-size: 16px !important;
}

/* Виключаємо кнопку налаштувань з збільшення тексту */
body.large-text .accessibility-toggle,
body.larger-text .accessibility-toggle {
    font-size: 12px !important;
    width: 36px !important;
    height: 36px !important;
}

body.large-text .accessibility-toggle i,
body.larger-text .accessibility-toggle i {
    font-size: 16px !important;
}

/* Адаптивність */
@media (max-width: 768px) {
    .accessibility-toggle {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .accessibility-panel {
        width: 100%;
        right: -100%;
    }
    
    .accessibility-panel-content {
        padding: 20px;
    }
    
    .text-size-buttons {
        flex-wrap: wrap;
    }
    
    .text-size-btn {
        min-width: 80px;
    }
}
