/**
 * Neo Coins Search Popup Styles
 */

/* ============================================
   SEARCH TRIGGER BUTTON
   Footer floating button: fixed in corner.
   Header block (neo-search-widget-trigger): stays in document flow.
   ============================================ */

/* Footer floating trigger only - fixed in bottom-right corner */
.neo-search-trigger.neo-search-trigger-footer {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.neo-search-trigger.neo-search-trigger-footer:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.neo-search-trigger .search-icon {
    font-size: 20px;
}

/* ============================================
   SEARCH POPUP OVERLAY
   ============================================ */

.neo-search-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.neo-search-popup.active {
    display: block;
}

.search-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

/* ============================================
   SEARCH POPUP CONTENT
   ============================================ */

.search-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--neo-popup-bg, #fff);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    animation: popupSlideIn 0.3s ease-out;
    --neo-popup-accent: #667eea;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ============================================
   POPUP CLOSE BUTTON (redesigned)
   ============================================ */

.search-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
    z-index: 10;
}

.search-popup-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111827;
    border-color: rgba(0, 0, 0, 0.12);
}

.search-popup-close:active {
    transform: scale(0.96);
}

.search-popup-close-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-popup-close-icon svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ============================================
   POPUP HEADER
   ============================================ */

.search-popup-header {
    padding: 24px 24px 16px;
    border-bottom: var(--neo-popup-header-border-width, 1px) solid #e5e7eb;
}

.search-popup-header .search-popup-header-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
}

/* ============================================
   SEARCH INPUT
   ============================================ */

.search-popup-search {
    padding: var(--neo-popup-search-area-padding, 20px) 30px;
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
}

#neo-token-search {
    flex: 1;
    min-width: 0;
    padding: 15px 20px;
    background: var(--neo-popup-input-bg, #ffffff);
    color: var(--neo-popup-input-color, #111827);
    border: 2px solid var(--neo-popup-input-border, #e5e7eb);
    border-radius: var(--neo-popup-input-radius, 12px);
    font-size: 16px;
    transition: all 0.3s;
}

.search-popup-search-btn {
    flex-shrink: 0;
    padding: 15px 24px;
    background: var(--neo-popup-accent, #667eea);
    color: var(--neo-popup-search-btn-color, #fff);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.search-popup-search-btn:hover {
    background: var(--neo-popup-search-btn-hover, var(--neo-popup-accent, #667eea));
    filter: var(--neo-popup-search-btn-hover-filter, brightness(1.1));
    transform: translateY(-1px);
}

#neo-token-search:focus {
    outline: none;
    border-color: var(--neo-popup-accent, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-loading {
    display: none;
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
}

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

/* ============================================
   BANNER AD SPACE
   ============================================ */

.search-popup-banner {
    padding: 0 30px 20px;
}

.search-popup-banner img {
    width: 100%;
    height: auto;
    border-radius: var(--neo-popup-banner-radius, 12px);
    cursor: pointer;
    transition: all 0.3s;
}

.search-popup-banner img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.banner-placeholder {
    background: var(--neo-popup-banner-bg, #f3f4f6);
    padding: var(--neo-popup-banner-padding, 30px);
    border-radius: var(--neo-popup-banner-radius, 12px);
    text-align: center;
    border: 2px dashed var(--neo-popup-banner-border, #d1d5db);
}

.banner-placeholder p {
    margin: 5px 0;
    color: #6b7280;
}

.banner-placeholder p:first-child {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */

.search-popup-results {
    padding: 0 30px 20px;
}

.search-popup-section {
    padding: 0 30px 20px;
}

.search-popup-section h3,
.search-popup-section-title {
    font-size: var(--neo-popup-section-title-size, 18px);
    margin: 0 0 15px 0;
    color: #374151;
}

.search-token-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-token-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--neo-popup-item-bg, #f9fafb);
    border-radius: var(--neo-popup-item-radius, 12px);
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid var(--neo-popup-item-border, #e5e7eb);
}

.search-token-item:hover {
    background: var(--neo-popup-item-hover-bg, #f3f4f6);
    border-color: var(--neo-popup-accent, #667eea);
    transform: translateX(5px);
}

.search-token-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.search-token-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.search-token-info {
    flex: 1;
}

.search-token-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--neo-popup-token-name-color, #111827);
    margin: 0 0 4px 0;
}

.search-token-symbol {
    font-size: 14px;
    color: var(--neo-popup-votes-color, #6b7280);
}

.search-token-votes {
    color: #10b981;
    font-weight: 600;
    font-size: 14px;
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.search-no-results p {
    margin: 10px 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .neo-search-trigger.neo-search-trigger-footer {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
    }
    
    .neo-search-trigger.neo-search-trigger-footer .search-text {
        display: none;
    }
    
    .search-popup-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .search-popup-header,
    .search-popup-search,
    .search-popup-banner,
    .search-popup-results,
    .search-popup-section {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .search-token-item {
        padding: 10px;
    }
    
    .search-token-logo,
    .search-token-logo-placeholder {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .search-popup-header h2 {
        font-size: 20px;
    }
    
    #neo-token-search {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .banner-placeholder {
        padding: 20px;
    }
    
    .banner-placeholder p:first-child {
        font-size: 16px;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

.search-popup-content::-webkit-scrollbar {
    width: 8px;
}

.search-popup-content::-webkit-scrollbar-track {
    background: var(--neo-popup-scrollbar-track, #f1f1f1);
}

.search-popup-content::-webkit-scrollbar-thumb {
    background: var(--neo-popup-scrollbar-thumb, #667eea);
    border-radius: 4px;
}

.search-popup-content::-webkit-scrollbar-thumb:hover {
    background: var(--neo-popup-scrollbar-thumb, #764ba2);
    filter: brightness(0.9);
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .neo-search-trigger-footer,
    .neo-search-widget-wrapper,
    .neo-search-popup {
        display: none !important;
    }
}