/* ===== SISTEMA DE DESTAQUE NA PÁGINA ===== */

/* Estilos base para highlights */
.page-highlight {
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: pointer;
}

/* Cores diferentes para múltiplos termos */
.page-highlight-0 {
    background: linear-gradient(135deg, #fff3c4 0%, #ffeaa7 100%);
    color: #2d3436;
    border: 1px solid #fdcb6e;
}

.page-highlight-1 {
    background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
    color: #2d3436;
    border: 1px solid #74b9ff;
}

.page-highlight-2 {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    color: #4a148c;
    border: 1px solid #ba68c8;
}

.page-highlight-3 {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.page-highlight-4 {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    color: #e65100;
    border: 1px solid #ff9800;
}

/* Highlight ativo (atual na navegação) */
.page-highlight.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border: 2px solid #d63031;
    box-shadow: 0 3px 8px rgba(214, 48, 49, 0.4);
    transform: scale(1.05);
    z-index: 10;
}

/* Hover effect */
.page-highlight:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Controles de navegação */
.page-highlight-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    z-index: 1000;
    font-family: var(--font-family);
    min-width: 280px;
    backdrop-filter: blur(10px);
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.highlight-info {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.highlight-count {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.highlight-terms {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-style: italic;
}

.highlight-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
}

.highlight-navigation button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.highlight-navigation button:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.highlight-navigation button:active {
    transform: scale(0.95);
}

.highlight-close {
    background: #e74c3c !important;
    margin-left: auto;
}

.highlight-close:hover {
    background: #c0392b !important;
}

.highlight-position {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 60px;
    text-align: center;
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
}

/* Dark mode support */
[data-theme="dark"] .page-highlight-controls {
    background: rgba(30, 30, 30, 0.95);
    border-color: #444;
}

[data-theme="dark"] .page-highlight-0 {
    background: linear-gradient(135deg, #3e2723 0%, #5d4037 100%);
    color: #ffecb3;
    border-color: #8d6e63;
}

[data-theme="dark"] .page-highlight-1 {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
    color: #e8eaf6;
    border-color: #3f51b5;
}

[data-theme="dark"] .page-highlight-2 {
    background: linear-gradient(135deg, #4a148c 0%, #6a1b9a 100%);
    color: #f3e5f5;
    border-color: #8e24aa;
}

[data-theme="dark"] .page-highlight-3 {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    color: #e8f5e8;
    border-color: #4caf50;
}

[data-theme="dark"] .page-highlight-4 {
    background: linear-gradient(135deg, #e65100 0%, #ff6f00 100%);
    color: #fff3e0;
    border-color: #ff9800;
}

/* Responsive design */
@media (max-width: 768px) {
    .page-highlight-controls {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        padding: 10px;
    }

    .highlight-info {
        text-align: center;
    }

    .highlight-navigation {
        justify-content: center;
    }

    .highlight-terms {
        font-size: 11px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .page-highlight,
    .page-highlight-controls {
        animation: none;
        transition: none;
    }

    .page-highlight:hover,
    .page-highlight.active {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .page-highlight {
        border-width: 2px;
        font-weight: 800;
    }

    .page-highlight.active {
        background: #000 !important;
        color: #fff !important;
        border: 3px solid #ff0000 !important;
    }
}

/* Print styles */
@media print {
    .page-highlight-controls {
        display: none;
    }

    .page-highlight {
        background: #ffff00 !important;
        color: #000 !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}