/* =============================================================================
   results-display.css - Results Display Component Styles
   ============================================================================= */

/* Results Container */
.results-container {
    display: none;
    grid-column: 1 / -1;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.results-grid.compact .metric-card {
    padding: 10px;
}

.results-grid.compact .metric-value {
    font-size: 1.1em;
}

/* Metric Card Component */
.metric-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s ease;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-card:hover {
    transform: translateY(0px);
}

.metric-card.positive {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
}

.metric-card.negative {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
}

.metric-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 4px;
}

.metric-label {
    color: #718096;
    margin-top: 5px;
    font-size: 0.70em;
    line-height: 1.2;
}

/* Results Controls */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.view-controls, 
.export-controls {
    display: flex;
    gap: 8px;
}

.filter-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #585858;
}

.sort-select {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* Results Table Component */
.results-table-container {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - 325px);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.results-table {
    flex: 1;
    min-height: 0;
    overflow: auto;
    background: white;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.results-table td,
.results-table th {
    word-wrap: break-word;
    overflow: hidden;
}

.results-table th {
    background: #585858;
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table td {
    padding-left: 12px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.results-table tr:hover {
    background: #f7fafc;
}

.results-table tr.profitable-row {
    background: rgba(72, 187, 120, 0.1);
}

.results-table tr.loss-row {
    background: rgba(245, 101, 101, 0.1);
}

.results-table tr.error-row {
    background: rgba(237, 137, 54, 0.1);
}

.results-table .positive {
    color: #22543d;
    font-weight: 600;
}

.results-table .negative {
    color: #c53030;
    font-weight: 600;
}

/* Sortable Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.sortable-header:hover {
    text-decoration: underline;
}

.sortable-header:active {
    text-decoration: underline;
    font-weight: 700;
}

/* Table Pagination */
.table-pagination {
    flex-shrink: 0;
    padding: 15px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

/* Actions Cell */
.actions-cell {
    position: relative;
    white-space: nowrap;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.no-results h3 {
    margin-bottom: 10px;
    color: #4a5568;
}

/* Results Summary */
.results-summary {
    flex-shrink: 0;
}

/* Results Controls */
.results-controls {
    flex-shrink: 0;
}

/* Pagination Section */
.pagination-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.pagination-info {
    color: #718096;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
}

.pagination-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: #585858;
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}