/**
 * NEW ERA MAGAZINE - LIVE SEARCH STYLES
 * Styling for real-time search dropdown
 */

/* =====================================================
   SEARCH RESULTS CONTAINER
   ===================================================== */
.nem-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: var(--nem-bg-card, #ffffff);
    border: 1px solid var(--nem-border-color, #e0e0e0);
    border-radius: 12px;
    box-shadow: var(--nem-shadow-lg, 0 8px 32px rgba(0, 0, 0, 0.16));
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

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

/* =====================================================
   RESULTS LIST
   ===================================================== */
.nem-search-results-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.nem-search-result-item {
    border-bottom: 1px solid var(--nem-border-light, #f0f0f0);
}

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

.nem-search-result-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--nem-text-primary, #1a1a1a);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.nem-search-result-link:hover {
    background-color: var(--nem-bg-secondary, #f8f9fa);
    color: var(--nem-text-primary, #1a1a1a);
}

/* =====================================================
   RESULT ITEM COMPONENTS
   ===================================================== */
.nem-search-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background-color: var(--nem-bg-tertiary, #f2f2f2);
    border-radius: 8px;
    color: var(--nem-red, #e4213a);
    font-size: 16px;
}

.nem-search-result-content {
    flex: 1;
    min-width: 0;
}

.nem-search-result-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--nem-text-primary, #1a1a1a);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nem-search-result-title mark {
    background-color: rgba(228, 33, 58, 0.15);
    color: var(--nem-red, #e4213a);
    font-weight: 700;
    padding: 0 2px;
    border-radius: 2px;
}

.nem-search-result-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--nem-text-muted, #757575);
}

.nem-search-result-separator {
    color: var(--nem-border-color, #e0e0e0);
}

.nem-search-result-category {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background-color: var(--nem-bg-tertiary, #f2f2f2);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   LOADING STATE
   ===================================================== */
.nem-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    gap: 12px;
    color: var(--nem-text-muted, #757575);
}

.nem-search-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--nem-border-color, #e0e0e0);
    border-top-color: var(--nem-red, #e4213a);
    border-radius: 50%;
    animation: nem-spin 0.8s linear infinite;
}

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

/* =====================================================
   NO RESULTS STATE
   ===================================================== */
.nem-search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--nem-text-muted, #757575);
}

.nem-search-no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.nem-search-no-results p {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: var(--nem-text-secondary, #4a4a4a);
}

.nem-search-no-results strong {
    color: var(--nem-text-primary, #1a1a1a);
}

.nem-search-hint {
    display: block;
    font-size: 13px;
    color: var(--nem-text-muted, #757575);
}

/* =====================================================
   ERROR STATE
   ===================================================== */
.nem-search-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
    color: var(--nem-danger, #dc3545);
}

.nem-search-error i {
    font-size: 36px;
    margin-bottom: 12px;
}

.nem-search-error p {
    margin: 0;
    font-size: 14px;
}

/* =====================================================
   VIEW ALL LINK
   ===================================================== */
.nem-search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    margin-top: 8px;
    border-top: 1px solid var(--nem-border-light, #f0f0f0);
    background-color: var(--nem-bg-secondary, #f8f9fa);
    color: var(--nem-red, #e4213a);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.nem-search-view-all:hover {
    background-color: var(--nem-bg-tertiary, #f2f2f2);
    color: var(--nem-red-dark, #b81a2d);
}

.nem-search-view-all i {
    font-size: 12px;
}

/* =====================================================
   SEARCH INPUT WRAPPER
   ===================================================== */
.nem-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.nem-search-input {
    width: 100%;
    padding: 12px 42px 12px 16px;
    border: 2px solid var(--nem-border-color, #e0e0e0);
    border-radius: 24px;
    font-size: 14px;
    background-color: var(--nem-bg-secondary, #f8f9fa);
    color: var(--nem-text-primary, #1a1a1a);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.nem-search-input:focus {
    outline: none;
    border-color: var(--nem-red, #e4213a);
    background-color: var(--nem-bg-card, #ffffff);
}

.nem-search-input::placeholder {
    color: var(--nem-text-muted, #757575);
}

.nem-search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--nem-text-muted, #757575);
    pointer-events: none;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */
@media (max-width: 768px) {
    .nem-search-results {
        max-height: 400px;
        left: -16px;
        right: -16px;
        border-radius: 8px;
    }
    
    .nem-search-result-title {
        font-size: 14px;
    }
    
    .nem-search-result-meta {
        font-size: 12px;
    }
    
    .nem-search-result-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
.nem-search-result-link:focus {
    outline: 2px solid var(--nem-red, #e4213a);
    outline-offset: -2px;
    background-color: var(--nem-bg-secondary, #f8f9fa);
}

/* Keyboard navigation highlighting */
.nem-search-result-item.keyboard-focused .nem-search-result-link {
    background-color: var(--nem-bg-tertiary, #f2f2f2);
    outline: 2px solid var(--nem-red, #e4213a);
    outline-offset: -2px;
}

/* =====================================================
   SCROLLBAR STYLING
   ===================================================== */
.nem-search-results::-webkit-scrollbar {
    width: 8px;
}

.nem-search-results::-webkit-scrollbar-track {
    background-color: var(--nem-bg-secondary, #f8f9fa);
    border-radius: 0 12px 12px 0;
}

.nem-search-results::-webkit-scrollbar-thumb {
    background-color: var(--nem-border-color, #e0e0e0);
    border-radius: 4px;
}

.nem-search-results::-webkit-scrollbar-thumb:hover {
    background-color: var(--nem-text-muted, #757575);
}
