/* CSS Variables */
:root {
    --primary-color: #007bff;
    --text-muted-color: #999;
}

/* Player Comparison Specific Styles */
.player-comparison {
    padding: 20px;
}

.player-comparison .page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 10px;
}

.player-comparison h1 {
    text-align: center;
    margin: 0;
    padding: 0;
    font-family: 'Lexend', 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    color: #ffffff;
}

.player-comparison .subheader {
    text-align: center;
    color: var(--text-muted-color);
    margin: 2px 0 20px 0;
}

/* Battle Selection Container */
.battle-selection-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.battle-selection-container h3 {
    color: #ffffff;
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
}

/* Player Selection Container */
.player-selection-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.player-selection-row {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.player-selection-group {
    flex: 1;
    margin-bottom: 0;
}

.player-selection-group h3 {
    color: #ffffff;
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.selection-row {
    display: flex;
    align-items: flex-end;  /* Align to bottom to match select elements */
    gap: 15px;
    flex-wrap: wrap;
}

.selector-group {
    flex: 1;
    min-width: 120px;
}

.selector-group.clan-selector {
    flex: 0 0 100px;  /* Fixed width for clan selector */
}

.selector-label {
    font-size: 0.8em;
    color: var(--text-muted-color);
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selector-value select {
    width: 100%;
    padding: 8px 12px;
    background-color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.9em;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

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

.selector-value select:disabled {
    background-color: #2a2a2a;
    color: #666;
    cursor: not-allowed;
}

.add-player-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.add-player-btn:hover:not(:disabled) {
    background-color: #0056b3;
}

.add-player-btn:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
}

/* Compare Section */
.compare-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.compare-btn {
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.compare-btn:hover:not(:disabled) {
    background-color: #218838;
}

.compare-btn:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
}

.clear-btn {
    padding: 12px 24px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.clear-btn:hover {
    background-color: #c82333;
}

/* Selected Players Display */
.selected-players-container {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.selected-players-container h3 {
    color: #ffffff;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
}

.selected-players-list {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.selected-player {
    flex: 1;
    min-width: 200px;
    background-color: #3a3a3a;
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
}

.selected-player.empty {
    border-left-color: #666;
    color: #999;
    font-style: italic;
}

.selected-player h4 {
    margin: 0 0 5px 0;
    color: #ffffff;
    font-size: 1em;
}

.selected-player p {
    margin: 0;
    color: var(--text-muted-color);
    font-size: 0.9em;
}

/* Chart Section - Reusing member details styles */
/* Stats Cards */
.player-comparison .stats-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 20px 0 10px 0;
    width: 100%;
}

.player-comparison .stat-card {
    flex: 1 1 0;
    min-width: 0;
    background-color: #2a2a2a;
    border-radius: 5px;
    padding: 8px 20px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.player-comparison .stat-card h5 {
    color: #FFCC00;
    font-size: 0.9em;
    text-transform: uppercase;
    margin-bottom: 5px;
    text-align: center;
}

.player-comparison .stat-card p {
    color: #e0e0e0;
    font-size: 1.6em;
    margin: 0;
    text-align: center;
    line-height: 0.9;
    min-height: 2.4em;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player-comparison .chart-section {
    background-color: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.player-comparison .chart-section h5 {
    color: #ffffff;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
}

.player-comparison .chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 15px;
    background-color: #2a2a2a;  /* Match page background grey */
    border-radius: 6px;
    padding: 10px;
}

.player-comparison .chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart Controls */
.player-comparison .chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Chart section specific controls - vertical layout */
.player-comparison .chart-section .chart-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Range Slider */
#comparison-range-slider {
    flex: 1;
    min-width: 200px;
    margin: 0 15px;
}

/* noUiSlider custom styling */
.noUi-target.noUi-ltr.noUi-horizontal {
    background: #2a2a2a;
    border: none !important;
    box-shadow: none !important;
    height: 5px;
    border-radius: 2.5px;
}

.noUi-connects {
    background: #2a2a2a;
    border-radius: 2.5px;
    height: 5px !important;
}

.noUi-connect {
    background: #4a4a4a !important;  /* Changed to a medium grey for the bar */
}

/* Base and origin styling */
.noUi-base {
    background: #2a2a2a !important;
    border-radius: 2.5px !important;  /* Added to match target */
}

.noUi-origin {
    background: #2a2a2a !important;
    border-radius: 2.5px !important;  /* Added to match target */
}

/* Handle styling - consolidated */
.noUi-handle {
    width: 28px !important;
    height: 28px !important;
    right: -14px !important;
    top: -11.5px !important;
    background: #666666 !important;  /* Changed to a lighter grey for handles */
    border: 2px solid #2a2a2a !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    cursor: grab;
    outline: 2px solid rgba(102, 102, 102, 0.3);  /* Matching outline color */
    outline-offset: 2px;
}

/* Extended click target */
.noUi-handle:before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: transparent;
}

.noUi-handle:after {
    display: none;
}

.noUi-handle:active {
    cursor: grabbing;
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.3);
}

/* Hide time labels */
.player-comparison .time-labels {
    display: none;
}

/* Control Buttons */
.player-comparison .control-btn {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.player-comparison .control-btn:hover {
    background-color: #3a3a3a;
    border-color: #4a4a4a;
}

.player-comparison .chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

#comparison-range-slider {
    width: 90%;  /* Match member details slider width */
    margin: 20px auto;  /* Center the slider like member details */
}

.player-comparison .time-labels {
    display: flex;
    gap: 20px;
    color: var(--text-muted-color);
    font-size: 0.9em;
    min-width: 200px;
    justify-content: center;
}

.player-comparison .control-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.player-comparison .control-btn:hover {
    background-color: #0056b3;
}

/* Toggle switch styles */
.player-comparison .view-toggle-container {
    display: inline-block;
    margin: 0;
    text-align: center;
}

.player-comparison .switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-right: 5px;
}

.player-comparison .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.player-comparison .switch .slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: .4s;
    vertical-align: middle;
    cursor: pointer;
    margin: 0 5px;
}

.player-comparison .switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

.player-comparison .switch input:checked + .slider {
    background-color: #2196F3;
}

.player-comparison .switch input:checked + .slider:before {
    transform: translateX(20px);
}

.player-comparison .toggle-label {
    font-size: 14px;
    vertical-align: middle;
}

.player-comparison .toggle-label.left {
    margin-right: 5px;
}

.player-comparison .toggle-label.right {
    margin-left: 5px;
}

/* Footer */
.player-comparison .footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.player-comparison .back-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.player-comparison .back-button:hover {
    background-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .selection-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .selector-group {
        min-width: auto;
    }
    
    .add-player-btn {
        align-self: center;
        width: auto;
    }
    
    .compare-section {
        flex-direction: column;
        align-items: center;
    }
    
    .selected-players-list {
        flex-direction: column;
    }
    
    .player-comparison .chart-controls {
        flex-direction: column;
        align-items: center;
    }
    
    #comparison-range-slider {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .player-comparison {
        padding: 10px;
    }
    
    .player-selection-container,
    .selected-players-container,
    .player-comparison .chart-section {
        padding: 15px;
    }
} 