/* ============================================
   FPL HUB - COMPARE PAGE STYLES
   Page-specific styles for FPL player comparison.
   Extends fpl-hub.css design tokens.
   ============================================ */

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 32px 0 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-primary);
}

.page-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* Main Layout */
.compare-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    min-height: calc(100vh - 300px);
}

@media (max-width: 991px) {
    .compare-layout {
        grid-template-columns: 1fr;
    }
}

/* Selection Panel */
.selection-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.panel-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

/* Player Slots */
.slots-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.player-slot {
    background: var(--bg-primary);
    border: 2px dashed var(--border-subtle);
    border-radius: 10px;
    padding: 16px 12px;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.player-slot:hover {
    border-color: var(--text-primary);
    background: var(--bg-tertiary);
}

.player-slot.filled {
    border-style: solid;
    border-color: var(--border-subtle);
    cursor: default;
    position: relative;
}

.player-slot.filled:hover {
    background: var(--bg-primary);
}

/* Player comparison colors */
.player-slot[data-color="1"] { border-left: 4px solid #3b82f6; }
.player-slot[data-color="2"] { border-left: 4px solid #10b981; }
.player-slot[data-color="3"] { border-left: 4px solid #f59e0b; }
.player-slot[data-color="4"] { border-left: 4px solid #ef4444; }

.slot-empty-text {
    font-size: 13px;
    color: var(--text-muted);
}

.slot-player-info {
    text-align: center;
    width: 100%;
}

.slot-player-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-player-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.slot-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--critical);
    color: white;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
}

.player-slot.filled:hover .slot-remove-btn {
    opacity: 1;
}

/* Filters */
.filters-section {
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--font-family);
    background: var(--bg-primary);
    margin-bottom: 12px;
}

.search-input:focus {
    outline: none;
    border-color: var(--text-primary);
}

.filter-row {
    display: flex;
    gap: 8px;
}

.filter-select {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--font-family);
    background: var(--bg-primary);
    cursor: pointer;
}

/* Player List */
.players-list {
    max-height: 400px;
    overflow-y: auto;
}

.player-list-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.player-list-item:hover {
    background: var(--bg-tertiary);
}

.player-list-item.selected {
    opacity: 0.5;
    pointer-events: none;
}

.player-list-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    margin-right: 10px;
    object-fit: cover;
}

.player-list-info {
    flex: 1;
    min-width: 0;
}

.player-list-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-list-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.player-list-price {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Results Panel */
.results-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
}

/* Controls */
.summary-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.control-select {
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-family);
    background: var(--bg-primary);
    cursor: pointer;
    min-width: 120px;
}

.control-select:focus {
    outline: none;
    border-color: var(--text-primary);
}

.trend-note {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.unlock-stats-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.unlock-stats-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
    color: #000;
}

.unlock-stats-link i {
    font-size: 11px;
}

/* Summary Table */
.summary-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table th,
.summary-table td {
    padding: 12px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.summary-table th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--bg-tertiary);
}

.summary-table th:first-child {
    text-align: left;
}

.summary-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.summary-table td {
    font-size: 14px;
}

.player-col {
    min-width: 100px;
}

.player-col-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.player-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stat-best {
    font-weight: 700;
    color: var(--text-primary);
}

/* Charts */
.chart-section {
    margin-bottom: 32px;
}

.chart-container {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 20px;
    min-height: 300px;
    max-width: 100%;
}

.chart-container svg {
    max-width: 100%;
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

/* Loading */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Premium Badge */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

/* Mobile */
@media (max-width: 991px) {
    .selection-panel {
        position: static;
    }

    .slots-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .player-slot {
        min-height: 80px;
        padding: 10px 8px;
    }

    .slot-player-name {
        font-size: 11px;
    }
}

@media (max-width: 576px) {
    .slots-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .compare-controls {
        flex-direction: column;
    }

    .control-group {
        width: 100%;
    }

    .control-select {
        flex: 1;
    }

    .summary-table {
        font-size: 12px;
    }

    .summary-table th,
    .summary-table td {
        padding: 8px;
    }
}

/* D3 Chart Styles */
.chart-bar {
    transition: opacity 0.15s;
}

.chart-bar:hover {
    opacity: 0.8;
}

.chart-axis text {
    font-family: var(--font-family);
    font-size: 11px;
    fill: var(--text-muted);
}

.chart-axis line,
.chart-axis path {
    stroke: var(--border-subtle);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Trend Chart */
.trend-line {
    fill: none;
    stroke-width: 2.5;
}

.trend-dot {
    stroke: white;
    stroke-width: 2;
}

/* Premium Modal */
.premium-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.premium-modal-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    margin: 20px;
    text-align: center;
}

.premium-modal-card h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.premium-modal-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.premium-modal-btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.premium-modal-btn:hover {
    background: var(--text-primary);
    opacity: 0.85;
    color: white;
}

.premium-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
}

.premium-modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.premium-modal-icon i {
    font-size: 24px;
    color: #000;
}

.premium-features-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.premium-features-list li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-features-list li i {
    color: var(--text-primary);
    font-size: 12px;
}
