/* ============================================
   DATASHEET SEARCH STYLES
   ============================================ */

/* Section de recherche */
.datasheet-search-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 50px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.search-box-wrapper {
    max-width: 800px;
    margin: 0 auto 40px;
}

.search-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;

    /* Alternatives :
       color: #4CAF50;  // Vert
       color: #2c3e50;  // Bleu foncé
       color: #e74c3c;  // Rouge
       color: #9b59b6;  // Violet
    */
}

.search-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 15px;
}

/* Input de recherche */
.search-input-container {
    position: relative;
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 18px 24px 18px 50px;
    font-size: 18px;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    pointer-events: none;
}

/* Dropdown des résultats */
.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    max-height: 450px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: none;
    z-index: 1000;
}

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

/* Items de résultats */
.search-result-item {
    padding: 16px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

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

.search-result-item:hover {
    background: #f8f9fa;
}

.result-left {
    flex: 1;
}

.result-id {
    font-weight: 700;
    color: #2c3e50;
    font-size: 17px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-title {
    color: #6c757d;
    font-size: 14px;
    margin-top: 4px;
}

.result-category {
    font-size: 12px;
    color: #adb5bd;
    margin-top: 2px;
}

.result-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Badges */
.result-badge {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-priority-critical {
    background: #dc3545;
    color: white;
}

.badge-priority-high {
    background: #fd7e14;
    color: white;
}

.badge-priority-medium {
    background: #28a745;
    color: white;
}

.badge-interface {
    background: #e3f2fd;
    color: #1976d2;
}

/* No results */
.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6c757d;
    font-size: 16px;
}

.no-results strong {
    color: #2c3e50;
}

/* Stats de recherche */
.search-stats {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    min-height: 20px;
}

/* Composants populaires */
.popular-components {
    max-width: 800px;
    margin: 0 auto;
}

.popular-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #2c3e50;
    text-align: center;
}

.component-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.component-tag {
    padding: 10px 20px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.component-tag:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Highlight du texte recherché */
.highlight {
    background: #fff3cd;
    font-weight: 700;
    padding: 0 2px;
}

/* Séparateur */
.section-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #dee2e6, transparent);
    margin: 50px 0;
}

.section-intro {
    text-align: center;
    margin-bottom: 40px;
}

.section-intro h2 {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
}

.section-intro p {
    color: #6c757d;
    font-size: 16px;
}

/* Scrollbar personnalisée */
.search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .datasheet-search-section {
        padding: 25px 20px;
    }
    
    .search-title {
        font-size: 22px;
    }
    
    .search-input {
        font-size: 16px;
        padding: 14px 20px 14px 45px;
    }
    
    .component-tags {
        gap: 8px;
    }
    
    .component-tag {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .result-right {
        flex-direction: column;
        gap: 4px;
        align-items: flex-end;
    }
}