body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

html {
    background-color: #f5f5f5;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

form {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
}

button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background: #0056b3;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#loading {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

#resultsCount {
    margin: 10px 0;
    color: #666;
    font-weight: bold;
}

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

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

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

tr {
    cursor: pointer;
}

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

.code-cell {
    font-weight: bold;
    color: #007bff;
    font-family: monospace;
}

.chapter-code {
    color: #28a745;
}

.desc-cell {
    color: #333;
}

.level-cell {
    text-transform: uppercase;
    font-size: 12px;
    color: #666;
}

.unit-cell {
    font-size: 14px;
    color: #666;
}

#error {
    display: none;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

#results {
    display: none;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.footer button {
    margin: 0 10px;
    background: #6c757d;
}

.footer button:hover {
    background: #5a6268;
}

.chapter-row {
    font-weight: 500;
}

.back-button {
    background: #f8f9fa;
    text-align: center;
    font-weight: bold;
    color: #007bff;
    cursor: pointer;
}

.back-button:hover {
    background: #e9ecef;
}

.stats-display {
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

.stat-value {
    font-weight: bold;
    color: #007bff;
}