/*
⚠️ IMPORTANTE: Sigue las directrices del framework Vibe.
Ver: /.github/copilot-instructions.md

AssetSearchSelector - Estilos del componente
Vibe Framework Implementation
*/

/* ====================================
   MODAL CONTAINER
   ==================================== */
.asset-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: assetModalFadeIn 0.2s ease;
}

@keyframes assetModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.asset-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}

.asset-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: assetModalSlideUp 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

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

/* ====================================
   MODAL HEADER
   ==================================== */
.asset-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.asset-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #f1f5f9;
}

.asset-modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.asset-modal-close:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #f1f5f9;
}

/* ====================================
   MODAL BODY
   ==================================== */
.asset-modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ====================================
   SEARCH INPUT
   ==================================== */
.asset-search-input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.asset-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    border: 2px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    color: #f1f5f9;
    transition: all 0.2s ease;
}

.asset-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.asset-search-input::placeholder {
    color: #64748b;
}

.asset-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    pointer-events: none;
}

/* ====================================
   SEARCH RESULTS
   ==================================== */
.asset-search-results {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

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

.asset-search-results::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 4px;
}

.asset-search-results::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 4px;
}

.asset-search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* ====================================
   RESULT ITEM
   ==================================== */
.asset-search-result-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: rgba(30, 41, 59, 0.5);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.asset-search-result-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateX(4px);
}

.asset-search-result-item.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.2) 100%);
    border-color: #3b82f6;
}

.asset-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.asset-result-ticker {
    font-size: 1.125rem;
    font-weight: 700;
    color: #60a5fa;
}

.asset-result-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #94a3b8;
}

.asset-result-name {
    font-size: 0.938rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.asset-result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.813rem;
    color: #64748b;
}

.asset-result-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ====================================
   HINTS & MESSAGES
   ==================================== */
.asset-search-hint {
    text-align: center;
    color: #64748b;
    padding: 3rem 1rem;
    font-size: 0.938rem;
}

.asset-search-no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.asset-search-no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.asset-search-no-results p {
    color: #94a3b8;
    font-size: 1rem;
}

.asset-search-error {
    text-align: center;
    padding: 3rem 1rem;
}

.asset-search-error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.asset-search-error p {
    color: #f87171;
    font-size: 1rem;
}

/* ====================================
   LOADING
   ==================================== */
.asset-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(148, 163, 184, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.asset-search-loading p {
    margin-top: 1rem;
    color: #94a3b8;
    font-size: 0.938rem;
}

/* ====================================
   MODAL FOOTER
   ==================================== */
.asset-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.asset-modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.938rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.asset-modal-footer .btn-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: #cbd5e1;
}

.asset-modal-footer .btn-secondary:hover {
    background: rgba(148, 163, 184, 0.2);
}

.asset-modal-footer .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.asset-modal-footer .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.asset-modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 768px) {
    .asset-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .asset-modal-header {
        padding: 1rem;
    }
    
    .asset-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .asset-modal-body {
        padding: 1rem;
    }
    
    .asset-search-input {
        font-size: 0.938rem;
        padding: 0.75rem 1rem 0.75rem 2.75rem;
    }
    
    .asset-search-result-item {
        padding: 0.875rem;
    }
    
    .asset-result-ticker {
        font-size: 1rem;
    }
    
    .asset-modal-footer {
        padding: 1rem;
        flex-direction: column;
    }
    
    .asset-modal-footer .btn {
        width: 100%;
    }
}
