/* AbfallKI — Responsive CSS (Pico classless als Basis) */

/* === Pico überschreiben === */
:root {
    --pico-font-size: 18px;
    --pico-font-family: system-ui, -apple-system, sans-serif;
    --pico-border-radius: 8px;
    --pico-primary: #059669;
    --pico-primary-hover: #047857;
    --pico-primary-focus: rgba(5, 150, 105, 0.25);
    --pico-primary-inverse: #fff;

    /* Eigene Variablen */
    --color-rest: #6B7280;
    --color-bio: #92400E;
    --color-papier: #1E40AF;
    --color-gelb: #A16207;
    --color-sonder: #DC2626;
    --color-primary: #059669;
    --color-primary-dark: #047857;
    --color-bg: #ffffff;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-border: #d1d5db;
    --color-error-bg: #fef3c7;
    --color-error-border: #f59e0b;
    --gap: 1rem;
    --max-width: 480px;
}

body {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gap);
    overflow-x: hidden;
}

/* === Screens === */
.screen {
    padding: var(--gap) 0;
}

.screen[hidden] {
    display: none !important;
}

/* === Pico-Ergänzungen === */
.link-small {
    font-size: 0.875rem;
}

/* Buttons: Pico styled <button> und [role=button], wir ergänzen nur Klassen */
.btn-primary {
    width: 100%;
    display: block;
    margin-top: var(--gap);
}

.btn-secondary {
    background: #f3f4f6;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover, .btn-secondary:focus {
    background: #e5e7eb;
}

.btn-danger {
    width: 100%;
    display: block;
    margin-top: var(--gap);
    --pico-background-color: #dc2626;
    --pico-border-color: #dc2626;
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-danger:hover, .btn-danger:focus {
    --pico-background-color: #b91c1c;
    --pico-border-color: #b91c1c;
    background: #b91c1c;
    border-color: #b91c1c;
}

/* Pico setzt fieldset-border — wir wollen keine */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: var(--gap);
}

/* === Checkbox + Radio (Touch-friendly) === */
.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.5rem 0;
    font-weight: 400;
    cursor: pointer;
    gap: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.checkbox-label:last-child, .radio-label:last-child {
    border-bottom: none;
}

.checkbox-label input, .radio-label input {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
}

/* === Waste-Type Color Indicators === */
.waste-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    flex-shrink: 0;
}

.waste-rest .waste-color { background: var(--color-rest); }
.waste-bio .waste-color { background: var(--color-bio); }
.waste-papier .waste-color { background: var(--color-papier); }
.waste-gelb .waste-color { background: var(--color-gelb); }
.waste-sonder .waste-color { background: var(--color-sonder); }

/* === Custom Autocomplete === */
.autocomplete {
    position: relative;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestions[hidden] {
    display: none;
}

.suggestions li {
    padding: 0.75rem;
    min-height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

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

.suggestions li:hover, .suggestions li:focus, .suggestions li.active {
    background: #f0fdf4;
    color: var(--color-primary-dark);
}

/* === Dashboard === */
.dashboard-header {
    margin-bottom: var(--gap);
}

.dashboard-header p {
    color: var(--color-text-muted);
}

.pickup-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: var(--gap);
}

.pickup-card {
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-rest);
    border-radius: var(--radius);
    padding: 1rem;
}

.pickup-card.waste-rest { border-left-color: var(--color-rest); }
.pickup-card.waste-bio { border-left-color: var(--color-bio); }
.pickup-card.waste-papier { border-left-color: var(--color-papier); }
.pickup-card.waste-gelb { border-left-color: var(--color-gelb); }
.pickup-card.waste-sonder { border-left-color: var(--color-sonder); }

.pickup-card .date {
    font-weight: 700;
    font-size: 1.1rem;
}

.pickup-card .types {
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

.dashboard-footer {
    text-align: center;
    padding-top: var(--gap);
    border-top: 1px solid var(--color-border);
}

.dashboard-footer nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.75rem 0;
}

.dashboard-footer nav a {
    min-height: 48px;
    display: flex;
    align-items: center;
}

.branding {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* === Tipp (einmaliger Hinweis) === */
.tipp {
    background: #f0fdf4;
    border: 1px solid var(--color-primary);
    border-radius: var(--pico-border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: var(--gap);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.tipp[hidden] {
    display: none;
}

.tipp p {
    flex: 1;
    margin: 0;
}

.tipp button {
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 0.25rem;
    min-height: auto;
    color: var(--color-text-muted);
    cursor: pointer;
}

#dash-push-status {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* === Kalender === */
.kalender-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: var(--gap);
}

.kalender-nav button {
    width: 48px;
    height: 48px;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--pico-border-radius);
}

#cal-month-label {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 160px;
    text-align: center;
}

.kalender-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    margin-bottom: var(--gap);
}

.kalender-grid .day-header {
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 0.25rem;
}

.kalender-grid .day {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 4px;
}

.kalender-grid .day.has-pickup {
    background: #f0fdf4;
    font-weight: 700;
    color: var(--color-primary-dark);
    cursor: pointer;
}

.kalender-grid .day.today {
    outline: 2px solid var(--color-primary);
}

.kalender-grid .day.empty {
    visibility: hidden;
}

