body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 20px;
    padding: 0 20px;
    background-color: #f5f5f5;
    color: #333;
    max-width: 800px;
}

h1 {
    color: #333;
    border-bottom: 3px solid #4CAF50;
    padding-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th {
    background-color: #4CAF50;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
    vertical-align: bottom;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
}

tr:hover {
    background-color: #f5f5f5;
}

tr:last-child td {
    border-bottom: none;
}

.rating {
    font-weight: bold;
    color: #2196F3;
}

.rd {
    color: #666;
}

.change-positive {
    color: #4CAF50;
    font-weight: bold;
}

.change-negative {
    color: #f44336;
    font-weight: bold;
}

.change-new {
    color: #2196F3;
    font-weight: bold;
    font-size: 1.2em;
}

.change-none {
    color: #333;
}

.venue-info {
    background-color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 0.9em;
}

.venue-info h3 {
    margin-top: 0;
    color: #4CAF50;
}

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

.venue-table td {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.venue-table tr:last-child td {
    border-bottom: none;
}

.venue-name-col {
    font-weight: bold;
    width: 50%;
}

.venue-address-col {
    color: #666;
    font-size: 0.9em;
    width: 50%;
}

.ratings-info {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.ratings-info a {
    color: #4CAF50;
    text-decoration: none;
}

.related-communities {
    background-color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.related-communities h3 {
    margin-top: 0;
    color: #4CAF50;
}

.community-button {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.community-button:hover {
    background-color: #45a049;
}

.search-container {
    background-color: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#searchInput {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: white;
    color: #333;
}

#searchInput:focus {
    outline: none;
    border-color: #4CAF50;
}

#results {
    margin-top: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.result-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.result-item:hover {
    background-color: #f5f5f5;
}

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

.player-name {
    font-weight: bold;
    color: #333;
}

.player-id {
    color: #666;
    font-size: 0.9em;
    margin-left: 10px;
}

.no-results {
    padding: 12px;
    color: #666;
    font-style: italic;
}

a {
    color: #4CAF50;
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    h1 {
        color: #e0e0e0;
        border-bottom: 3px solid #66BB6A;
    }
    table {
        background-color: #2d2d2d;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
        color: #e0e0e0;
    }
    th {
        background-color: #66BB6A;
    }
    td {
        border-bottom: 1px solid #444;
    }
    tr:hover {
        background-color: #3a3a3a;
    }
    .rating {
        color: #64B5F6;
    }
    .rd {
        color: #aaa;
    }
    .change-positive {
        color: #81C784;
    }
    .change-negative {
        color: #ef5350;
    }
    .change-new {
        color: #64B5F6;
    }
    .change-none {
        color: #e0e0e0;
    }
    .venue-info,
    .related-communities {
        background-color: #2d2d2d;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    .venue-info h3,
    .related-communities h3 {
        color: #66BB6A;
    }
    .venue-table td {
        border-bottom: 1px solid #444;
    }
    .venue-name-col {
        color: #e0e0e0;
    }
    .venue-address-col {
        color: #aaa;
    }
    .ratings-info {
        color: #aaa;
    }
    .ratings-info a {
        color: #66BB6A;
    }
    .community-button {
        background-color: #66BB6A;
    }
    .community-button:hover {
        background-color: #81C784;
    }
    .search-container {
        background-color: #2d2d2d;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    #searchInput {
        background-color: #3a3a3a;
        color: #e0e0e0;
        border: 2px solid #555;
    }
    #searchInput:focus {
        border-color: #66BB6A;
    }
    .result-item {
        border-bottom: 1px solid #444;
    }
    .result-item:hover {
        background-color: #3a3a3a;
    }
    .player-name {
        color: #e0e0e0;
    }
    .player-id {
        color: #aaa;
    }
    .no-results {
        color: #aaa;
    }
    a {
        color: #66BB6A;
    }
}

.search-container label {
   display: block;
   margin-bottom: 8px;
}

.copyright {
   font-size: 14px;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}

th.sortable:hover {
    background-color: #e8e8e8;
}

th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 5px;
    opacity: 0.3;
    font-size: 12px;
}

th.sort-asc::after {
    content: '▲';
    opacity: 1;
}

th.sort-desc::after {
    content: '▼';
    opacity: 1;
}

@media (prefers-color-scheme: dark) {
    th.sortable:hover {
        background-color: #3a3a3a;
    }
}
