* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.contest-selector {
    margin-top: 15px;
}

.contest-selector label {
    font-size: 1.1em;
    margin-right: 10px;
}

.contest-selector select {
    padding: 8px 15px;
    font-size: 1em;
    border-radius: 5px;
    border: none;
    background: white;
    cursor: pointer;
    min-width: 250px;
}

.contest-type-selector {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.contest-type-selector label {
    font-size: 1.1em;
}

.contest-type-selector select {
    padding: 8px 15px;
    font-size: 1em;
    border-radius: 5px;
    border: none;
    background: white;
    cursor: pointer;
}

.main-content {
    padding: 30px;
}

.upload-section {
    text-align: center;
    margin-bottom: 30px;
}

.upload-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background 0.3s;
}

.upload-btn:hover {
    background: #5568d3;
}

#fileName {
    margin-left: 15px;
    font-style: italic;
    color: #666;
}

.lineup-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.player-selection {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.current-lineup {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.position-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
}

.tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.search-section {
    position: relative;
    margin-bottom: 15px;
}

.search-input {
    width: 100%;
    padding: 10px 35px 10px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

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

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 1.2em;
    padding: 5px;
    transition: color 0.3s;
}

.search-clear:hover {
    color: #333;
}

.game-filters {
    margin-bottom: 15px;
}

.game-filter-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.game-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.game-chip {
    padding: 6px 12px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.3s;
}

.game-chip:hover {
    background: #f0f4ff;
    transform: scale(1.05);
}

.game-chip.active {
    background: #667eea;
    color: white;
}

.game-chip.clear-all {
    border-color: #dc3545;
    color: #dc3545;
}

.game-chip.clear-all:hover {
    background: #dc3545;
    color: white;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 15px;
}

.sort-controls label {
    font-weight: 600;
    color: #333;
}

.sort-controls select {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 0.95em;
    cursor: pointer;
    transition: border-color 0.3s;
}

.sort-controls select:hover {
    border-color: #667eea;
}

.sort-controls select:focus {
    outline: none;
    border-color: #667eea;
}

.player-list {
    background: white;
    border-radius: 5px;
    padding: 20px;
    min-height: 400px;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
}

.placeholder-text {
    text-align: center;
    color: #999;
    padding: 50px 20px;
}

.player-item {
    position: relative;
    padding: 12px 15px;
    padding-right: 65px; /* Make room for score badge */
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.player-item:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: translateX(2px);
}

.player-item.over-budget {
    opacity: 0.6;
}

.player-item.over-budget:hover {
    opacity: 0.8;
}

.over-budget-badge {
    display: inline-block;
    margin-right: 4px;
    font-size: 1em;
    cursor: help;
}

/* Mark Out button and marked-out players */
.mark-out-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 8px;
    font-size: 0.75em;
    font-weight: 600;
    border: 1px solid #dc3545;
    background: white;
    color: #dc3545;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
}

.mark-out-btn:hover {
    background: #dc3545;
    color: white;
}

.mark-out-btn.active {
    background: #dc3545;
    color: white;
}

.player-item.marked-out {
    opacity: 0.5;
    background: #f8f8f8;
    pointer-events: none;
}

.player-item.marked-out .mark-out-btn {
    pointer-events: auto; /* Allow clicking button even when card is disabled */
}

.player-name {
    font-weight: bold;
    font-size: 1.05em;
    margin-bottom: 6px;
    color: #333;
}

.player-details {
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 0.85em;
    margin-bottom: 3px;
}

.player-details:last-child {
    margin-bottom: 0;
}

.player-salary {
    font-weight: 600;
    color: #2a5298;
}

.player-avg {
    color: #28a745;
    font-weight: 500;
}

.player-game {
    font-size: 0.8em;
    color: #999;
}

.odds-info {
    color: #667eea;
    font-weight: 500;
    font-size: 0.75em;
    display: block;
    margin-top: 3px;
}

.player-value {
    font-weight: 600;
    color: #ff6b6b;
    font-size: 0.9em;
}

