:root {
    --primary-color: #2c3e50; /* Dark blue/grey */
    --secondary-color: #3498db; /* Bright blue */
    --accent-color: #e74c3c; /* Red for accents/alerts */
    --light-bg: #ecf0f1; /* Light grey background */
    --dark-text: #34495e; /* Darker text */
    --border-color: #bdc3c7; /* Lighter grey border */
    --header-bg: #212F3D; /* Even darker header */
    --table-header-bg: #34495e;
    --row-hover-bg: #f8f8f8;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--dark-text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    background-color: var(--header-bg);
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0 0 0.5rem;
    font-size: 2.8rem;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0.5rem auto 0;
    opacity: 0.9;
}

main {
    flex-grow: 1;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

#searchInput {
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    max-width: 350px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#searchInput:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.controls button {
    padding: 0.8rem 1.5rem;
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.controls button:hover {
    background-color: #2980b9; /* Darker blue */
    transform: translateY(-1px);
}

.controls button:active {
    transform: translateY(0);
}


.table-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow-x: auto; /* For responsive tables */
}

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

table thead th {
    background-color: var(--table-header-bg);
    color: #fff;
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    user-select: none;
    white-space: nowrap; /* Prevent wrapping in headers */
}

table thead th:hover {
    background-color: #4a6681; /* Slightly lighter on hover */
}

.sort-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.5em;
    vertical-align: middle;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    transition: transform 0.2s ease-in-out;
}

/* Arrow for ascending sort */
th.asc .sort-arrow {
    border-bottom: 5px solid #fff;
    transform: translateY(-2px);
}

/* Arrow for descending sort */
th.desc .sort-arrow {
    border-top: 5px solid #fff;
    transform: translateY(2px);
}

table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tbody tr:hover {
    background-color: var(--row-hover-bg);
    transition: background-color 0.1s ease-in-out;
}

table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
}

table tbody td a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

table tbody td a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.data-source-note {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9em;
    color: #777;
}

footer {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
    font-size: 0.9rem;
}

footer a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    header p {
        font-size: 1rem;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    #searchInput {
        max-width: none;
    }
    table thead th, table tbody td {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 0.8rem;
    }
    header h1 {
        font-size: 1.8rem;
    }
    main {
        padding: 1.5rem 0.8rem;
    }
    .controls button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    .data-source-note {
        font-size: 0.8em;
    }
}