* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: #eee;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #00d4ff;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1rem;
    color: #aaa;
}

/* Navigation */
.main-nav {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.main-nav a {
    color: #aaa;
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 25px;
    background: #0f3460;
    transition: all 0.3s;
    font-weight: 600;
}

.main-nav a:hover {
    background: #1a4a7a;
    color: #fff;
}

.main-nav a.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
}

main {
    max-width: 1400px;
    margin: 0 auto;
}

section {
    background: #16213e;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
}

h2 {
    font-size: 1.8rem;
    color: #00d4ff;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.4rem;
    color: #00d4ff;
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ddd;
}

select, input[type="date"] {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    background: #0f3460;
    border: 1px solid #00d4ff;
    border-radius: 4px;
    color: #fff;
}

select:focus, input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 5px rgba(0, 212, 255, 0.5);
}

#position-radios {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

#position-radios label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

#position-radios input[type="radio"] {
    accent-color: #00d4ff;
    width: 18px;
    height: 18px;
}

button {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    background: #00d4ff;
    color: #1a1a2e;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

button:hover {
    background: #00ffff;
    transform: translateY(-2px);
}

button:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

#loading, #heatmap-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: #0f3460;
    border-radius: 4px;
    color: #00d4ff;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #0f3460;
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#error {
    margin-top: 15px;
    padding: 15px;
    background: #ff4444;
    color: #fff;
    border-radius: 4px;
    text-align: center;
}

.hidden {
    display: none !important;
}

#results {
    animation: fadeIn 0.5s;
}

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

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

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #0f3460;
}

th {
    background: #0f3460;
    color: #00d4ff;
    font-weight: 700;
}

td {
    background: #16213e;
}

tr:hover td {
    background: #1e2a47;
}

.rank-note {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

/* Style tabs for heatmap */
.style-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.style-tab {
    width: auto;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    background: #0f3460;
    color: #aaa;
    border: 2px solid #0f3460;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0;
}

.style-tab:hover {
    background: #1a4a7a;
    color: #fff;
    transform: none;
}

.style-tab.active {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #1a1a2e;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.style-tab.active:hover {
    background: linear-gradient(135deg, #00ffff 0%, #00bbee 100%);
}

.heatmap-wrapper {
    position: relative;
    background: #0f3460;
    border-radius: 8px;
    padding: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#heatmap-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

#heatmap-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 52, 96, 0.9);
    padding: 20px 30px;
    border-radius: 8px;
}

footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        min-width: 100%;
    }
}
