/* ============================================
   CATALOG SEARCH BAR - Modern & Elegant
============================================= */

/* Search Section */
.catalog-search-section {
    padding: 3rem 0 2rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, transparent 100%);
    position: relative;
    z-index: 100;
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Search Header */
.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: #00ffcc;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.search-title i {
    font-size: 1.5rem;
}

.search-subtitle {
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 400;
}

/* Search Bar Wrapper */
.search-bar-wrapper {
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 255, 204, 0.3);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.search-input-group:focus-within {
    border-color: rgba(0, 255, 204, 0.8);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 255, 204, 0.2);
}

/* Search Icon */
.search-icon {
    color: #00ffcc;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

/* Search Input */
.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    padding: 0.5rem 0;
}

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

/* Platform Filter */
.platform-filter-wrapper {
    position: relative;
}

.platform-filter {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 255, 204, 0.3);
    border-radius: 25px;
    color: #f8fafc;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2300ffcc' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 150px;
}

.platform-filter:hover {
    border-color: rgba(0, 255, 204, 0.6);
    background-color: rgba(15, 23, 42, 0.95);
}

.platform-filter:focus {
    border-color: #00ffcc;
}

.platform-filter option {
    background: #1e293b;
    color: #f8fafc;
    padding: 0.5rem;
}

/* Clear Button */
.search-clear-btn {
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.4);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff3b30;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-clear-btn:hover {
    background: rgba(255, 59, 48, 0.3);
    border-color: rgba(255, 59, 48, 0.6);
    transform: rotate(90deg);
}

/* Search Stats */
.search-stats {
    margin-top: 1rem;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.results-count {
    color: #00ffcc;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 255, 204, 0.3);
    border-radius: 20px;
    max-height: 500px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

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

/* Results Header */
.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 255, 204, 0.2);
}

.results-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #00ffcc;
    font-size: 1rem;
}

.close-results-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-results-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #00ffcc;
    transform: rotate(90deg);
}

/* Results List */
.search-results-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Custom Scrollbar */
.search-results-list::-webkit-scrollbar {
    width: 8px;
}

.search-results-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.search-results-list::-webkit-scrollbar-thumb {
    background: #00ffcc;
    border-radius: 4px;
}

/* Search Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.search-result-item:hover {
    background: rgba(0, 255, 204, 0.1);
    border-color: rgba(0, 255, 204, 0.3);
    transform: translateX(5px);
}

/* Platform Icon Circle */
.result-platform-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(0, 255, 204, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;  /* CRÍTICO: oculta lo que sale del border-radius */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.result-platform-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 12px;  /* Mismo border-radius */
}

.platform-emoji {
    font-size: 2rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Result Info */
.result-info {
    flex: 1;
}

.result-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.result-platform {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #00ffcc;
}

.result-size {
    color: #94a3b8;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: #cbd5e1;
}

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

.no-results h3 {
    font-family: 'Orbitron', sans-serif;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}

/* Results Footer */
.search-results-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 255, 204, 0.2);
}

.show-all-results-btn {
    width: 100%;
    background: linear-gradient(135deg, #00ffcc, #00cc99);
    border: none;
    border-radius: 25px;
    color: #0f172a;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 255, 204, 0.3);
}

.show-all-results-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 204, 0.5);
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 2rem;
    color: #00ffcc;
}

.search-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

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

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .catalog-search-section {
        padding: 2rem 0 1.5rem;
    }
    
    .search-container {
        padding: 0 1rem;
    }
    
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-input-group {
        flex-wrap: wrap;
        border-radius: 20px;
        padding: 1rem;
    }
    
    .search-input {
        width: 100%;
        order: 1;
    }
    
    .platform-filter {
        width: 100%;
        order: 3;
        margin-top: 0.5rem;
    }
    
    .search-icon {
        order: 0;
    }
    
    .search-clear-btn {
        order: 2;
    }
    
    .search-results-dropdown {
        max-height: 400px;
    }
    
    .result-platform-icon {
        width: 50px;
        height: 50px;
    }
    
    .platform-emoji {
        font-size: 1.5rem;
    }
    
    .result-name {
        font-size: 0.875rem;
    }
    
    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}