:root {
    --primary-color: #031F73; /* University of Liverpool Blue */
    --secondary-color: #00b4d8; /* Tech/AI Accent */
    --background-color: #f4f7f6;
    --text-color: #333333;
    --card-bg: #ffffff;
    --link-color: #0056b3;
    --border-color: #e1e4e8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Banner Styling --- */
.banner-container {
    width: 100%;
    background-color: var(--primary-color);
}

.main-banner {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

/* --- Header Styling --- */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    border-bottom: 4px solid var(--secondary-color);
}

.module-code {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
    letter-spacing: 0.5px;
}

header p {
    font-size: 1.1rem;
    margin-top: 10px;
    opacity: 0.9;
}

/* --- Main Layout --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
    margin-top: 0;
}

/* --- About/Preamble Section --- */
.emphasis-box {
    background-color: #f0f4fa; /* Very light blue */
    border-left: 5px solid var(--primary-color);
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.emphasis-box h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.emphasis-box p:last-child {
    margin-bottom: 0;
}

.emphasis-box code {
    background-color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95em;
    color: #d90429;
}

/* --- Resources Grid --- */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.resource-item {
    text-decoration: none;
    padding: 1.2rem;
    border-radius: 6px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
}

.resource-item strong {
    font-size: 1.05rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.resource-item span {
    font-size: 0.85rem;
    color: #64748b;
}

.resource-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 4px 8px rgba(0, 180, 216, 0.1);
    transform: translateY(-2px);
}

/* --- Leaderboard Styles --- */
.subtitle {
    color: #64748b;
    margin-top: -10px;
    margin-bottom: 20px;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

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

th {
    background-color: var(--primary-color);
    color: white;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #f8fafc;
}

.rank {
    font-weight: bold;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* Special Styling for Top 3 */
tr.top-rank td {
    font-weight: 500;
}

tr.top1 .rank { color: #d4af37; } /* Gold */
tr.top2 .rank { color: #9ca3af; } /* Silver */
tr.top3 .rank { color: #b08d57; } /* Bronze */

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: #64748b;
    background-color: #e2e8f0;
}

footer strong {
    color: var(--primary-color);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    header { padding: 2rem 1rem; }
    header h1 { font-size: 2rem; }
    .container { padding: 1rem; }
    .card { padding: 1.5rem; }
}