/**
 * Live Search Widget Styles
 * Colors: #305180 (navy), #e1fa59 (lime), #90c50e (green)
 */

.tst-search-widget {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.tst-search-container {
    position: relative;
    background: linear-gradient(135deg, #1d3350, #305180, #4a6b9e);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(48, 81, 128, 0.25);
}

.tst-search-input-wrapper {
    position: relative;
}

.tst-search-input {
    width: 100%;
    padding: 18px 56px 18px 24px;
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    background: #ffffff;
    border: 3px solid transparent;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tst-search-input:focus {
    border-color: #e1fa59;
    box-shadow: 0 8px 24px rgba(225, 250, 89, 0.3);
    transform: translateY(-2px);
}

.tst-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.tst-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #305180;
    pointer-events: none;
}

.tst-search-loading {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.tst-search-loading.active {
    display: block;
}

.tst-search-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e1fa59;
    border-top-color: transparent;
    border-radius: 50%;
    animation: tst-spin 0.8s linear infinite;
}

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

/* Results dropdown */
.tst-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    max-height: 480px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tst-search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tst-search-results::-webkit-scrollbar {
    width: 8px;
}

.tst-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.tst-search-results::-webkit-scrollbar-thumb {
    background: #90c50e;
    border-radius: 4px;
}

.tst-result-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
}

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

.tst-result-item:hover {
    background: linear-gradient(90deg, #f8fff0, #ffffff);
    transform: translateX(4px);
}

.tst-result-item:active {
    background: linear-gradient(90deg, #f0f9e8, #ffffff);
}

.tst-result-avatar {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #305180, #4a6b9e);
    border: 3px solid #90c50e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
}

.tst-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tst-result-info {
    flex: 1;
    min-width: 0;
}

.tst-result-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.tst-result-flag {
    font-size: 20px;
}

.tst-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
}

.tst-result-ranking {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: #305180;
    color: #ffffff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

.tst-result-tour {
    padding: 3px 10px;
    background: #e1fa59;
    color: #305180;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
}

.tst-result-retired {
    padding: 3px 10px;
    background: #f0f0f0;
    color: #666;
    border-radius: 6px;
    font-weight: 500;
    font-size: 12px;
}

.tst-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.tst-no-results-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.tst-no-results-text {
    font-size: 16px;
    font-weight: 500;
}

.tst-search-hint {
    margin-top: 12px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* Highlight matching text */
.tst-highlight {
    background: #e1fa59;
    color: #305180;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .tst-search-container {
        padding: 16px;
        border-radius: 12px;
    }
    
    .tst-search-input {
        font-size: 16px;
        padding: 16px 50px 16px 20px;
    }
    
    .tst-result-item {
        padding: 12px 16px;
    }
    
    .tst-result-avatar {
        width: 48px;
        height: 48px;
    }
    
    .tst-result-name {
        font-size: 15px;
    }
    
    .tst-result-meta {
        font-size: 13px;
        gap: 8px;
    }
}
