/* AccessTain Accessibility Widget Styles */

/* Widget Button */
.accessibility-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    z-index: 10000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.accessibility-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(52, 152, 219, 0.4);
}

.accessibility-widget-button:focus {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

/* Widget Panel */
.accessibility-widget-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 350px;
    max-height: 80vh;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(100%);
}

.accessibility-widget-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Panel Header */
.widget-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.widget-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

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

.widget-close:focus {
    outline: 2px solid #f39c12;
    outline-offset: 2px;
}

/* Panel Content */
.widget-content {
    padding: 20px;
    max-height: calc(80vh - 80px);
    overflow-y: auto;
}

/* Through My Eyes Button */
.through-my-eyes-btn {
    width: 100%;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.through-my-eyes-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.through-my-eyes-btn:focus {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

/* Feature Grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Feature Button */
.feature-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 80px;
    position: relative;
}

.feature-btn:hover {
    background: #e3f2fd;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.feature-btn:focus {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

.feature-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-color: #2980b9;
}

.feature-btn.active:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
}

/* Feature Icon */
.feature-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Feature Text */
.feature-text {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    color: inherit;
}

/* Text Size Levels Indicator */
.text-size-levels {
    position: absolute;
    bottom: 5px;
    right: 5px;
    display: flex;
    gap: 2px;
}

.text-size-level {
    width: 8px;
    height: 3px;
    background: #bdc3c7;
    border-radius: 1px;
}

.text-size-level.active {
    background: #e74c3c;
}

/* Reset Button */
.reset-btn {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.reset-btn:focus {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-modal.open {
    opacity: 1;
    visibility: visible;
}

.login-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.login-modal.open .login-content {
    transform: scale(1);
}

.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #7f8c8d;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-input {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.login-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.login-btn, .register-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.register-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.login-btn:hover, .register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cancel-btn {
    width: 100%;
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

/* Accessibility Enhancements */

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

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

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

body.high-contrast .accessibility-widget-button,
body.high-contrast .through-my-eyes-btn,
body.high-contrast .feature-btn.active {
    background: #ffffff !important;
    color: #000000 !important;
}

/* Smart Contrast */
body.smart-contrast {
    filter: contrast(150%);
}

/* Bigger Text Levels */
body.bigger-text-1 {
    font-size: 110% !important;
}

body.bigger-text-2 {
    font-size: 125% !important;
}

body.bigger-text-3 {
    font-size: 150% !important;
}

/* Text Spacing */
body.text-spacing {
    letter-spacing: 0.1em !important;
    word-spacing: 0.2em !important;
}

body.text-spacing * {
    letter-spacing: 0.1em !important;
    word-spacing: 0.2em !important;
}

/* Line Height */
body.line-height * {
    line-height: 2 !important;
}

/* Text Align */
body.text-align * {
    text-align: left !important;
}

/* Pause Animations */
body.pause-animations * {
    animation-play-state: paused !important;
    transition: none !important;
}

/* Hide Images */
body.hide-images img {
    display: none !important;
}

/* Dyslexia Friendly Font */
body.dyslexia-friendly * {
    font-family: 'Arial', 'OpenDyslexic', sans-serif !important;
}

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

/* Enhanced Cursor */
body.big-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 L10 20 L16 26 L20 22 L14 16 L22 16 Z" fill="black" stroke="white" stroke-width="2"/></svg>') 2 2, auto !important;
}

/* Enhanced Tooltips */
body.enhanced-tooltips [title]:hover::after {
    content: attr(title);
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 10003;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
}

/* Page Structure Highlighting */
body.page-structure h1,
body.page-structure h2,
body.page-structure h3,
body.page-structure h4,
body.page-structure h5,
body.page-structure h6 {
    outline: 3px solid #3498db !important;
    outline-offset: 2px !important;
    background: rgba(52, 152, 219, 0.1) !important;
}

body.page-structure nav {
    outline: 3px solid #e74c3c !important;
    outline-offset: 2px !important;
}

body.page-structure main {
    outline: 3px solid #27ae60 !important;
    outline-offset: 2px !important;
}

/* Saturation */
body.low-saturation {
    filter: saturate(0.5);
}

/* Dictionary Enhancement */
body.dictionary-mode strong,
body.dictionary-mode em {
    background: #fff3cd !important;
    color: #856404 !important;
    padding: 1px 3px !important;
    border-radius: 3px !important;
    cursor: help !important;
}

/* Screen Reader Enhancements */
.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;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .accessibility-widget-panel {
        width: 90%;
        right: 5%;
        left: 5%;
        max-height: 70vh;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-btn {
        min-height: 60px;
    }
    
    .login-content {
        width: 95%;
        padding: 20px;
    }
}

/* Focus Management */
.accessibility-widget-panel:focus-within {
    outline: none;
}

/* Smooth Scrolling */
.widget-content {
    scroll-behavior: smooth;
}

/* Loading States */
.feature-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.feature-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

