/**
 * Search Highlight Styles
 * Styles for highlighting search terms on destination pages
 */

/* Search highlight mark */
.search-highlight {
    background-color: #ff9800;
    color: #000;
    padding: 0.1em 0.2em;
    border-radius: 2px;
    font-weight: inherit;
    font-style: inherit;
    transition: background-color 0.3s ease;
}

/* Current occurrence - brighter highlight */
.search-highlight-current {
    background-color: #ff6f00;
    box-shadow: 0 0 0 2px rgba(255, 111, 0, 0.3);
    font-weight: bold;
}

@keyframes highlightPulse {
    0%, 100% {
        background-color: #ff9800;
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
    }
    50% {
        background-color: #ff6f00;
        box-shadow: 0 0 0 8px rgba(255, 152, 0, 0);
    }
}

/* Hover effect */
.search-highlight:hover {
    background-color: #ff6f00;
}

/* Print styles - show highlights */
@media print {
    .search-highlight {
        background-color: #ffeb3b !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-highlight {
        background-color: #ff9800;
        color: #1a1a1a;
    }
    
    .search-highlight:hover {
        background-color: #ffa726;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .search-highlight {
        background-color: #ffff00;
        color: #000;
        border: 2px solid #000;
        font-weight: bold;
    }
}

/* Search Navigation Widget */
.search-nav-widget {
    position: fixed;
    top: 80px;
    left: 20px;
    background: white;
    border: 2px solid #007cba;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.search-nav-close {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.search-nav-close:hover {
    background: #c82333;
}

.search-nav-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.95rem;
    color: #333;
    min-width: 120px;
    justify-content: center;
}

.search-nav-label {
    color: #555;
    font-weight: 500;
}

.search-nav-current {
    font-weight: bold;
    color: #007cba;
    font-size: 1.1rem;
}

.search-nav-total {
    color: #666;
    font-weight: bold;
}

.search-nav-separator {
    color: #999;
    font-weight: bold;
    margin: 0 2px;
}

.search-nav-controls {
    display: flex;
    gap: 0.5rem;
}

.search-nav-prev,
.search-nav-next {
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.search-nav-prev:hover,
.search-nav-next:hover {
    background: #005a87;
}

.search-nav-prev:active,
.search-nav-next:active {
    transform: scale(0.95);
}

.search-nav-prev svg,
.search-nav-next svg {
    display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .search-nav-widget {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 0.6rem 0.8rem;
        gap: 0.75rem;
    }
    
    @keyframes slideInLeft {
        from {
            transform: translateX(-50%) translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
        }
    }
    
    .search-nav-info {
        font-size: 0.85rem;
        min-width: 70px;
    }
    
    .search-nav-current {
        font-size: 1rem;
    }
    
    .search-nav-prev,
    .search-nav-next {
        width: 28px;
        height: 28px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .search-nav-widget {
        animation: none;
    }
    
    .search-highlight {
        transition: none;
    }
    
    .search-nav-prev,
    .search-nav-next {
        transition: none;
    }
}
