/* ===================================
   Dyslexia Accessibility Tools CSS
   =================================== */

/* OpenDyslexic Font Import */
@import url('https://fonts.cdnfonts.com/css/opendyslexic');

/* Accessibility Toggle Button */
.accessibility-toggle {
    position: fixed;
    bottom: 230px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.accessibility-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.accessibility-toggle::before {
    content: 'Aksesibilitas';
    position: absolute;
    right: 70px;
    background-color: #333;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.accessibility-toggle:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Accessibility Panel */
.accessibility-panel {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 320px;
    max-height: 70vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.accessibility-panel.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.accessibility-panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accessibility-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.accessibility-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.accessibility-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.accessibility-panel-body {
    padding: 20px;
    max-height: calc(70vh - 80px);
    overflow-y: auto;
}

.accessibility-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.accessibility-option:hover {
    background: #e9ecef;
}

.accessibility-option-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accessibility-option-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.accessibility-option-text h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.accessibility-option-text p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.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: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

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

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

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

.size-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #667eea;
    background: #fff;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.size-btn:hover {
    background: #667eea;
    color: #fff;
}

.size-btn.reset {
    font-size: 12px;
    width: auto;
    padding: 0 12px;
}

/* Reset All Button */
.accessibility-reset {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.accessibility-reset:hover {
    background: #c82333;
}

/* Reading Guide */
.reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 40px;
    background: rgba(255, 255, 0, 0.3);
    border-top: 2px solid #ffc107;
    border-bottom: 2px solid #ffc107;
    pointer-events: none;
    z-index: 9997;
    display: none;
}

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

/* ===================================
   Accessibility Mode Styles
   =================================== */

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

/* High Contrast Mode */
body.high-contrast {
    filter: contrast(1.4);
}

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

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

/* Increased Letter Spacing */
body.letter-spacing-increased * {
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}

/* Big Cursor */
body.big-cursor,
body.big-cursor * {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><polygon fill="%23000" points="0,0 0,24 6,18 12,28 16,26 10,16 18,16"/></svg>') 0 0, auto !important;
}

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

/* Font Size Classes */
body.font-size-1 { font-size: 90% !important; }
body.font-size-2 { font-size: 100% !important; }
body.font-size-3 { font-size: 110% !important; }
body.font-size-4 { font-size: 120% !important; }
body.font-size-5 { font-size: 130% !important; }
body.font-size-6 { font-size: 140% !important; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .accessibility-toggle {
        width: 50px;
        height: 50px;
        bottom: 220px;
        right: 15px;
        font-size: 20px;
    }
    
    .accessibility-toggle::before {
        display: none;
    }
    
    .accessibility-panel {
        width: calc(100% - 30px);
        right: 15px;
        bottom: 80px;
        max-height: 60vh;
    }
    
    .accessibility-option {
        padding: 12px;
    }
    
    .accessibility-option-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .accessibility-option-text h4 {
        font-size: 13px;
    }
    
    .accessibility-option-text p {
        font-size: 11px;
    }
}
