:root {
    --bg: #f0f7f4;
    --fg: #333;
    --primary: #00a860;
    --primary-hover: #008a4e;
    --card-bg: #f8fcfa;
    --border: #d4e8df;
    --muted: #666;
}

* {
    box-sizing: border-box;
}

body {
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: var(--bg);
    color: var(--fg);
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

body > h1 {
    margin-top: 0;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-title {
    font-size: 1.1rem;
    margin: 0;
}

.card p {
    margin: 0;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
}

input[type="text"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button,
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

button:hover,
.btn:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--muted);
}

.btn-secondary:hover {
    background: #555;
}

.address-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.address-list li {
    border-bottom: 1px solid var(--border);
}

.address-list li:last-child {
    border-bottom: none;
}

.address-list a {
    display: block;
    padding: 1rem;
    color: var(--fg);
    text-decoration: none;
}

.address-list a:hover {
    background: var(--bg);
}

.address-uprn {
    font-size: 0.875rem;
    color: var(--muted);
}

.collection-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.collection-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.collection-item:first-child {
    padding-top: 0;
}

.collection-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.collection-emoji {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.collection-name {
    font-weight: 500;
}

.collection-date {
    color: var(--muted);
    font-size: 0.875rem;
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.muted {
    color: var(--muted);
    font-size: 0.875rem;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline;
}

.htmx-request.htmx-indicator {
    display: inline;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--muted);
}

/* UPRN page specific styles */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

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

.loading-hint {
    margin: 0.75rem 0 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    font-style: italic;
}

.config-section summary {
    cursor: pointer;
    color: var(--primary);
    font-size: 0.875rem;
}

.config-section summary:hover {
    text-decoration: underline;
}

.config-section a {
    display: block;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
}

.config-section a:hover {
    text-decoration: underline;
}

.config-options {
    margin: 1rem 0;
}

.config-option {
    margin-bottom: 1rem;
}

.config-option:last-child {
    margin-bottom: 0;
}

.config-option label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.config-option select {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
    background: var(--card-bg);
}

.config-option input[type="checkbox"] {
    margin-right: 0.5rem;
}

.config-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    font-weight: normal;
    margin-bottom: 0;
}

.footer-links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: #999;
}

.footer-links a,
.footer-links a:visited {
    color: #999;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--muted);
}
