/* Basic functional styling for the top1m rankings site */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

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

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

header h1 a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.8em;
    font-weight: normal;
}

header h1 a:hover {
    text-decoration: underline;
}

header h2 {
    color: #495057;
    font-weight: normal;
}

.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    align-items: end;
}

.controls > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.controls label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9em;
}

.controls select,
.controls input {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.controls input:focus,
.controls select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

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

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
}

.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.sortable:hover {
    background-color: #e9ecef;
}

.sort-indicator {
    color: #007bff;
    font-weight: bold;
    margin-left: 4px;
}

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

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

td a {
    color: #007bff;
    text-decoration: none;
}

td a:hover {
    text-decoration: underline;
}

.chart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    height: 400px;
}

.domain-info {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

.domain-stats h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.domain-stats ul {
    list-style: none;
    margin-bottom: 20px;
}

.domain-stats li {
    padding: 5px 0;
    border-bottom: 1px solid #f1f3f4;
}

.domain-stats li:last-child {
    border-bottom: none;
}

.domain-stats strong {
    color: #495057;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls > div {
        width: 100%;
    }
    
    .controls select,
    .controls input {
        min-width: auto;
        width: 100%;
    }
    
    .chart-container {
        height: 300px;
    }
    
    table {
        font-size: 0.9em;
    }
    
    th, td {
        padding: 8px 12px;
    }
}

.link {
    border: 1px solid #007bff;
    padding: 2px 4px;
    border-radius: 4px;
    margin-right: 4px;
    text-decoration: none;
    color: #007bff;
    font-size: 0.8em;
}

.link:hover {
    background-color: #007bff;
    color: white;
}