/**
 * AthleteZone Athlete Search Styles
 *
 * Self-contained styling that works regardless of placement.
 * Override these in your theme's _extend.less or custom CSS as needed.
 */

/* ── Container ── */
.athlete-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    font-family: inherit;
}

/* ── Input Row ── */
.athlete-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.athlete-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: #999;
    pointer-events: none;
    z-index: 1;
}

.athlete-search-input {
    width: 100%;
    height: 48px;
    padding: 0 72px 0 42px;
    font-size: 15px;
    line-height: 48px;
    color: #333;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.athlete-search-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.athlete-search-input::placeholder {
    color: #aaa;
}

/* ── Spinner ── */
.athlete-search-spinner {
    position: absolute;
    right: 42px;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: athlete-search-spin 0.6s linear infinite;
}

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

/* ── Clear Button ── */
.athlete-search-clear {
    position: absolute;
    right: 12px;
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 20px;
    line-height: 26px;
    text-align: center;
    color: #999;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.athlete-search-clear:hover {
    color: #333;
    background: #f0f0f0;
}

/* ── Dropdown ── */
.athlete-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 380px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

/* ── Result Item ── */
.athlete-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    cursor: pointer;
    transition: background-color 0.12s ease;
    border-bottom: 1px solid #f5f5f5;
}

.athlete-search-result:last-child {
    border-bottom: none;
}

.athlete-search-result:hover,
.athlete-search-result.active {
    background-color: #f5f8ff;
}

/* ── Thumbnail ── */
.athlete-search-thumb {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #eee;
}

.athlete-search-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
}

.athlete-search-thumb-placeholder svg {
    width: 22px;
    height: 22px;
}

/* ── Result Text ── */
.athlete-search-result-text {
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow text truncation */
}

.athlete-search-result-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.athlete-search-result-name mark {
    background-color: #fef3cd;
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}

.athlete-search-result-breadcrumb {
    font-size: 12px;
    color: #888;
    line-height: 1.3;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── No Results ── */
.athlete-search-no-results {
    padding: 16px 14px;
    font-size: 14px;
    color: #888;
    text-align: center;
}

.athlete-search-no-results strong {
    color: #555;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .athlete-search-wrapper {
        max-width: 100%;
    }

    .athlete-search-input {
        height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }

    .athlete-search-dropdown {
        max-height: 300px;
    }
}
