/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.summary-update {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    margin-bottom: 30px;
}

.summary-update h2 {
    color: #1a1a1a;
    margin-bottom: 15px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.summary-update ul {
    margin: 0;
    padding-left: 20px;
}

.summary-update li {
    margin-bottom: 8px;
    color: #1a1a1a;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

header h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 700;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 400;
}

/* Sections */
.intro-section,
.mode-toggle-section,
.controls-section,
.live-data-section,
.output-section,
.bracket-section {
    background: #ffffff;
    margin-bottom: 25px;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.intro-section h2,
.mode-toggle-section h2,
.controls-section h2,
.live-data-section h2,
.output-section h2,
.bracket-section h2 {
    color: #1a1a1a;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 600;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.live-note {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.live-note p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Permutation Chart Section */
.permutation-section {
    background: #ffffff;
    margin-bottom: 25px;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
}

.permutation-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-style: italic;
}

.chart-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.chart-btn {
    padding: 12px 24px;
    border: 2px solid #1a1a1a;
    background: #1a1a1a;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.chart-btn:hover {
    background: #333333;
    border-color: #333333;
    transform: translateY(-2px);
}

.chart-btn.secondary {
    background: transparent;
    color: #1a1a1a;
    border-color: #1a1a1a;
}

.chart-btn.secondary:hover {
    background: #1a1a1a;
    color: white;
}

.chart-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.chart-info {
    background: rgba(26, 26, 26, 0.1);
    border: 1px solid rgba(26, 26, 26, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.chart-info h4 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.chart-info p {
    margin: 5px 0;
    color: #495057;
    font-size: 0.9rem;
}

/* Permutation Table */
.permutation-table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.permutation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.permutation-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    padding: 15px 12px;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
}

.permutation-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.permutation-table tbody tr:hover {
    background: rgba(26, 26, 26, 0.05);
}

.permutation-table .team-name {
    font-weight: 600;
    color: #1a1a1a;
    text-align: left;
    padding-left: 20px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.permutation-table .percentage {
    font-weight: 600;
    color: #495057;
}

.permutation-table .percentage.high {
    color: #28a745;
}

.permutation-table .percentage.medium {
    color: #ffc107;
}

.permutation-table .percentage.low {
    color: #dc3545;
}

.permutation-info {
    background: rgba(26, 26, 26, 0.1);
    border: 1px solid rgba(26, 26, 26, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.permutation-info h4 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
}

.permutation-info p {
    margin: 5px 0;
    color: #495057;
    font-size: 0.9rem;
}

.intro-section ul {
    margin: 15px 0;
    padding-left: 20px;
}

.intro-section li {
    margin-bottom: 8px;
}

/* Preset Scenarios */
.preset-scenarios {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e1e5e9;
}

.preset-scenarios h3 {
    color: #1a1a1a;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.preset-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 12px 20px;
    border: 2px solid #1a1a1a;
    background: #1a1a1a;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.preset-btn:hover {
    background: #333333;
    border-color: #333333;
    transform: translateY(-2px);
}

.preset-btn.secondary {
    background: transparent;
    color: #1a1a1a;
    border-color: #1a1a1a;
}

.preset-btn.secondary:hover {
    background: #1a1a1a;
    color: white;
}

/* Sliders */
.sliders-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.slider-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    transition: all 0.3s ease;
}

.slider-group:hover {
    border-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 26, 26, 0.2);
}

.series-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.series-title {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1.1rem;
    text-align: center;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.team-logo {
    font-size: 1.5rem;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.team-name {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 1rem;
    min-width: 80px;
    text-align: center;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.slider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    transition: all 0.3s ease;
    position: relative;
}

.slider::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        transparent 24%, 
        #666 25%, 
        transparent 26%, 
        transparent 49%, 
        #666 50%, 
        transparent 51%, 
        transparent 74%, 
        #666 75%, 
        transparent 76%, 
        transparent 100%);
    pointer-events: none;
}

.slider::after {
    content: '1 0';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    font-size: 10px;
    color: #666;
    text-align: center;
    letter-spacing: 0.8em;
    pointer-events: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
    background: #333333;
    transform: scale(1.1);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a1a1a;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-info {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.team-record {
    flex: 1;
    text-align: center;
}

.series-record {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.current-record {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.simulated-record {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: 600;
}

/* Dropdowns */
.dropdowns-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.dropdown-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-group label {
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.dropdown-group select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.dropdown-group select:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

/* Output Table */
.output-subtitle {
    color: #6c757d;
    margin-bottom: 20px;
    font-style: italic;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#output-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

#output-table th {
    background: #f8f9fa;
    color: #1a1a1a;
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid #e1e5e9;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

#output-table td {
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
    transition: background-color 0.3s ease;
}

#output-table tbody tr:hover {
    background-color: #f8f9fa;
}

#output-table tbody tr:last-child td {
    border-bottom: none;
}

/* Team-specific styling */
.team-name {
    font-weight: 600;
}

.record {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.outcome {
    font-weight: 500;
}

.outcome.division-winner {
    color: #28a745;
}

.outcome.wildcard {
    color: #007bff;
}

.outcome.eliminated {
    color: #dc3545;
}

/* Bracket */
.bracket-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.bracket-matchup {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
    text-align: center;
}

.bracket-matchup h3 {
    color: #1a1a1a;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.bracket-matchup .date {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.bracket-matchup .teams {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.bracket-matchup .team {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bracket-matchup .team.home {
    background: #e3f2fd;
    color: #1976d2;
}

.bracket-matchup .team.away {
    background: #fff3e0;
    color: #f57c00;
}

.bracket-matchup .vs {
    font-weight: 700;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .sliders-container {
        grid-template-columns: 1fr;
    }
    
    .dropdowns-container {
        grid-template-columns: 1fr;
    }
    
    .bracket-container {
        grid-template-columns: 1fr;
    }
}

/* League Toggle */
.league-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.league-btn {
    padding: 12px 24px;
    border: 2px solid #e1e5e9;
    background: white;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-size: 1rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.league-btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.league-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.mode-btn {
    padding: 12px 24px;
    border: 2px solid #e1e5e9;
    background: white;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.mode-btn:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.mode-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

.mode-description {
    color: #6c757d;
    font-style: italic;
    margin: 0;
}

/* Live Data Section */
.live-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
}

.last-updated {
    font-weight: 600;
    color: #1a1a1a;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.auto-refresh label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.auto-refresh input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1a1a1a;
}

.live-games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.live-game {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e5e9;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.live-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.live-game h3 {
    color: #1a1a1a;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.game-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-badge {
    background: #dc3545;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.final-badge {
    background: #28a745;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.game-status .time {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.game-status .inning {
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 600;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e1e5e9;
}

.game-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.team-score {
    text-align: center;
    flex: 1;
    padding: 15px;
    border-radius: 12px;
    position: relative;
}

.team-score.away {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.team-score.home {
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.3);
}

.team-score .team-name {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.team-score .score {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1;
}

.team-score.away .score {
    color: #fd7e14;
}

.team-score.home .score {
    color: #0d6efd;
}

.vs {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 0 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.game-details {
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 10px;
    font-weight: 500;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-top: 2px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin: 10px 0;
}

/* Timestamp Section */
.timestamp-section {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    background: rgba(26, 26, 26, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(26, 26, 26, 0.1);
}

.current-as-of {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

.current-as-of span {
    font-weight: 600;
    color: #1a1a1a;
}

/* Hidden elements */
.hidden {
    display: none !important;
}
