/* =========================================================
   BEGRÜSSUNGSBEREICH
========================================================= */

.pwlex-welcome {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;

    width: 100%;
    padding: 24px;
}

.pwlex-welcome-image {
    display: flex;
    align-items: flex-start;
    justify-content: center;

}

.pwlex-welcome-image img {
    display: block;

    width: 100%;
    max-width: 200px;
    height: auto;

    flex-shrink: 0;
}

.pwlex-welcome-content {
    width: 100%;
    min-width: 0;
}

.pwlex-welcome-title {
    margin: 0 0 8px;

    color: var(--wcfContentHeadlineText);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
}

.pwlex-welcome-description {
    margin: 0 0 18px;

    color: var(--wcfContentDimmedText);
    font-size: 14px;
    line-height: 1.55;
}

.pwlex-welcome-description-line {
    display: block;
}


/* =========================================================
   SUCHBEREICH
========================================================= */

.pwlex-search {
    width: 100%;
    max-width: none;
}

.pwlex-search-box {
    width: 100%;
    overflow: hidden;

    background: #ffffff;
    border: 1px solid #d8e1e8;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(50, 92, 132, 0.08);

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

/* Fokus wie bei der ursprünglichen Pflege-Wissen-Suche */
.pwlex-search-box:focus-within {
    border-color: #325c84;
    box-shadow: 0 0 0 4px rgba(50, 92, 132, 0.10);
}

/* Lupe und Eingabefeld bilden ein gemeinsames Element */
.pwlex-search-input-wrap {
    position: relative;
    display: block;

    width: 100%;
    overflow: hidden;

    background: #ffffff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Fester Lupenbereich links */
.pwlex-search-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 14px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    color: #325c84;
    background: #edf4fa;
    border-radius: 50%;

    transform: translateY(-50%);
    pointer-events: none;
}

/* WoltLab-Eingabestile gezielt überschreiben */
.pwlex-search-input,
.pwlex-search-input[type="search"] {
    display: block !important;

    width: 100% !important;
    height: 54px !important;

    margin: 0 !important;
    padding: 0 18px 0 52px !important;

    color: #34495e !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;

    font: inherit !important;
    font-size: 14px !important;
    line-height: normal !important;

    appearance: none;
    -webkit-appearance: none;
}

/* Auch beim Fokus keine eigene WoltLab-Fläche */
.pwlex-search-input:focus,
.pwlex-search-input[type="search"]:focus {
    color: #34495e !important;
    background: transparent !important;
    background-color: transparent !important;

    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

/* Autofill ebenfalls neutralisieren */
.pwlex-search-input:-webkit-autofill,
.pwlex-search-input:-webkit-autofill:hover,
.pwlex-search-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #34495e;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
}

/* Placeholder */
.pwlex-search-input::placeholder {
    color: #8b98a7 !important;
    opacity: 1;
}

/* Browser-eigenes Löschsymbol etwas zurückhaltender */
.pwlex-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}


/* =========================================================
   STATUS
========================================================= */

.pwlex-search-status {
    display: none;

    padding: 8px 16px;

    color: #6b7c8f;
    background: #ffffff;
    border-top: 1px solid #eef3f7;

    font-size: 12px;
    line-height: 1.4;
}

.pwlex-search-box--active .pwlex-search-status {
    display: block;
}


/* =========================================================
   ERGEBNISSE
========================================================= */

.pwlex-search-results {
    max-height: 300px;
    overflow-y: auto;

    margin: 0;

    background: #ffffff;
    border: 0;
    border-top: 1px solid #eef3f7;
    border-radius: 0;
}

/* Die Rundung gehört nur zur gesamten Suchbox */
.pwlex-search-box--active {
    border-radius: 4px;
}

.pwlex-search-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    gap: 16px;
    align-items: center;

    padding: 10px 16px;

    color: #34495e;
    background: #ffffff;
    border-bottom: 1px dotted #d9e2e8;

    text-decoration: none;

    transition:
        color 0.15s ease,
        background 0.15s ease;
}

.pwlex-search-result:last-child {
    border-bottom: 0;
}

.pwlex-search-result:hover {
    color: #24425f;
    background: #f8fbfd;
    text-decoration: none;
}

.pwlex-search-result-title {
    min-width: 0;
    overflow: hidden;

    color: #34495e;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.pwlex-search-result:hover .pwlex-search-result-title {
    color: #24425f;
}

.pwlex-search-result-stats {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;

    color: #4b5d73;
    font-size: 11px;
    white-space: nowrap;
}

.pwlex-search-result-stat {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;

    min-width: 42px;
}

.pwlex-search-result-stat fa-icon {
    color: #325c84;
    flex: 0 0 auto;
}

.pwlex-search-result-arrow {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    color: #6b7c8f;
}

.pwlex-search-result-arrow fa-icon {
    display: block;
}

.pwlex-search-result:hover .pwlex-search-result-arrow {
    color: #325c84;
}


/* =========================================================
   MARKIERUNG DES SUCHBEGRIFFS
========================================================= */

.pwlex-search-highlight {
    padding: 0 2px;

    color: inherit;
    background: #ffd61e;
    border-radius: 2px;

    font-weight: 700;
}


/* =========================================================
   TABLET
========================================================= */

@media screen and (max-width: 900px) {

    .pwlex-welcome {
        grid-template-columns: 170px minmax(0, 1fr);
        gap: 20px;
        padding: 20px;
    }

    .pwlex-welcome-image {
        padding-top: 28px;
    }

    .pwlex-welcome-image img {
        max-width: 160px;
    }

    .pwlex-welcome-title {
        font-size: 21px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media screen and (max-width: 700px) {

    .pwlex-welcome {
        grid-template-columns: 1fr;
        gap: 14px;

        padding: 16px;
    }

    .pwlex-welcome-image {
        padding-top: 0;
    }

    .pwlex-welcome-image img {
        max-width: 150px;
    }

    .pwlex-welcome-content {
        width: 100%;
        text-align: center;
    }

    .pwlex-welcome-title {
        font-size: 20px;
    }

    .pwlex-welcome-description {
        font-size: 13px;
    }

    .pwlex-search {
        width: 100%;
        max-width: none;
        text-align: left;
    }

    .pwlex-search-result {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
    }

    .pwlex-search-result-title {
        white-space: normal;
    }

    .pwlex-search-result-arrow {
        display: none;
    }

}


/* =========================================================
   SEHR KLEINE DISPLAYS
========================================================= */

@media screen and (max-width: 480px) {

    .pwlex-welcome {
        padding: 12px;
    }

    .pwlex-search-input {
        height: 44px;
        font-size: 13px;
    }

    .pwlex-search-result {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .pwlex-search-result-stats {
        justify-content: flex-start;
    }

    .pwlex-search-result-stat {
        min-width: 0;
    }

}