.kalender-legend {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.legend-marker {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #f0fdf4;
    border-radius: 4px;
    vertical-align: middle;
    border: 1px solid var(--color-primary);
}

.termin-liste {
    list-style: none;
}

.termin-liste li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.termin-liste .waste-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* === Einstellungen === */
#push-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    min-height: 48px;
}

#push-status-text {
    font-weight: 400;
}

.settings-footer {
    margin-top: 2rem;
    padding-top: var(--gap);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.settings-footer a {
    margin: 0 0.75rem;
}

.version {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

/* === Error Banner === */
.error-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--color-error-bg);
    border-bottom: 2px solid var(--color-error-border);
    padding: 0.75rem var(--gap);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    font-size: 0.875rem;
}

.error-banner[hidden] {
    display: none;
}

.error-banner p {
    flex: 1;
    margin: 0;
}

.error-banner button {
    min-height: 36px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

#error-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    min-height: 36px;
    color: var(--color-text-muted);
}

/* === iOS Install Overlay === */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2000;
    padding: var(--gap);
}

.overlay[hidden] {
    display: none;
}

.overlay-content {
    background: var(--color-bg);
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    width: 100%;
    max-width: var(--max-width);
}

.overlay-content h2 {
    text-align: center;
    margin-bottom: var(--gap);
}

.install-steps {
    padding-left: 1.5rem;
    margin-bottom: var(--gap);
}

.install-steps li {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 1rem;
}

.icon-share {
    font-size: 1.25rem;
}

.overlay-buttons {
    display: flex;
    gap: 0.75rem;
}

.overlay-buttons .btn-primary,
.overlay-buttons .btn-secondary {
    flex: 1;
    margin-top: 0;
}



/* === Logo === */
.logo-lg {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.logo-md {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: block;
    margin: 0 auto 0.75rem;
}

.logo-sm {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    flex-shrink: 0;
}

.logo-xs {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    vertical-align: middle;
    margin-bottom: 0.5rem;
}

.header-with-logo {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.header-with-logo .logo-sm {
    margin-top: 0.15rem;
}

.header-with-logo h1,
.header-with-logo h2 {
    margin-bottom: 0;
}

.header-with-logo .screen-desc {
    margin-bottom: 0;
}

/* === Screen-Beschreibung === */
.screen-desc {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

/* === Straßen-Balken === */
.street-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-primary);
    color: #fff;
    padding: 0.75rem 1rem;
    margin: 0 calc(-1 * var(--gap)) var(--gap);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    min-height: 48px;
    cursor: pointer;
}

.street-bar:hover {
    background: var(--color-primary-dark);
    color: #fff;
    text-decoration: none;
}

.street-bar-arrow {
    font-size: 1.5rem;
    opacity: 0.7;
}

/* === Consent Hint === */
.consent-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.375rem;
}

.consent-hint a {
    color: var(--color-primary);
}

/* === Consent Checkbox === */
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    padding: 0.75rem 0;
    cursor: pointer;
    line-height: 1.4;
}

.consent-label[hidden] {
    display: none;
}

.consent-label input {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 0.1rem;
    accent-color: var(--color-primary);
}

.consent-label a {
    color: var(--color-primary);
}

/* === Toast === */
.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--pico-border-radius);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 1100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast[hidden] {
    display: none;
}

/* === Globaler Legal-Footer === */
.legal-footer {
    position: fixed;
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    text-align: center;
    padding: 0.375rem 0;
    font-size: 0.7rem;
    background: var(--color-bg);
    border-top: 1px solid #f3f4f6;
    z-index: 899;
}

body.has-nav .legal-footer {
    bottom: calc(56px + env(safe-area-inset-bottom, 0));
}

body:not(.has-nav) .legal-footer {
    position: static;
    border-top: none;
    padding: 1rem 0;
}

body.has-nav {
    padding-bottom: calc(56px + 28px + env(safe-area-inset-bottom, 0));
}

.legal-footer a {
    margin: 0 0.5rem;
    color: var(--color-text-muted);
}

/* === Hilfe Overlay === */
#hilfe-overlay .overlay-content {
    max-height: 80vh;
    overflow-y: auto;
}

#hilfe-overlay h3 {
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

#hilfe-overlay p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* === Bottom Navigation === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav[hidden] {
    display: none;
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    flex: 1;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    gap: 0.125rem;
    -webkit-tap-highlight-color: transparent;
}

.nav-tab.active {
    color: var(--color-primary);
}

.nav-icon {
    font-size: 1.25rem;
}

/* === Loading Spinner === */
.spinner {
    text-align: center;
    padding: 2rem 0;
    color: var(--color-text-muted);
}

.spinner[hidden] {
    display: none;
}

.spinner-icon {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    animation: spin 0.8s linear infinite;
}

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

/* === Disabled Hint === */
.hint-disabled {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-error-border);
    margin-top: 0.5rem;
}

.hint-disabled[hidden] {
    display: none;
}

/* === FAQ Section === */
.faq-section {
    margin-top: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.faq-section summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.faq-content {
    padding: 0 1rem 1rem;
}

.faq-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.faq-content p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* === Utility === */
.hint {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: var(--gap);
}
