/**
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * BLOCKEXPLORER GLOBAL SEARCH - Purple/Blue "Electric Glass" Theme
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *
 * Global Search Modal: Premium search experience with glassmorphism
 * Color Palette: Purple/Blue theme (NOT Fulgura green)
 *
 * Uses BlockExplorer's Purple/Blue identity.
 * For Fulgura brand green (#C5EE49), see DEX project.
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    animation: fadeIn 0.2s ease;
}

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

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    background: #1a1a1a;
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideDown 0.3s ease;
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.1);
}

#global-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    font-family: inherit;
}

#global-search-input::placeholder {
    color: #666;
}

.search-close-btn {
    background: rgba(138, 43, 226, 0.1);
    border: none;
    color: #8a2be2;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-close-btn:hover {
    background: rgba(138, 43, 226, 0.2);
    transform: scale(1.05);
}

.search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    max-height: calc(80vh - 80px);
}

/* Search Help */
.search-help {
    text-align: center;
    padding: 2rem;
}

.search-help-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #8a2be2;
    margin-bottom: 1.5rem;
}

.search-help-items {
    display: grid;
    gap: 1rem;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.search-help-item {
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(138, 43, 226, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.1);
    border-radius: 8px;
}

.search-help-item i {
    color: #8a2be2;
    font-size: 1.2rem;
    margin-top: 0.2rem;
}

.search-help-item span {
    color: #aaa;
    font-size: 0.95rem;
    line-height: 1.5;
}

.search-help-item strong {
    color: #fff;
}

.search-help-tip {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(138, 43, 226, 0.05);
    border: 1px solid rgba(138, 43, 226, 0.1);
    border-radius: 8px;
    color: #888;
    font-size: 0.9rem;
}

.search-help-tip kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-family: monospace;
    font-size: 0.85rem;
    color: #8a2be2;
}

/* Search Results */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-result-section {
    border: 1px solid rgba(138, 43, 226, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(138, 43, 226, 0.05);
    border-bottom: 1px solid rgba(138, 43, 226, 0.1);
    font-weight: 600;
    color: #8a2be2;
}

.search-result-header i {
    font-size: 1rem;
}

.search-result-items {
    background: rgba(0, 0, 0, 0.2);
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.search-result-item:hover {
    background: rgba(138, 43, 226, 0.1);
    transform: translateX(4px);
}

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

.result-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-subtitle {
    font-size: 0.85rem;
    color: #888;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #888;
    font-size: 0.85rem;
}

.result-meta i {
    color: #8a2be2;
}

.result-badge {
    background: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.token-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

.status-success {
    color: #10b981;
}

.status-pending {
    color: #f59e0b;
}

.status-failed {
    color: #ef4444;
}

/* Loading State */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #8a2be2;
    gap: 1rem;
}

.search-loading i {
    font-size: 2rem;
}

/* Error State */
.search-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #ef4444;
    gap: 1rem;
}

.search-error i {
    font-size: 2rem;
}

/* No Results State */
.search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.search-no-results i {
    font-size: 3rem;
    color: #666;
    margin-bottom: 1rem;
}

.no-results-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.no-results-subtitle {
    color: #888;
    max-width: 400px;
    line-height: 1.5;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #8a2be2;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(138, 43, 226, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-modal {
        padding-top: 5vh;
    }

    .search-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    #global-search-input {
        font-size: 1rem;
    }

    .search-result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .result-meta {
        width: 100%;
        justify-content: space-between;
    }
}

/* Search Button in Header */
.header-search-btn {
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.header-search-btn:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: rgba(138, 43, 226, 0.4);
}

.header-search-btn i {
    font-size: 1rem;
}

.header-search-btn kbd {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-family: monospace;
    margin-left: 0.25rem;
}
