/**
 * Universal Cross-Entity Search Styles
 */

/* Search Container */
.unified-search-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.search-intro {
    text-align: center;
    margin-bottom: 30px;
}

.search-intro h2 {
    color: #333;
    margin-bottom: 12px;
}

.search-intro p {
    color: #666;
    font-size: 16px;
}

/* Search Bar */
.unified-search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    position: relative;
}

.unified-search-bar input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.unified-search-bar input:focus {
    outline: none;
    border-color: #7D8FC3;
    box-shadow: 0 0 0 3px rgba(125, 143, 195, 0.1);
}

.unified-search-bar input::placeholder {
    color: #adb5bd;
}

.unified-search-bar button {
    padding: 14px 24px;
    white-space: nowrap;
}

/* Search Results Container */
.unified-search-results {
    margin-top: 30px;
    animation: fadeIn 0.3s ease;
}

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

.unified-search-results.hidden {
    display: none;
}

/* Search Results Header */
.search-results-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.search-results-header h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* Results Groups */
.search-results-group {
    margin-bottom: 32px;
}

.results-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.results-icon {
    font-size: 20px;
}

.results-count {
    color: #7D8FC3;
    font-weight: 500;
}

.results-error {
    color: #dc3545;
    font-size: 14px;
    margin-left: auto;
}

.results-error-message {
    color: #dc3545;
    font-size: 14px;
    padding: 12px;
    background: #fff5f5;
    border-radius: 6px;
    border-left: 3px solid #dc3545;
}

/* Results List */
.results-list {
    display: grid;
    gap: 8px;
}

.result-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.result-item:hover {
    border-color: #7D8FC3;
    background: #f8f9ff;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(125, 143, 195, 0.15);
}

.result-item:active {
    transform: translateX(2px);
}

.result-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.result-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-name mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.result-type {
    font-size: 12px;
    color: #7D8FC3;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.results-more {
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 4px;
}

/* Loading State */
.search-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7D8FC3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-loading p {
    font-size: 16px;
    font-style: italic;
}

/* Error State */
.search-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
}

.search-error p {
    font-size: 16px;
    margin-bottom: 20px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results p:first-child {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.no-results-hint {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

/* Search Hint */
.search-hint {
    text-align: center;
    padding: 20px;
    background: #e7f3ff;
    border-radius: 8px;
    border-left: 4px solid #0c5460;
}

.search-hint p {
    color: #0c5460;
    margin: 0;
    font-size: 14px;
}

/* Entity Type Cards */
.entity-type-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.entity-type-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.entity-type-card:hover {
    border-color: #7D8FC3;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(125, 143, 195, 0.2);
}

.entity-type-card .entity-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 12px;
}

.entity-type-card .entity-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.entity-type-card .entity-description {
    font-size: 14px;
    color: #666;
    display: block;
}

/* Quick Access Section */
.quick-access {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 1px solid #e9ecef;
}

.quick-access h3 {
    text-align: center;
    color: #333;
    font-size: 20px;
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 767px) {
    .unified-search-container {
        padding: 24px 15px;
    }
    
    .unified-search-bar {
        flex-direction: column;
    }
    
    .unified-search-bar button {
        width: 100%;
    }
    
    .entity-type-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .result-item {
        padding: 10px 12px;
    }
    
    .result-name {
        font-size: 14px;
    }
    
    .result-type {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .unified-search-container {
        padding: 20px 10px;
    }
    
    .search-intro h2 {
        font-size: 22px;
    }
    
    .search-intro p {
        font-size: 14px;
    }
    
    .entity-type-cards {
        grid-template-columns: 1fr;
    }
    
    .search-results-header h3 {
        font-size: 18px;
    }
    
    .results-group-header {
        font-size: 14px;
    }
    
    .result-item:hover {
        transform: none;
    }
}

/* Accessibility */
.result-item:focus {
    outline: 2px solid #7D8FC3;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .unified-search-bar,
    .quick-access {
        display: none;
    }
    
    .result-item {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
}
