/* ============================================================
   WomoPilot Theme
   Stimmung: Freundlich & Einfach
   Farben: Warmes Teal + Orange-Akzent
   ============================================================ */

/* -- Lokale Fonts (kein Google-Server-Kontakt) ------------- */
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/nunito-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/nunito-600.ttf') format('truetype');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/nunito-700.ttf') format('truetype');
}
@font-face {
    font-family: 'Nunito';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('fonts/nunito-800.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/inter-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('fonts/inter-500.ttf') format('truetype');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('fonts/inter-600.ttf') format('truetype');
}

/* -- CSS Custom Properties (Design Tokens) ----------------- */
:root {
    --wp-primary:        #2A8C7E;
    --wp-primary-dark:   #1E6B5F;
    --wp-primary-light:  #E8F5F3;
    --wp-accent:         #E8883A;
    --wp-accent-dark:    #C96E22;
    --wp-bg:             #F8F6F1;
    --wp-surface:        #FFFFFF;
    --wp-text:           #2C3E35;
    --wp-text-muted:     #6B7B74;
    --wp-border:         #E2DDD6;
    --wp-radius:         12px;
    --wp-radius-sm:      8px;
    --wp-shadow:         0 2px 12px rgba(42, 140, 126, 0.10);
    --wp-shadow-md:      0 4px 24px rgba(42, 140, 126, 0.14);
}

/* -- Basis ------------------------------------------------- */
html, body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--wp-text);
    background-color: var(--wp-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Nunito', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    color: var(--wp-text);
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }

h1:focus { outline: none; }

a, .btn-link {
    color: var(--wp-primary);
    text-decoration: none;
}

a:hover {
    color: var(--wp-primary-dark);
    text-decoration: underline;
}

/* -- Bootstrap Overrides: Buttons -------------------------- */
.btn {
    border-radius: var(--wp-radius-sm);
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    transition: all 0.18s ease;
}

.btn-primary {
    background-color: var(--wp-primary);
    border-color: var(--wp-primary);
    color: #fff;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--wp-primary-dark);
    border-color: var(--wp-primary-dark);
    color: #fff;
}

.btn-outline-primary {
    color: var(--wp-primary);
    border-color: var(--wp-primary);
}

.btn-outline-primary:hover {
    background-color: var(--wp-primary);
    border-color: var(--wp-primary);
    color: #fff;
}

.btn-secondary {
    background-color: var(--wp-text-muted);
    border-color: var(--wp-text-muted);
}

.btn:focus, .btn:active:focus,
.form-control:focus, .form-check-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(42, 140, 126, 0.25);
    border-color: var(--wp-primary);
    outline: none;
}

/* -- Bootstrap Overrides: Karten --------------------------- */
.card {
    border: 1px solid var(--wp-border);
    border-radius: var(--wp-radius);
    box-shadow: var(--wp-shadow);
    background-color: var(--wp-surface);
}

.card-header {
    background-color: var(--wp-primary-light);
    border-bottom: 1px solid var(--wp-border);
    border-radius: var(--wp-radius) var(--wp-radius) 0 0 !important;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: var(--wp-primary-dark);
    padding: 0.85rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* -- Bootstrap Overrides: Formulare ------------------------ */
.form-control, .form-select {
    border-radius: var(--wp-radius-sm);
    border-color: var(--wp-border);
    color: var(--wp-text);
    background-color: var(--wp-surface);
    font-size: 1rem;
    padding: 0.55rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--wp-primary);
    background-color: var(--wp-surface);
}

.form-label {
    font-weight: 600;
    color: var(--wp-text);
    margin-bottom: 0.35rem;
}

/* -- Bootstrap Overrides: Tabellen ------------------------- */
.table {
    color: var(--wp-text);
}

.table th {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    color: var(--wp-primary-dark);
    border-bottom-color: var(--wp-border);
    background-color: var(--wp-primary-light);
}

.table td {
    border-color: var(--wp-border);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--wp-primary-light);
}

/* -- Bootstrap Overrides: Badges --------------------------- */
.badge {
    border-radius: 6px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35em 0.7em;
}

.bg-success { background-color: var(--wp-primary) !important; }
.bg-primary  { background-color: var(--wp-primary) !important; }

/* -- Bootstrap Overrides: Alerts --------------------------- */
.alert {
    border-radius: var(--wp-radius-sm);
    border: none;
}

.alert-danger  { background-color: #FEE8E8; color: #8B1A1A; }
.alert-warning { background-color: #FFF3E0; color: #7D4A00; }
.alert-success { background-color: var(--wp-primary-light); color: var(--wp-primary-dark); }
.alert-info    { background-color: #E8F4FE; color: #1A5276; }

/* -- Seiteninhalt ------------------------------------------ */
.content {
    padding-top: 1.25rem;
    padding-bottom: 2rem;
}

/* -- Validierung ------------------------------------------- */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--wp-primary);
    border-radius: var(--wp-radius-sm);
}

.invalid {
    outline: 2px solid #C0392B;
    border-radius: var(--wp-radius-sm);
}

.validation-message {
    color: #C0392B;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* -- Blazor Error UI --------------------------------------- */
.blazor-error-boundary {
    background: #FEE8E8;
    border-left: 4px solid #C0392B;
    padding: 1rem 1rem 1rem 1.5rem;
    color: #8B1A1A;
    border-radius: var(--wp-radius-sm);
}

.blazor-error-boundary::after {
    content: "Ein Fehler ist aufgetreten."
}

#blazor-error-ui {
    color-scheme: light only;
    background: #FFF3E0;
    border-top: 2px solid var(--wp-accent);
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: var(--wp-text);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* -- Website-Analyse Hinweisboxen -------------------------- */
.analysis-running-info {
    background: var(--wp-primary-light);
    border: 1px solid rgba(42, 140, 126, 0.25);
    border-left: 4px solid var(--wp-primary);
    border-radius: var(--wp-radius-sm);
    padding: 1rem 1.1rem;
}

.analysis-running-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
    font-size: 1rem;
    color: var(--wp-primary-dark);
}

.analysis-running-detail {
    color: var(--wp-text);
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
}

.analysis-running-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.88rem;
    color: var(--wp-text);
}

