/**
 * Accessibility Styles
 * Act2Vision Survey System
 */

/* Accessibility Widget Button */
.accessibility-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #e0990a;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.accessibility-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

.accessibility-toggle svg {
    width: 28px;
    height: 28px;
}

/* Accessibility Panel */
.accessibility-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s ease;
}

.accessibility-panel.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.accessibility-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accessibility-panel-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #121c44;
}

.accessibility-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    transition: color 0.2s;
}

.accessibility-panel-close:hover {
    color: #121c44;
}

.accessibility-panel-body {
    padding: 20px;
}

.accessibility-option {
    margin-bottom: 20px;
}

.accessibility-option:last-child {
    margin-bottom: 0;
}

.accessibility-option-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.accessibility-option-description {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 8px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

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

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

.toggle-switch input:checked + .toggle-slider {
    background-color: #e0990a;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Font Size Buttons */
.font-size-controls {
    display: flex;
    gap: 8px;
}

.font-size-btn {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    color: #374151;
}

.font-size-btn:hover {
    border-color: #e0990a;
    color: #e0990a;
}

.font-size-btn.active {
    background: #e0990a;
    border-color: #e0990a;
    color: white;
}

/* TTS Controls */
.tts-controls {
    display: flex;
    gap: 8px;
}

.tts-btn {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tts-btn:hover {
    border-color: #e0990a;
    color: #e0990a;
}

.tts-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tts-btn.speaking {
    background: #e0990a;
    border-color: #e0990a;
    color: white;
}

/* Font Size Classes */
body.font-size-small {
    font-size: 14px;
}

body.font-size-normal {
    font-size: 16px;
}

body.font-size-large {
    font-size: 18px;
}

body.font-size-xlarge {
    font-size: 22px;
}

/* High Contrast Mode */
body.high-contrast {
    background: #000000 !important;
    color: #ffffff !important;
}

body.high-contrast * {
    border-color: #ffffff !important;
}

body.high-contrast .card,
body.high-contrast .accessibility-panel {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

body.high-contrast .btn-primary {
    background: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #ffff00 !important;
}

body.high-contrast .btn-outline {
    background: transparent !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
}

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

body.high-contrast .text-navy,
body.high-contrast .text-gray-600,
body.high-contrast .text-gray-700,
body.high-contrast .text-gray-800,
body.high-contrast .text-gray-900 {
    color: #ffffff !important;
}

body.high-contrast .bg-gray-50,
body.high-contrast .bg-gray-100,
body.high-contrast .bg-gray-200 {
    background: #2a2a2a !important;
}

body.high-contrast input,
body.high-contrast textarea,
body.high-contrast select {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
}

body.high-contrast .likert-label {
    color: #ffffff !important;
}

body.high-contrast input[type="radio"]:checked + .likert-label {
    background: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

body.high-contrast .accessibility-toggle {
    background: #ffff00 !important;
    color: #000000 !important;
}

body.high-contrast .accessibility-panel-title {
    color: #ffffff !important;
}

body.high-contrast .accessibility-option-label {
    color: #ffffff !important;
}

body.high-contrast .accessibility-option-description {
    color: #cccccc !important;
}

body.high-contrast .font-size-btn,
body.high-contrast .tts-btn {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.high-contrast .font-size-btn.active,
body.high-contrast .tts-btn.speaking {
    background: #ffff00 !important;
    color: #000000 !important;
    border-color: #ffff00 !important;
}

/* Dark Mode Compatibility */
.dark .accessibility-panel {
    background: #1f2937;
    border: 1px solid #374151;
}

.dark .accessibility-panel-header {
    border-bottom-color: #374151;
}

.dark .accessibility-panel-title {
    color: #f3f4f6;
}

.dark .accessibility-panel-close {
    color: #9ca3af;
}

.dark .accessibility-panel-close:hover {
    color: #f3f4f6;
}

.dark .accessibility-option-label {
    color: #e5e7eb;
}

.dark .accessibility-option-description {
    color: #9ca3af;
}

.dark .font-size-btn,
.dark .tts-btn {
    background: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}

.dark .font-size-btn:hover,
.dark .tts-btn:hover {
    border-color: #e0990a;
}

.dark .font-size-btn.active,
.dark .tts-btn.speaking {
    background: #e0990a;
    border-color: #e0990a;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .accessibility-toggle {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }

    .accessibility-panel {
        bottom: 75px;
        right: 15px;
        left: 15px;
        width: auto;
    }
}

/* Reading Highlight for TTS */
.tts-highlight {
    background-color: #fef3c7 !important;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

/* Dark Mode TTS Highlight */
.dark .tts-highlight {
    background-color: #78350f !important;
    color: #ffffff !important;
}

body.high-contrast .tts-highlight {
    background-color: #ffff00 !important;
    color: #000000 !important;
}

/* Skip to Content Link (keyboard navigation) */
.skip-to-content {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background-color: #e0990a;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.skip-to-content:focus {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
}
