/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1f2937;
    background-color: #f9fafb;
}

/* Header */
header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.last-updated {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-refresh {
    background: #2563eb;
    color: white;
}

.btn-refresh:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Tabs */
.tabs {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 1rem 1.5rem;
    color: #6b7280;
    font-weight: 500;
}

.tab-btn:hover {
    color: #2563eb;
    background: #f3f4f6;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Filters */
.filters {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    flex: 1;
    min-width: 150px;
}

.filters input:focus,
.filters select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Content Area */
.content {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

/* Error State */
.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.375rem;
    margin: 1rem;
}

/* Empty State */
.empty {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background: #f3f4f6;
}

th.sortable::after {
    content: ' ↕';
    color: #d1d5db;
}

th.sort-asc::after {
    content: ' ↑';
    color: #2563eb;
}

th.sort-desc::after {
    content: ' ↓';
    color: #2563eb;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-win {
    background: #d1fae5;
    color: #065f46;
}

.badge-loss {
    background: #fee2e2;
    color: #991b1b;
}

/* Pagination */
.pagination {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.pagination-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .tabs {
        padding: 0 1rem;
        overflow-x: auto;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }

    .container {
        padding: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters select {
        width: 100%;
        min-width: 0;
    }

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
}
