/**
 * Negishut Pro - Public Styles
 */

/* Widget Container - Force visibility */
#negishut-pro-widget {
    position: fixed !important;
    z-index: 2147483647 !important; /* Maximum z-index value */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.negishut-widget-right {
    right: 20px !important;
    bottom: 20px !important;
}

.negishut-widget-left {
    left: 20px !important;
    bottom: 20px !important;
}

/* Toggle Button */
.negishut-toggle {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 2147483647 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

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

.negishut-toggle:active {
    transform: scale(0.95);
}

/* Prevent accessibility features from affecting the widget itself */
#negishut-pro-widget,
#negishut-pro-widget *,
#negishut-widget-toggle,
#negishut-widget-toggle * {
    filter: none !important;
}

/* Widget Panel */
.negishut-panel {
    position: absolute;
    bottom: 70px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.negishut-widget-right .negishut-panel {
    right: 0;
}

.negishut-widget-left .negishut-panel {
    left: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

.negishut-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
}

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

/* Content */
.negishut-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.negishut-control {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.negishut-control:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.negishut-control label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.negishut-buttons {
    display: flex;
    gap: 8px;
}

.negishut-btn {
    flex: 1;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.negishut-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.negishut-btn-primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
    width: 100%;
}

.negishut-btn-primary:hover {
    background: #5568d3;
}

.negishut-checkbox {
    margin-right: 8px;
}

.negishut-control label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Footer */
.negishut-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.negishut-footer small {
    color: #999;
    font-size: 12px;
}

.negishut-footer a {
    color: #667eea;
    text-decoration: none;
}

.negishut-footer a:hover {
    text-decoration: underline;
}

/* Accessibility Features - Apply to all children except widget */
.negishut-high-contrast > *:not(#negishut-pro-widget) {
    filter: contrast(1.5) !important;
}

.negishut-dark-mode > *:not(#negishut-pro-widget) {
    filter: invert(1) hue-rotate(180deg) !important;
}

.negishut-dark-mode img,
.negishut-dark-mode video {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Ensure widget is never affected by filters */
#negishut-pro-widget,
#negishut-pro-widget *,
#negishut-widget-toggle,
#negishut-widget-toggle *,
#negishut-widget-panel,
#negishut-widget-panel * {
    filter: none !important;
    -webkit-filter: none !important;
}

.negishut-highlight-links a {
    background: yellow !important;
    padding: 2px 4px !important;
    border-radius: 2px !important;
}

.negishut-focus-mode *:focus {
    outline: 3px solid #667eea !important;
    outline-offset: 2px !important;
}

.negishut-line-height {
    line-height: 2 !important;
}

.negishut-line-height p,
.negishut-line-height li,
.negishut-line-height div {
    line-height: 2 !important;
}

/* Select Dropdown */
.negishut-select {
    width: 100%;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.negishut-select:hover,
.negishut-select:focus {
    background: #fff;
    border-color: #667eea;
    outline: none;
}

/* Scrollbar */
.negishut-content::-webkit-scrollbar {
    width: 6px;
}

.negishut-content::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.negishut-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.negishut-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .negishut-panel {
        width: 280px;
    }
    
    .negishut-widget-right,
    .negishut-widget-left {
        right: 10px;
        bottom: 10px;
        left: auto;
    }
}

/* Advanced Accessibility Features */

/* Dyslexia Friendly Font */
.negishut-dyslexia-font * {
    font-family: 'Comic Sans MS', 'OpenDyslexic', Arial, sans-serif !important;
    letter-spacing: 0.12em !important;
    word-spacing: 0.16em !important;
}

/* Letter Spacing */
.negishut-letter-spacing * {
    letter-spacing: 0.15em !important;
}

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

/* Hide Images */
.negishut-hide-images img,
.negishut-hide-images video,
.negishut-hide-images iframe {
    display: none !important;
}

/* Stop Animations */
.negishut-stop-animations *,
.negishut-stop-animations *::before,
.negishut-stop-animations *::after {
    animation: none !important;
    transition: none !important;
}

/* Highlight Headings */
.negishut-highlight-headings h1,
.negishut-highlight-headings h2,
.negishut-highlight-headings h3,
.negishut-highlight-headings h4,
.negishut-highlight-headings h5,
.negishut-highlight-headings h6 {
    background: #fff3cd !important;
    padding: 8px !important;
    border-left: 4px solid #667eea !important;
    margin: 12px 0 !important;
}

/* Reading Guide */
.negishut-reading-guide-line {
    position: fixed;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(102, 126, 234, 0.8);
    pointer-events: none;
    z-index: 2147483646;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    transition: top 0.1s ease;
}

/* Reading Mask */
.negishut-reading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2147483646;
}

.negishut-reading-mask::before,
.negishut-reading-mask::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.negishut-reading-mask::before {
    top: 0;
    height: calc(50% - 50px);
}

.negishut-reading-mask::after {
    bottom: 0;
    height: calc(50% - 50px);
}

/* Custom Cursors */
.negishut-cursor-large * {
    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 fill="white" stroke="black" stroke-width="1" d="M5,5 L5,25 L12,18 L16,28 L20,26 L16,16 L25,16 Z"/></svg>') 16 16, auto !important;
}

.negishut-cursor-extra-large * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><path fill="white" stroke="black" stroke-width="2" d="M8,8 L8,38 L18,27 L24,42 L30,39 L24,24 L38,24 Z"/></svg>') 24 24, auto !important;
}

/* Color Blind Filters */
.negishut-filter-protanopia > *:not(#negishut-pro-widget) {
    filter: url('#protanopia-filter') !important;
}

.negishut-filter-deuteranopia > *:not(#negishut-pro-widget) {
    filter: url('#deuteranopia-filter') !important;
}

.negishut-filter-tritanopia > *:not(#negishut-pro-widget) {
    filter: url('#tritanopia-filter') !important;
}

.negishut-filter-achromatopsia > *:not(#negishut-pro-widget) {
    filter: grayscale(100%) !important;
}

/* Inverted Contrast */
.negishut-inverted-contrast > *:not(#negishut-pro-widget) {
    filter: invert(1) hue-rotate(180deg) !important;
}

/* Keyboard Navigation Helper */
.negishut-keyboard-focus *:focus {
    outline: 4px solid #667eea !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.3) !important;
}

/* Text to Speech Highlight */
.negishut-tts-highlight {
    background: #ffeb3b !important;
    color: #000 !important;
    padding: 2px 4px !important;
    border-radius: 2px !important;
}

/* Voice Navigation Indicator */
.negishut-voice-listening {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 600;
    z-index: 2147483647;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}