.value-star {
    font-size: 1em;
    margin-left: 5px;
}

.value-excellent {
    background: #fff8e1 !important;
    border-color: #ffd700 !important;
}

.value-excellent:hover {
    background: #fff3cd !important;
    border-color: #ffc107 !important;
}

/* Injury status badges */
.injury-badge {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 5px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: bold;
    color: white;
}

.injury-questionable {
    background: #ffc107;
    color: #000;
}

.injury-doubtful {
    background: #ff9800;
}

.injury-out {
    background: #dc3545;
}

/* Info badge for informational player notes */
.info-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 1em;
    cursor: help;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.info-badge:hover {
    opacity: 1;
}

/* Defense matchup indicators */
.defense-matchup {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 5px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
}

.matchup-good {
    background: #28a745;
    color: white;
}

.matchup-neutral {
    background: #6c757d;
    color: white;
}

.matchup-bad {
    background: #dc3545;
    color: white;
}

/* Performance trend icons */
.trend-icon {
    margin-left: 5px;
    font-size: 1em;
    cursor: help;
}

.trend-icon.hot {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Volume info */
.volume-info {
    color: #667eea;
    font-weight: 600;
    font-size: 0.85em;
    margin-left: 5px;
}

/* Weather icons */
.weather-icon {
    margin-left: 5px;
    font-size: 1em;
    cursor: help;
}

.weather-icon.weather-bad {
    filter: brightness(0.8);
}

/* Overall DFS Score badges - positioned in upper right */
.env-score {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    min-width: 32px;
    text-align: center;
    cursor: help;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.env-excellent {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.env-good {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.env-neutral {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.env-bad {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.current-lineup h2 {
    margin-bottom: 15px;
    color: #333;
}

.lineup-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.action-btn {
    flex: 1;
    padding: 12px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
}

.action-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.secondary {
    background: #6c757d;
}

.action-btn.secondary:hover {
    background: #5a6268;
}

.action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.action-btn.analyze {
    background: #667eea;
}

.action-btn.analyze:hover:not(:disabled) {
    background: #5568d3;
}

.analysis-results {
    background: white;
    border-radius: 5px;
    padding: 15px;
    margin-top: 15px;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.analysis-header h3 {
    margin: 0;
    color: #333;
}

.lineup-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-weight: 600;
    color: #666;
}

.score-value {
    font-size: 1.4em;
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 5px;
}

.score-good {
    background: #28a745;
    color: white;
}

.score-ok {
    background: #ffc107;
    color: #000;
}

.score-bad {
    background: #dc3545;
    color: white;
}

.analysis-section {
    margin-bottom: 15px;
}

.analysis-section h4 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.analysis-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.analysis-section li {
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 4px;
    line-height: 1.5;
}

.red-flags h4 {
    color: #dc3545;
}

.red-flags li {
    background: #ffe6e6;
    border-left: 4px solid #dc3545;
}

.green-flags h4 {
    color: #28a745;
}

.green-flags li {
    background: #e6ffe6;
    border-left: 4px solid #28a745;
}

.analysis-neutral {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.salary-info {
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.salary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.salary-item:last-child {
    margin-bottom: 0;
    font-weight: bold;
    color: #667eea;
}

.lineup-slots {
    background: white;
    padding: 10px;
    border-radius: 5px;
}

.lineup-slot {
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 5px;
    margin-bottom: 8px;
    min-height: 45px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lineup-slot.filled {
    border: 2px solid #667eea;
    background: #f0f4ff;
}

.slot-label {
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
}

.lineup-slot.filled .slot-label {
    display: none;
}

.slot-content {
    flex-grow: 1;
    width: 100%;
}

.slot-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
}

.remove-btn:hover {
    background: #c82333;
}

.captain-badge {
    background: #ffd700;
    color: #333;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: 5px;
}

@media (max-width: 768px) {
    .lineup-container {
        grid-template-columns: 1fr;
    }

    .position-tabs {
        flex-direction: column;
    }

    .tab-btn {
        min-width: auto;
    }
}
