/* Search Component Styles */

/* Shortcut Search - Con fondo sutil pero visible */
.shortcut-search {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    background: rgba(0, 0, 0, 0.3);
}

.shortcut-search.show {
    opacity: 1;
    visibility: visible;
}

.search-container {
    padding: 1.5rem 2rem 1rem 2rem;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border-primary);
    background: var(--background-modal);
}

.search-prompt {
    display: flex;
    align-items: center;
    font-size: var(--font-size-bookmark);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.75rem;
    justify-content: flex-start;
}

.search-prefix {
    margin-right: 0.5rem;
    color: var(--accent-success);
}

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

.search-cursor {
    animation: blink 1s infinite;
    margin-left: 0.25rem;
    color: var(--text-primary);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Mobile input - invisible but functional */
.search-input-mobile {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    border: none;
    padding: 0;
    margin: 0;
}

.search-matches {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-matches:empty {
    min-height: 0;
}

.search-match {
    padding: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    text-align: left;
    display: flex;
    align-items: center;
    color: var(--text-primary);
    
    /* Remove tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.search-match:hover,
.search-match.keyboard-selected {
    color: var(--text-primary);
    transform: translateX(8px);
    position: relative;
    overflow: visible; /* Allow the selector to be visible */
}

.search-match.keyboard-selected::before {
    content: '>';
    position: absolute;
    left: -1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.search-match-shortcut {
    font-weight: var(--font-weight-bold);
    margin-right: 1rem;
    min-width: 3ch;
    font-size: var(--font-size-controls);
    color: var(--accent-success);
}

.search-match-name {
    font-size: var(--font-size-text);
    font-weight: var(--font-weight-semibold);
}

/* Special styling for config entry */
.search-match.config-entry .search-match-shortcut {
    color: var(--accent-warning);
}

.search-match.config-entry .search-match-name {
    color: var(--accent-warning);
}

/* Search Button - Fixed at bottom center */
.search-button {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    
    /* Button styling */
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--border-primary);
    background: var(--background-modal);
    color: var(--text-primary);
    font-size: var(--font-size-controls);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    
    /* TTY terminal style */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    
    /* Transitions */
    transition: all 0.3s ease;
    
    /* Remove tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.search-button:hover {
    background: var(--background-primary);
    border-color: var(--accent-success);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.search-button:active {
    transform: translateX(-50%) translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-button-icon {
    color: var(--accent-success);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-category);
}

.search-button-text {
    letter-spacing: 0.05em;
}

/* Hide search button when search is active */
.shortcut-search.show ~ .search-button {
    opacity: 0;
    pointer-events: none;
}
