/* ==========================================================================
   Search V2 — modern rebuild of the front-page category tabs + search bar.

   Brand colors match legacy:
     Kommuner #34598b · Sygehuse #e04c5a · Skat #c6b349 · Søg #0ca7c6

   Keeps #search / #results / #results-text / #search-string / #Submit1 / #main
   so public/Scripts/custom.js continues to work unchanged.

   Legacy CSS is NOT modified — this file only styles .search-v2.
   ========================================================================== */

.search-v2 {
    --search-teal: #0ca7c6;
    --search-teal-dark: #0a8fa9;
    --search-teal-deep: #087a92;
    --search-ink: #1f2a37;
    --search-muted: #6b7c8f;
    --search-shell: rgba(255, 255, 255, 0.96);
    --search-shadow: 0 10px 30px rgba(15, 35, 55, 0.28);

    font-family: 'Open Sans', sans-serif;
    margin: 28px 0 8px;
    padding: 0 16px;
    box-sizing: border-box;
}

.search-v2__container {
    max-width: 560px;
    margin: 0 auto;
}

/* -- Category tabs ------------------------------------------------------- */

.search-v2__tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.search-v2__tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px 12px 4px 4px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-align: center;
    line-height: 1.2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.search-v2__tab:hover,
.search-v2__tab:focus {
    color: #fff;
    text-decoration: none;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.24);
}

.search-v2__tab.is-active {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    outline: 2px solid rgba(255, 255, 255, 0.55);
    outline-offset: -2px;
}

.search-v2__tab--county {
    background: linear-gradient(160deg, #4572ab 0%, #34598b 55%, #2a4a74 100%);
}

.search-v2__tab--hospital {
    background: linear-gradient(160deg, #ea6570 0%, #e04c5a 55%, #c93d4a 100%);
}

.search-v2__tab--tax {
    background: linear-gradient(160deg, #d4c15d 0%, #c6b349 55%, #b19f3a 100%);
}

/* -- Search bar shell ---------------------------------------------------- */

.search-v2__bar {
    position: relative;
}

.search-v2__shell {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border-radius: 999px;
    background: var(--search-shell);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--search-shadow);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.search-v2__shell:focus-within {
    border-color: rgba(12, 167, 198, 0.55);
    box-shadow:
        var(--search-shadow),
        0 0 0 4px rgba(12, 167, 198, 0.18);
    transform: translateY(-1px);
}

.search-v2__field {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.search-v2__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search-v2__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    color: var(--search-teal);
    font-size: 1.15rem;
    pointer-events: none;
}

.search-v2__input,
.search-v2 input#search {
    display: block;
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 8px 0 6px;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    color: var(--search-ink);
    font-family: inherit;
    font-size: 1.05rem;
    line-height: 1.3;
    box-shadow: none !important;
    box-sizing: border-box;
    outline: none;
}

.search-v2 input#search::placeholder {
    color: var(--search-muted);
    opacity: 1;
}

.search-v2 input#search:hover,
.search-v2 input#search:focus {
    color: var(--search-ink);
    border: 0 !important;
    box-shadow: none !important;
}

/* -- Search button ------------------------------------------------------- */

.search-v2__btn,
.search-v2 input.search-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 72px;
    height: 48px;
    margin: 0;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background:
        linear-gradient(165deg, #2bc0de 0%, var(--search-teal) 45%, var(--search-teal-dark) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    box-shadow:
        0 6px 16px rgba(12, 167, 198, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.search-v2__btn:hover,
.search-v2 input.search-btn:hover {
    background:
        linear-gradient(165deg, #24b4d1 0%, var(--search-teal-dark) 50%, var(--search-teal-deep) 100%);
    transform: translateY(-1px);
    box-shadow:
        0 8px 20px rgba(12, 167, 198, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.search-v2__btn:active,
.search-v2 input.search-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(12, 167, 198, 0.35);
}

/* -- Live results (scoped overrides of styleengine.css) ------------------ */

.search-v2 ul#results,
.search-v2 .search-v2__results {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: 280px;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
    list-style: none;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 35, 55, 0.25);
    z-index: 20;
    text-align: left;
}

.search-v2 ul#results li {
    padding: 12px 18px;
    border-top: 1px solid #edf2f7;
    cursor: pointer;
    font-size: 0.95rem;
    color: #334155;
    transition: background-color 0.15s ease;
}

.search-v2 ul#results li:first-child {
    border-top: 0;
}

.search-v2 ul#results li:hover {
    background-color: #f0f9fc;
}

.search-v2 ul#results li h3,
.search-v2 ul#results li h4 {
    margin: 0;
    color: #34598b;
    font-size: 1rem;
    line-height: 1.3;
}

.search-v2 h4#results-text,
.search-v2 .search-v2__results-label {
    display: none;
    position: static;
    margin: 12px 0 0;
    padding: 0 8px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    text-align: left;
}

/* -- Desktop ------------------------------------------------------------- */

@media (min-width: 768px) {
    .search-v2 {
        margin: 40px 0 12px;
        padding: 0 24px;
    }

    .search-v2__container {
        max-width: 640px;
    }

    .search-v2__tabs {
        gap: 10px;
        margin-bottom: 16px;
    }

    .search-v2__tab {
        min-height: 46px;
        font-size: 1.05rem;
        padding: 12px 16px;
    }

    .search-v2__shell {
        padding: 8px 8px 8px 18px;
        gap: 10px;
    }

    .search-v2__icon {
        width: 32px;
        font-size: 1.25rem;
    }

    .search-v2__input,
    .search-v2 input#search {
        height: 52px;
        font-size: 1.15rem;
    }

    .search-v2__btn,
    .search-v2 input.search-btn {
        min-width: 88px;
        height: 52px;
        padding: 0 28px;
        font-size: 1.1rem;
    }
}
