body {
    font-family: Arial, sans-serif;
    margin: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}

th:hover {
    background-color: #e6e6e6;
}

th::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

th.sort-asc::after {
    border-bottom: 5px solid #666;
    border-top: none;
}

th.sort-desc::after {
    border-top: 5px solid #666;
    border-bottom: none;
}

.filters {
    margin-bottom: 20px;
}

.filters label {
    margin-right: 10px;
}

.filters select, .filters input {
    margin-right: 20px;
    padding: 5px;
}

.gkc-container {
    margin: 20px;
    max-width: 1200px;
}

.gkc-container table {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.gkc-container th,
.gkc-container td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.gkc-container th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.gkc-container tr:hover {
    background-color: #f9f9f9;
}

.filters {
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filters label {
    margin-right: 5px;
    font-weight: 600;
    color: #444;
}

.filters select,
.filters input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 120px;
}

.filters input[type="number"] {
    width: 80px;
}

.loading {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    color: #666;
    padding: 20px;
}

.error-message {
    background-color: #fff3f3;
    border: 1px solid #ffcdd2;
    color: #d32f2f;
    padding: 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
}

.gkc-container h1 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f5f5f5;
}

.gkc-container a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

.gkc-container a:hover {
    text-decoration: underline;
}

.data-source {
    margin-top: 15px;
    text-align: right;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.last-updated {
    margin-top: 5px;
    text-align: right;
    color: #666;
    font-size: 12px;
}

/* Loan status styling */
td:nth-child(5) {
    color: #555;
}

td:nth-child(5):contains('On loan') {
    color: #1976d2;
    font-style: italic;
}

.stats-container {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-container h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.5em;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.stat-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.2em;
    color: #212529;
    font-weight: 500;
}

.league-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.league-stat {
    background: #fff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.league-stat-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.league-stat-value {
    color: #212529;
    font-size: 0.9em;
}

.api-status {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.api-status h4 {
    color: #2e7d32;
    margin: 0 0 10px 0;
}

.api-status p {
    margin: 5px 0;
    color: #1b5e20;
}

.filter-status {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
}

.filter-status h4 {
    color: #1976d2;
    margin: 0 0 10px 0;
}

.filter-status ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-status li {
    margin: 5px 0;
    color: #0d47a1;
}

#gk-contracts-container {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Loading Progress */
#loading-progress {
    margin: 20px 0;
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    width: 0;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

.loading-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 5px;
}

.loading-details {
    font-size: 14px;
    color: #888;
    margin-bottom: 10px;
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.filter-group select,
.filter-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group input[type="number"] {
    width: 80px;
}

/* Stats Summary */
.stats-summary {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stats-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.stats-header div {
    font-size: 14px;
    color: #666;
}

.league-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.league-stats div {
    font-size: 13px;
    color: #777;
}

/* Table Styles */
#goalkeeperTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#goalkeeperTable th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #ddd;
    cursor: pointer;
    transition: background-color 0.2s;
}

#goalkeeperTable th:hover {
    background: #e9ecef;
}

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

#goalkeeperTable tr:hover {
    background: #f8f9fa;
}

.no-results {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Error Message */
#error-message {
    padding: 10px 15px;
    margin: 10px 0;
    background: #fee;
    border-left: 4px solid #f44;
    color: #444;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    #goalkeeperTable {
        display: block;
        overflow-x: auto;
    }

    .stats-header {
        grid-template-columns: 1fr;
    }
    
    .league-stats {
        grid-template-columns: 1fr;
    }
}

.data-window-container {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.data-window-container h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 500;
}

.data-window {
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.data-content {
    color: #444;
    line-height: 1.5;
}

.data-content .loading-item {
    padding: 3px 0;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.data-content .loading-item:last-child {
    border-bottom: none;
}

.data-content .success {
    color: #2e7d32;
    font-weight: bold;
}

.data-content .error {
    color: #c62828;
    font-weight: bold;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#goalkeeperTable th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 25px;
    user-select: none;
}

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

.sort-indicator {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
}

#goalkeeperTable th.sort-asc .sort-indicator {
    color: #2196F3;
}

#goalkeeperTable th.sort-desc .sort-indicator {
    color: #2196F3;
} 