.analysis-running-note {
    font-size: 0.85rem;
    color: var(--wp-text-muted);
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(42, 140, 126, 0.2);
}

.analysis-pending-info {
    background: var(--wp-bg);
    border: 1px solid var(--wp-border);
    border-radius: var(--wp-radius-sm);
    padding: 1rem 1.1rem;
    font-size: 0.92rem;
}

/* -- Karten-Kontextmenü ------------------------------------ */
.map-context-menu {
    position: fixed;
    z-index: 9999;
    background: var(--wp-surface);
    border: 1px solid var(--wp-border);
    border-radius: var(--wp-radius-sm);
    box-shadow: var(--wp-shadow-md);
    min-width: 220px;
    padding: 0.3rem;
    opacity: 0;
    transition: opacity 0.1s;
    font-family: 'Inter', sans-serif;
}

.mcm-header {
    font-size: 0.7rem;
    color: var(--wp-text-muted);
    padding: 0.2rem 0.6rem 0.4rem;
    border-bottom: 1px solid var(--wp-border);
    margin-bottom: 0.2rem;
}

.mcm-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--wp-text);
    cursor: pointer;
    text-align: left;
    transition: background 0.12s, color 0.12s;
}

.mcm-item:hover {
    background: var(--wp-primary-light);
    color: var(--wp-primary-dark);
}

/* -- Leaflet Marker Popups --------------------------------- */
.wp-popup {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    min-width: 220px;
    max-width: 280px;
    line-height: 1.4;
}

.wp-popup-header {
    margin-bottom: 0.3rem;
}

.wp-popup-header b {
    display: block;
    font-family: 'Nunito', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #2C3E35;
}

.wp-popup-type {
    font-size: 0.72rem;
    color: #6B7B74;
}

.wp-popup-detour {
    font-size: 0.78rem;
    color: #6B7B74;
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #E2DDD6;
}

.wp-popup-summary {
    font-size: 0.8rem;
    color: #2C3E35;
    background: #E8F5F3;
    border-left: 3px solid #2A8C7E;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
    font-style: italic;
}

.wp-popup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.4rem;
}

.popup-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.popup-badge.yes {
    background: #E8F5F3;
    color: #1E6B5F;
}

.popup-badge.no {
    background: #F5F5F5;
    color: #9E9E9E;
    text-decoration: line-through;
}

.popup-badge.fee {
    background: #FFF3E8;
    color: #C96E22;
}

.wp-popup-row {
    font-size: 0.79rem;
    color: #2C3E35;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wp-popup-ai-hint {
    font-size: 0.75rem;
    color: #6B7B74;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid #E2DDD6;
}

.wp-popup-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid #E2DDD6;
}

.popup-btn-route {
    background: none;
    border: 1.5px solid #2A8C7E;
    color: #2A8C7E;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.popup-btn-route:hover {
    background: #2A8C7E;
    color: #fff;
}

.wp-popup-footer a {
    color: #2A8C7E;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
}

.wp-popup-footer a:hover {
    text-decoration: underline;
}

/* -- Mobile Grundregeln ------------------------------------ */
@media (max-width: 640px) {
    /* Kein horizontales Overflow */
    body {
        overflow-x: hidden;
    }

    /* Buttons volle Breite auf kleinen Screens */
    .btn-primary.w-100-mobile {
        width: 100% !important;
    }

    /* Karten kompakter */
    .card-body {
        padding: 0.75rem !important;
    }

    /* Überschriften kleiner */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }

    /* Impressum/Datenschutz */
    .impressum-page {
        padding: 0 0.5rem 2rem;
    }

    .service-list {
        gap: 0.75rem;
    }

    /* Footer umbrechen */
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        font-size: 0.7rem;
    }

    .site-footer span:has(> a) {
        display: none; /* Kartendaten-Hinweis auf Mobile ausblenden */
    }
}

/* -- Utility-Klassen --------------------------------------- */
.text-primary { color: var(--wp-primary) !important; }
.text-accent  { color: var(--wp-accent) !important; }
.text-muted   { color: var(--wp-text-muted) !important; }

.wp-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background-color: var(--wp-primary-light);
    color: var(--wp-primary-dark);
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.wp-tag.unavailable {
    background-color: #F5F5F5;
    color: var(--wp-text-muted);
}

/* -- Formular-Checkboxen ----------------------------------- */
.darker-border-checkbox.form-check-input {
    border-color: var(--wp-border);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--wp-text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}
