/* Search in Diff - Modal and Highlighting */

/* Search modal overlay */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.search-modal {
    background: var(--color-bg-secondary);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease;
}

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

/* Header */
.search-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--color-fox-orange);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.search-modal-close:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-primary);
}

/* Body */
.search-modal-body {
    padding: 1.5rem;
}

.search-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.search-input-group .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text-primary);
    font-size: 1rem;
    font-family: var(--font-family-mono);
    transition: all 0.2s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--color-fox-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.search-results-count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 600;
    pointer-events: none;
}

/* Search options */
.search-options {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.search-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.search-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--color-fox-orange);
}

.search-option:hover {
    color: var(--color-text-primary);
}

/* Search scope */
.search-scope {
    margin-bottom: 1.25rem;
}

.search-scope > label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
}

.search-scope-buttons {
    display: flex;
    gap: 0.5rem;
}

.search-scope-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.search-scope-btn:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-fox-orange);
}

.search-scope-btn.active {
    background: var(--color-fox-orange);
    border-color: var(--color-fox-orange);
    color: white;
}

/* Hint */
.search-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-hint kbd {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    padding: 0.125rem 0.375rem;
    font-family: var(--font-family-mono);
    font-size: 0.75rem;
}

/* Footer */
.search-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
}

.search-nav-buttons {
    display: flex;
    gap: 0.5rem;
}

.search-modal-footer .btn {
    padding: 0.5rem 1rem;
}

/* Search highlights in diff */
.search-highlight {
    background: rgba(255, 193, 7, 0.3);
    border-radius: 2px;
    padding: 0 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.search-highlight-current {
    background: var(--color-fox-orange);
    color: white;
    font-weight: 600;
    animation: searchPulse 0.5s ease;
}

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

/* Mobile responsive */
@media (max-width: 768px) {
    .search-modal {
        width: 95%;
        max-width: none;
    }

    .search-modal-header h3 {
        font-size: 1.125rem;
    }

    .search-options {
        flex-direction: column;
        gap: 0.75rem;
    }

    .search-scope-buttons {
        flex-direction: column;
    }

    .search-modal-footer {
        flex-direction: column;
        gap: 1rem;
    }

    .search-nav-buttons {
        width: 100%;
    }

    .search-nav-buttons .btn {
        flex: 1;
    }
}
