/* ============================================
   FPL HUB - ROTATION PLANNER PAGE STYLES
   Extracted from fpl_rotation_planner_v2.html
   Monochrome palette — no accent/teal colours
   ============================================ */

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

/* Header */
.rotation-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.rotation-header h1 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.035em;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rotation-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Search Section */
.search-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.search-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: border-color var(--transition-fast);
}

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

/* Selected Players */
.selected-players {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.player-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.player-chip-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.player-chip-remove:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

/* Fixtures Table */
.fixtures-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

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

.fixtures-table thead th {
    background: var(--bg-secondary);
    padding: 12px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.fixtures-table thead th:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-secondary);
    z-index: 10;
    min-width: 200px;
}

.fixtures-table thead th:not(:first-child) {
    text-align: center;
}

.fixtures-table tbody td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.fixtures-table tbody td:not(:first-child) {
    text-align: center;
}

.fixtures-table tbody td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-primary);
    z-index: 5;
}

.fixtures-table tbody tr:hover td {
    background: var(--bg-secondary);
}

.fixtures-table tbody tr:hover td:first-child {
    background: var(--bg-secondary);
}

/* Player Info Cell */
.player-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}

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

/* Fixture Cell */
.fixture-cell {
    text-align: center;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 75px;
}

.fixture-opponent {
    font-weight: 500;
    font-size: 12px;
    margin-bottom: 3px;
}

.fixture-venue {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 5px;
}

.fixture-difficulty {
    font-size: 12px;
    font-weight: 600;
}

/* Difficulty Colors - Red to Green Scale */
.difficulty-elite {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.difficulty-excellent {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.difficulty-good {
    background: #FFF9C4;
    color: #F57F17;
    border: 1px solid #FFF59D;
}

.difficulty-average {
    background: #FFE0B2;
    color: #E65100;
    border: 1px solid #FFCC80;
}

.difficulty-tough {
    background: #FFCCBC;
    color: #D84315;
    border: 1px solid #FFAB91;
}

.difficulty-difficult {
    background: #FFCDD2;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.fixture-cell:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 32px;
}

.empty-state-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0.4;
}

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

.empty-state p {
    color: var(--text-tertiary);
    font-size: 13px;
}

/* Player Images in Table */
.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    object-fit: cover;
}

.player-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Metric Controls */
.metric-controls {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.metric-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.metric-btn {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font-family);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.metric-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.metric-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* Legend */
.legend {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 0;
    padding: 0;
}

.legend-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-items {
    display: flex;
    gap: 14px;
}

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

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

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

.autocomplete-item:hover {
    background: var(--bg-secondary);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
}

.autocomplete-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .rotation-header h1 {
        font-size: 20px;
    }

    .container {
        padding: 0 12px;
    }

    .search-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .metric-controls {
        padding: 14px;
        margin-bottom: 16px;
    }

    .metric-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .legend {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .legend-items {
        flex-wrap: wrap;
        gap: 10px;
    }

    .legend-item {
        font-size: 10px;
    }

    /* Sticky player column on mobile */
    .fixtures-table thead th:first-child,
    .fixtures-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 10;
        background: var(--bg-primary);
        min-width: 120px;
    }

    .fixtures-table thead th:first-child {
        background: var(--bg-secondary);
    }

    /* More compact fixture cells */
    .fixture-cell {
        padding: 8px 6px;
        min-width: 70px;
        border-radius: 4px;
    }

    .fixture-opponent {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .fixture-venue {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .fixture-difficulty {
        font-size: 11px;
        font-weight: 600;
    }

    .player-name {
        font-size: 12px;
    }

    .player-meta {
        font-size: 10px;
    }

    .fixtures-table thead th {
        padding: 10px 8px;
        font-size: 10px;
    }

    .fixtures-table tbody td {
        padding: 10px 8px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .player-image {
        width: 28px;
        height: 28px;
    }
}
