/* =====================================================
   Search Pages Shared Styles
   Styles for MatchupSearch, StandingsSearch,
   TransactionSearch, and RosterSearch pages
   ===================================================== */

/* Filter panels use the shared .flt-* kit in phl-styles.css (Design System §10) */

/* =====================================================
   Preset Links
   ===================================================== */

.preset-links {
    background: rgba(239, 123, 0, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.preset-links-header {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--phl-orange-dark);
    margin-bottom: 0.5rem;
}

.preset-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-link {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    background: white;
    border: 1px solid var(--phl-orange);
    color: var(--phl-orange);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.preset-link:hover {
    background: var(--phl-orange);
    color: white;
    text-decoration: none;
}

/* =====================================================
   Results Section
   ===================================================== */

.search-results-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    background: var(--phl-ink);
    border-bottom: 2px solid var(--phl-orange);
    color: white;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.results-header .results-meta {
    font-size: 0.85rem;
    opacity: 0.9;
}

.results-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.results-controls select {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 4px;
    border: none;
    background: white;
}

/* =====================================================
   Dual Results Grid (Summary + Detail)
   ===================================================== */

.dual-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
}

@media (max-width: 1200px) {
    .dual-results {
        grid-template-columns: 1fr;
    }
}

.results-panel {
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--phl-line);
}

.results-panel-header {
    background: rgba(70, 130, 180, 0.15);
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--phl-blue-dark);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(70, 130, 180, 0.2);
}

.results-panel-body {
    max-height: 500px;
    overflow-y: auto;
}

/* =====================================================
   Search Results Table
   ===================================================== */

.search-results-table {
    width: 100%;
    font-size: 0.85rem;
    margin: 0;
}

.search-results-table thead th {
    position: sticky;
    top: 0;
    background: rgba(239, 123, 0, 0.12);
    color: var(--phl-orange-dark);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.4rem;
    text-align: center;
    border-bottom: 2px solid rgba(239, 123, 0, 0.25);
    z-index: 10;
}

.search-results-table thead th.text-start {
    text-align: left;
    padding-left: 0.75rem;
}

.search-results-table thead th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.search-results-table thead th.sortable:hover {
    background: rgba(239, 123, 0, 0.2);
}

.search-results-table thead th.sortable i {
    margin-left: 0.25rem;
    font-size: 0.65rem;
    opacity: 0.5;
}

.search-results-table thead th.sortable.sorted-asc i,
.search-results-table thead th.sortable.sorted-desc i {
    opacity: 1;
    color: var(--phl-orange);
}

.search-results-table tbody td {
    padding: 0.4rem;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid var(--phl-line-soft);
}

.search-results-table tbody td.text-start {
    text-align: left;
    padding-left: 0.75rem;
}

.search-results-table tbody tr {
    transition: background 0.15s ease;
}

.search-results-table tbody tr:hover {
    background: rgba(239, 123, 0, 0.05);
}

/* Highlight rows */
.search-results-table tbody tr.winner-row {
    background: rgba(40, 167, 69, 0.08);
}

.search-results-table tbody tr.loser-row {
    background: rgba(220, 53, 69, 0.05);
}

/* =====================================================
   Owner Name Links in Tables
   ===================================================== */

.search-results-table .owner-link {
    color: var(--phl-blue);
    text-decoration: none;
    font-weight: 500;
}

.search-results-table .owner-link:hover {
    color: var(--phl-orange);
    text-decoration: underline;
}

/* =====================================================
   Empty/Loading States
   ===================================================== */

.search-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.search-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

.search-empty-state h5 {
    color: #555;
    margin-bottom: 0.5rem;
}

.search-loading-state {
    text-align: center;
    padding: 3rem 1rem;
}

.search-loading-state .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--phl-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* =====================================================
   Pagination
   ===================================================== */

.search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    gap: 0.5rem;
    border-top: 1px solid var(--phl-line);
}

.search-pagination .page-info {
    font-size: 0.85rem;
    color: #666;
    margin: 0 1rem;
}

/* =====================================================
   Responsive Adjustments
   ===================================================== */

@media (max-width: 768px) {
    .results-header {
        flex-direction: column;
        text-align: center;
    }

    .dual-results {
        padding: 0.75rem;
    }

    .search-results-table {
        font-size: 0.75rem;
    }

    .search-results-table thead th,
    .search-results-table tbody td {
        padding: 0.3rem 0.25rem;
    }
}

@media (max-width: 576px) {
    .preset-links-list {
        flex-direction: column;
    }

    .preset-link {
        text-align: center;
    }

    .groupby-options {
        flex-direction: column;
    }
}

/* =====================================================
   Print Styles
   ===================================================== */

@media print {
    .flt-panel {
        display: none;
    }

    .preset-links {
        display: none;
    }

    .search-results-section {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .results-header {
        background: var(--phl-line-soft) !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .search-pagination {
        display: none;
    }
}
