/* ============================================
   Painel de Acessibilidade
   ============================================ */

/* Botão Flutuante de Acessibilidade */
.accessibility-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-medium) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(1, 70, 65, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

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

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

.accessibility-icon {
    display: block;
}

/* Painel de Acessibilidade */
.accessibility-panel {
    position: fixed;
    bottom: 90px;
    left: 20px;
    width: 320px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.accessibility-header {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-medium) 100%);
    color: white;
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.accessibility-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.accessibility-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    line-height: 1;
}

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

.accessibility-content {
    padding: var(--spacing-md);
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.accessibility-content::-webkit-scrollbar {
    width: 6px;
}

.accessibility-content::-webkit-scrollbar-track {
    background: transparent;
}

.accessibility-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.accessibility-control {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.accessibility-control label {
    display: block;
    font-weight: 600;
    color: var(--green-dark);
    margin-bottom: var(--spacing-xs);
    font-size: 0.95rem;
}

.accessibility-control input[type="checkbox"] {
    margin-right: var(--spacing-xs);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Controles de Tamanho de Fonte */
.font-size-controls {
    display: flex;
    gap: var(--spacing-xs);
}

.font-size-btn {
    flex: 1;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--green-light);
    background: var(--green-lighter);
    color: var(--green-dark);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.font-size-btn:hover {
    background: var(--green-light);
    border-color: var(--green-medium);
}

.font-size-btn.active {
    background: var(--green-dark);
    color: white;
    border-color: var(--green-dark);
}

/* Controles de Leitura em Voz Alta */
.speech-controls {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.speech-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 2px solid var(--green-light);
    background: var(--green-lighter);
    color: var(--green-dark);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: left;
}

.speech-btn:hover {
    background: var(--green-light);
    border-color: var(--green-medium);
}

.speech-speed-control {
    margin-top: var(--spacing-sm);
}

.speech-speed-control label {
    font-size: 0.85rem;
    font-weight: 500;
}

.speech-speed-control input[type="range"] {
    width: 100%;
    margin-top: var(--spacing-xs);
    cursor: pointer;
}

/* Botão Reset */
.reset-btn {
    width: 100%;
    padding: var(--spacing-sm);
    border: 2px solid var(--gray);
    background: white;
    color: var(--gray);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.reset-btn:hover {
    background: var(--gray-light);
    border-color: var(--gray);
}

/* ============================================
   Modo Alto Contraste
   ============================================ */
body.high-contrast {
    background-color: #000000;
    color: #ffffff;
}

body.high-contrast .content-section {
    background-color: #1a1a1a;
    color: #ffffff;
    border: 2px solid #ffffff;
}

body.high-contrast .section-header h2,
body.high-contrast .highlight-text,
body.high-contrast .section-content {
    color: #ffffff;
}

body.high-contrast .sub-section {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-left: 4px solid #ffffff !important;
    border: 2px solid #ffffff;
}

body.high-contrast .sub-section-title {
    color: #ffeb3b !important;
    font-weight: 700;
}

body.high-contrast .sub-section p {
    color: #ffffff !important;
}

body.high-contrast .highlight-box {
    background: #2a2a2a !important;
    background-color: #2a2a2a !important;
    background-image: none !important;
    color: #ffffff !important;
    border-left: 5px solid #ffeb3b !important;
    border: 2px solid #ffffff !important;
    padding: var(--spacing-lg) !important;
}

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

body.high-contrast .highlight-box p {
    color: #ffffff !important;
    font-weight: 500 !important;
}

body.high-contrast .highlight-box strong {
    color: #ffeb3b !important;
    font-weight: 700 !important;
}

body.high-contrast .highlight-box .glossary-term {
    color: #ffeb3b !important;
    border-bottom: 2px dotted #ffeb3b !important;
}

body.high-contrast .highlight-box .glossary-term:hover {
    background-color: #3a3a3a !important;
}

body.high-contrast .highlight-box .glossary-tooltip {
    background-color: #000000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

body.high-contrast .highlight-box .glossary-tooltip::after {
    border-top-color: #000000 !important;
}

body.high-contrast .note-box {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-left: 5px solid #ffffff !important;
    border: 2px solid #ffffff;
}

body.high-contrast .note-box.important {
    background-color: #1a3a4a !important;
    border-left-color: #00bcd4 !important;
    color: #ffffff !important;
}

body.high-contrast .warning-box {
    background-color: #4a3a00 !important;
    border: 2px solid #ffeb3b !important;
    color: #ffffff !important;
}

body.high-contrast .warning-box p {
    color: #ffffff !important;
}

body.high-contrast .instruction-list li {
    color: #ffffff !important;
}

body.high-contrast .glossary-term {
    border-bottom: 2px dotted #ffeb3b !important;
    color: #ffeb3b !important;
}

body.high-contrast .glossary-tooltip {
    background-color: #000000 !important;
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
}

body.high-contrast .glossary-tooltip::after {
    border-top-color: #000000 !important;
}

body.high-contrast .nav-menu {
    background-color: #1a1a1a;
    border-bottom: 2px solid #ffffff;
}

body.high-contrast .nav-links a {
    color: #ffffff;
}

body.high-contrast .nav-links a.active {
    background-color: #ffffff;
    color: #000000;
}

body.high-contrast .contact-banner {
    background-color: #000000;
    border-bottom: 2px solid #ffffff;
}

body.high-contrast .main-header {
    background-color: #1a1a1a;
    border-bottom: 2px solid #ffffff;
}

body.high-contrast .header-title {
    color: #ffffff;
}

body.high-contrast .footer {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    border-top: 2px solid #ffffff;
}

/* ============================================
   Tamanhos de Fonte Aumentados
   ============================================ */
body.font-large {
    font-size: 125%;
}

body.font-large .content-section {
    font-size: 1.25rem;
}

body.font-large .section-header h2 {
    font-size: 1.875rem;
}

body.font-large .section-content {
    font-size: 1.25rem;
}

body.font-xlarge {
    font-size: 150%;
}

body.font-xlarge .content-section {
    font-size: 1.5rem;
}

body.font-xlarge .section-header h2 {
    font-size: 2.25rem;
}

body.font-xlarge .section-content {
    font-size: 1.5rem;
}

/* ============================================
   Modo Simplificado
   ============================================ */
body.simplified-mode .note-box:not(.important),
body.simplified-mode .warning-box,
body.simplified-mode .sub-section:not(:first-child) {
    display: none;
}

body.simplified-mode .instruction-list li {
    font-size: 1.1rem;
    padding: 0.8rem 0;
    padding-left: 2rem;
}

body.simplified-mode .instruction-list li::before {
    font-size: 1.5rem;
}

body.simplified-mode .section-content p:not(.highlight-text) {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ============================================
   Glossário - Tooltips
   ============================================ */
.glossary-term {
    position: relative;
    cursor: help;
    border-bottom: 2px dotted var(--green-dark);
    color: var(--green-dark);
    font-weight: 600;
}

.glossary-term:hover {
    background-color: var(--green-lighter);
}

.glossary-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--green-dark);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 10000;
    margin-bottom: 5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow: var(--shadow-md);
}

.glossary-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--green-dark);
}

.glossary-term:hover .glossary-tooltip {
    opacity: 1;
    pointer-events: all;
}

/* Destaque de texto sendo lido */
.reading-highlight {
    background-color: #ffeb3b !important;
    color: #000000 !important;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

/* ============================================
   Responsividade
   ============================================ */
@media (max-width: 768px) {
    .accessibility-toggle {
        bottom: 15px;
        left: 15px;
        width: 56px;
        height: 56px;
        font-size: 1.6rem;
    }
    
    .accessibility-panel {
        width: calc(100vw - 30px);
        bottom: 80px;
        left: 15px;
        max-height: calc(100vh - 100px);
    }
    
    .accessibility-content {
        max-height: calc(100vh - 180px);
    }
}

