@charset "utf-8";

/* Standalone Device Search Styles */
.wcrb-device-search-container {
    max-width: 650px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wcrb-device-search-box {
    position: relative;
    width: 100%;
}

.wcrb-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.wcrb-search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wcrb-search-icon {
    color: #94a3b8;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.wcrb-device-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.5rem 0;
    background: transparent !important;
    color: #1e293b;
    border:0px !important;
    margin-bottom:0px; 
}

.wcrb-device-search-input::placeholder {
    color: #94a3b8;
}

.wcrb-device-search-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 0.5rem 1.25rem;
    margin-left: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}

.wcrb-device-search-btn:hover {
    background: #2563eb;
}

.wcrb-search-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wcrb-search-clear-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Search Results Dropdown */
.wcrb-search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.wcrb-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.wcrb-results-count {
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
}

.wcrb-close-dropdown {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #94a3b8;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wcrb-close-dropdown:hover {
    background: #e2e8f0;
    color: #475569;
}

.wcrb-dropdown-content {
    max-height: 320px;
    overflow-y: auto;
}

.wcrb-results-list {
    display: flex;
    flex-direction: column;
}

/* Search Result Item */
.wcrb-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s ease;
}

.wcrb-search-result-item:hover {
    background: #f8fafc;
}

.wcrb-result-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.wcrb-result-image {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
}

.wcrb-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcrb-result-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #94a3b8;
}

.wcrb-result-details {
    flex: 1;
    min-width: 0;
}

.wcrb-result-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcrb-result-brand,
.wcrb-result-type {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wcrb-result-select-arrow {
    width: 16px;
    height: 16px;
    color: #cbd5e1;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Loading State */
.wcrb-loading-results {
    padding: 32px 16px;
    text-align: center;
}

.wcrb-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: wcrb-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes wcrb-spin {
    to { transform: rotate(360deg); }
}

.wcrb-no-results {
    padding: 32px 16px;
    text-align: center;
    color: #64748b;
}

/* Search Hint */
.wcrb-search-hint {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    font-size: 0.7rem;
    color: #94a3b8;
}

.wcrb-search-hint svg {
    color: #10b981;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .wcrb-device-search-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .wcrb-search-input-wrapper {
        padding: 0.4rem 0.75rem;
    }
    
    .wcrb-device-search-input {
        font-size: 0.9rem;
    }
    
    .wcrb-search-result-item {
        padding: 10px 12px;
    }
    
    .wcrb-result-image,
    .wcrb-result-icon {
        width: 36px;
        height: 36px;
    }
}