/**
 * Search Results Styles
 * Phase 2: Liquid glass morphism design
 */

.search-results-wrapper {
    margin-top: 32px;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Results Header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
}

.results-info {
    flex: 1;
}

.results-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.results-query {
    margin: 0 0 8px 0;
}

.query-text {
    color: #00d4ff;
    font-size: 16px;
    font-weight: 600;
}

.results-count {
    margin-left: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.results-interpretation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0 0;
    padding: 12px 16px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    color: #7c3aed;
    font-size: 14px;
}

.results-interpretation svg {
    flex-shrink: 0;
}

.results-actions {
    display: flex;
    gap: 12px;
}

.export-btn,
.close-results-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(10, 14, 39, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-btn:hover,
.close-results-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
}

.close-results-btn {
    padding: 10px;
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(10, 14, 39, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
}

.filters-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 600;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    color: #00d4ff;
    font-size: 13px;
}

.remove-filter-btn {
    background: transparent;
    border: none;
    color: #00d4ff;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-filter-btn:hover {
    background: rgba(0, 212, 255, 0.2);
}

.clear-filters-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

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

/* Fund Card */
.fund-card {
    background: rgba(10, 14, 39, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fund-card:hover {
    background: rgba(10, 14, 39, 0.6);
    border-color: rgba(0, 212, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(0, 212, 255, 0.2);
    transform: translateY(-2px);
}

.fund-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.fund-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    color: #00d4ff;
    font-size: 18px;
    font-weight: 700;
}

.fund-main-info {
    flex: 1;
}

.fund-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
}

.fund-manager {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 0;
}

.fund-type-badge {
    padding: 6px 16px;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: 20px;
    color: #7c3aed;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.fund-card-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fund-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.fund-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

.fund-actions {
    display: flex;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fund-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fund-action-btn:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.view-details-btn {
    flex: 1;
}

.add-watchlist-btn {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
    color: #7c3aed;
}

.add-watchlist-btn:hover {
    background: rgba(124, 58, 237, 0.2);
    border-color: rgba(124, 58, 237, 0.5);
}

/* No Results */
.no-results,
.search-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
}

.no-results svg,
.search-error svg {
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 24px;
}

.no-results h3,
.search-error h3 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px 0;
}

.no-results p,
.search-error p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    margin: 0 0 8px 0;
}

.no-results-suggestion {
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    margin-bottom: 24px !important;
}

/* Tablet (iPad) Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    .results-title {
        font-size: 24px;
    }

    .fund-card {
        padding: 20px;
    }

    .fund-metrics {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-value {
        font-size: 26px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
    }

    .results-actions {
        width: 100%;
    }

    .export-btn,
    .close-results-btn {
        flex: 1;
    }

    .fund-card-header {
        flex-wrap: wrap;
    }

    .fund-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .fund-actions {
        flex-direction: column;
    }

    .fund-action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .results-title {
        font-size: 22px;
    }

    .fund-rank {
        min-width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .fund-name {
        font-size: 16px;
    }

    .fund-metrics {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
.fund-action-btn:focus-visible {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* Aggregate Stats Summary Bar (shown with regular results) */
.aggregate-stats-summary {
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(0, 212, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.summary-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
}

.summary-value {
    color: #00d4ff;
    font-size: 22px;
    font-weight: 700;
}

/* Aggregate Results Card */
.aggregate-results {
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.aggregate-stats-card {
    background: rgba(10, 14, 39, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
}

.aggregate-stats-card h3 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 16px;
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 6px;
}

.stat-value {
    color: #00d4ff;
    font-size: 28px;
    font-weight: 700;
}

.filter-applied {
    display: inline-block;
    padding: 10px 16px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    color: #7c3aed;
    font-size: 14px;
    margin-bottom: 16px;
}

.aggregate-note {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin: 16px 0 0 0;
    font-style: italic;
}

/* Responsive Aggregate Stats */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .aggregate-stats-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .search-results-wrapper,
    .fund-card,
    .fund-action-btn,
    .export-btn,
    .close-results-btn,
    .aggregate-results,
    .stat-item {
        transition: none;
        animation: none;
    }

    .fund-card:hover,
    .stat-item:hover {
        transform: none;
    }
}
