/* Accessibility Toolbar Styles */
.accessibility-toggle {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    width: 60px !important;
    height: 60px !important;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4) !important;
    transition: all 0.3s ease !important;
    z-index: 10000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: auto !important;
    right: auto !important;
}


.accessibility-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.6);
}

.accessibility-toggle:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

.accessibility-toolbar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    transition: right 0.3s ease;
    z-index: 10001;
    overflow-y: auto;
    direction: rtl;
}

.accessibility-toolbar.visible {
    right: 0;
}

.toolbar-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #fff;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-toolbar {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-toolbar:hover {
    background: rgba(255,255,255,0.2);
}

.toolbar-content {
    padding: 2rem;
}

.toolbar-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.toolbar-section:last-child {
    border-bottom: none;
}

.toolbar-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.font-size-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.font-size-controls button {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.font-size-controls button:hover {
    background: #2980b9;
}

.font-size-display {
    font-weight: bold;
    color: #2c3e50;
    min-width: 50px;
    text-align: center;
}

.contrast-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contrast-controls button {
    background: #95a5a6;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.contrast-controls button:hover,
.contrast-controls button.active {
    background: #7f8c8d;
}

.display-controls,
.helper-controls,
.navigation-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.display-controls button,
.helper-controls button,
.navigation-controls button {
    background: #9b59b6;
    color: #fff;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.display-controls button:hover,
.helper-controls button:hover,
.navigation-controls button:hover {
    background: #8e44ad;
}

.reset-all {
    background: #e74c3c !important;
    width: 100%;
    padding: 1rem !important;
    font-size: 1.1rem;
}

.reset-all:hover {
    background: #c0392b !important;
}

/* Contrast modes */
.contrast-high {
    filter: contrast(150%) brightness(120%);
}

.contrast-inverted {
    filter: invert(1) hue-rotate(180deg);
}

/* Dark mode */
.dark-mode {
    background: #1a1a1a !important;
    color: #fff !important;
}

.dark-mode .accessibility-toolbar {
    background: #2c2c2c !important;
    color: #fff !important;
}

.dark-mode .toolbar-section {
    border-bottom-color: #444 !important;
}

/* Highlight links */
.highlight-links a {
    background: #ffff00 !important;
    color: #000 !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    text-decoration: underline !important;
}

/* Magnifier */
.magnifier {
    position: fixed;
    width: 200px;
    height: 200px;
    border: 3px solid #3498db;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10002;
    display: none;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(2px);
}

.magnifier.active {
    display: block;
}

.magnifier-content {
    padding: 1rem;
    font-size: 0.9rem;
    color: #333;
    height: 100%;
    overflow: hidden;
}

/* Reading guide */
.reading-guide {
    position: fixed;
    width: 2px;
    height: 100px;
    background: #e74c3c;
    pointer-events: none;
    z-index: 10002;
    display: none;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.reading-guide.active {
    display: block;
}

/* Medium mobile screens */
@media (max-width: 600px) {
    .accessibility-toggle {
        bottom: 12px !important;
        left: 12px !important;
        width: 45px !important;
        height: 45px !important;
        font-size: 1.1rem !important;
        top: auto !important;
        right: auto !important;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .accessibility-toolbar {
        width: 100%;
        right: -100%;
    }
    
    .accessibility-toggle {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.2rem !important;
        bottom: 15px !important;
        left: 15px !important;
        top: auto !important;
        right: auto !important;
    }
    
    .toolbar-content {
        padding: 1rem;
    }
    
    .font-size-controls {
        flex-wrap: wrap;
    }
    
    .contrast-controls {
        flex-direction: column;
    }
    
    .contrast-controls button {
        width: 100%;
    }
    
}

/* Extra small mobile screens */
@media (max-width: 480px) {
    .accessibility-toggle {
        bottom: 10px !important;
        left: 10px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 0.9rem !important;
        top: auto !important;
        right: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .accessibility-toolbar {
        border: 2px solid #000;
    }
    
    .toolbar-section {
        border-bottom-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .accessibility-toolbar,
    .accessibility-toggle,
    .magnifier,
    .reading-guide {
        transition: none;
    }
}
