/**
 * Tune Search Autocomplete Component Styles
 * Shared styles for tune search functionality across the application
 */

.autocomplete-container {
    position: relative;
}

/* Prevent mobile zoom on focus - input must be at least 16px */
.autocomplete-container input[type="text"] {
    font-size: 16px;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--dropdown-bg, white);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 2100;
    display: none;
    box-shadow: 0 4px 8px var(--dropdown-shadow);
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: var(--hover-bg);
}

.autocomplete-item .tune-name {
    font-weight: 600;
    color: var(--text-color);
    display: block;
    margin-bottom: 4px;
}

.autocomplete-item .tune-meta {
    font-size: 12px;
    color: var(--text-muted, #6c757d);
}

.autocomplete-item .tune-type {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--primary);
    color: white;
    border-radius: 3px;
    font-size: 11px;
    text-transform: capitalize;
    margin-right: 8px;
}

.autocomplete-item .tune-count-badge {
    font-size: 11px;
    padding: 3px 6px;
    background-color: var(--secondary-text, #6c757d);
    color: white;
    border-radius: 3px;
    white-space: nowrap;
}

.no-results {
    padding: 12px;
    color: var(--text-muted, #6c757d);
    font-style: italic;
    text-align: center;
}

.no-results.clickable {
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
}

.no-results.clickable:hover {
    color: var(--primary-dark, #0056b3);
}

.no-match-option {
    padding: 12px;
    color: var(--text-muted, #6c757d);
    font-style: italic;
    text-align: center;
    border-top: 1px solid var(--border-color, #dee2e6);
    margin-top: 4px;
}

.no-match-option.clickable {
    cursor: pointer;
    color: var(--primary);
    text-decoration: underline;
}

.no-match-option.clickable:hover {
    color: var(--primary-dark, #0056b3);
    background-color: var(--hover-bg, #f8f9fa);
}

.thesession-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #ff9800;
    color: white;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 8px;
}

.loading-indicator {
    padding: 12px;
    color: var(--text-muted, #6c757d);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color, #ddd);
    border-top-color: var(--primary, #007bff);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Styles for tunes already added to collection */
.autocomplete-item.already-added {
    background-color: var(--already-added-bg, #f5f5f5);
}

[data-theme="dark"] .autocomplete-item.already-added {
    background-color: var(--already-added-bg, #3a3a3a);
}

.autocomplete-item.already-added:hover {
    background-color: var(--already-added-hover-bg, #e8e8e8);
}

[data-theme="dark"] .autocomplete-item.already-added:hover {
    background-color: var(--already-added-hover-bg, #454545);
}

/* Learn status icons */
.learn-status-icon {
    display: inline-block;
    margin-left: 8px;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.learn-status-icon.learned {
    color: #5cb85c; /* green */
}

.learn-status-icon.learning {
    color: #5bc0de; /* blue */
}

.learn-status-icon.want-to-learn {
    color: #f0ad4e; /* yellow */
}

/* Already added text */
.already-added-text {
    color: var(--text-muted, #6c757d);
    font-style: italic;
    font-size: 11px;
}

/* Loading spinner for tune rows */
.tune-loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border-color, #ddd);
    border-top-color: var(--primary, #007bff);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
