/* Search System CSS Enhancements */

/* Search Input Styling */
.model-search-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.model-search-container .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 2;
}

.model-search-input {
    padding-left: 45px !important;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Search Loading States */
.search-loading {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    margin: 1rem 0;
}

.search-loading .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* No Results Styling */
.search-no-results {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    margin: 1rem 0;
}

.search-no-results i {
    font-size: 3rem;
    opacity: 0.5;
}

/* Search Error Styling */
.search-error {
    border-left: 4px solid #ffc107;
    background: #fff3cd;
    border-color: #ffeaa7;
}

/* Enhanced Business Model Cards for Search */
.business-model-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
}

.business-model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--bs-primary);
}


/* Search Result Highlighting */
.search-highlight {
    background: rgba(255, 235, 59, 0.4);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* Model Features List */
.model-features {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.model-features li {
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.model-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Model Category Badge */
.model-category {
    margin: 0.5rem 0;
}

.model-category small {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .model-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .search-no-results {
        padding: 2rem 1rem;
    }

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

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .search-loading {
        background: rgba(33, 37, 41, 0.9);
        color: #fff;
    }

    .search-no-results {
        background: #343a40;
        border-color: #495057;
        color: #adb5bd;
    }

    .model-category small {
        background: #495057;
        color: #adb5bd;
    }
}

/* Animation for Search Results */
@-webkit-keyframes searchResultFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes searchResultFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.model-grid.search-results {
    -webkit-animation: searchResultFade 0.3s ease-out;
            animation: searchResultFade 0.3s ease-out;
}

/* Search Input Clear Button */
.model-search-container .search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.model-search-container:hover .search-clear,
.model-search-input:focus + .search-clear {
    opacity: 1;
}

.model-search-container .search-clear:hover {
    color: #495057;
}
