/*
  Styling bloku "Theme Finder: Wyszukiwarka"
  Quattro/WP variables + fallbacki light/dark.
*/

.mk-tf-search-hero {
    margin: 2rem auto;
    width: 100%;
    max-width: var(--wp--style--global--wide-size, 1280px);
    box-sizing: border-box;

    --mk-tf-primary: var(--wp--preset--color--primary, #149f96);
    --mk-tf-secondary: var(--wp--preset--color--secondary, #17b4a9);
    --mk-tf-surface: var(--wp--custom--color--surface, var(--wp--preset--color--base, #ffffff));
    --mk-tf-surface-elevated: var(--wp--custom--color--surface-card, #f7f9fc);
    --mk-tf-text: var(--wp--custom--color--on-surface, var(--wp--preset--color--contrast, #0d1534));
    --mk-tf-muted: var(--wp--custom--color--on-surface-muted, #6c7a95);
    --mk-tf-border: var(--wp--custom--color--surface-border, rgba(17, 32, 68, 0.14));
    --mk-tf-ring: color-mix(in srgb, var(--mk-tf-primary) 34%, transparent);
    --mk-tf-shadow: 0 18px 48px rgba(16, 23, 46, 0.12);
    --mk-tf-result-success: #127f77;
    --mk-tf-result-success-bg: color-mix(in srgb, var(--mk-tf-result-success) 12%, transparent);
}

:where(.alignwide) > .mk-tf-search-hero,
.mk-tf-search-hero.alignwide {
    max-width: var(--wp--style--global--wide-size, 1280px);
}

:where(.alignfull) > .mk-tf-search-hero,
.mk-tf-search-hero.alignfull {
    max-width: none;
}

.mk-tf-search-hero__wrapper {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--mk-tf-border);
    border-radius: 20px;
    padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1rem, 4vw, 3rem);
    text-align: center;
    background:
        radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--mk-tf-secondary) 16%, transparent) 0%, transparent 42%),
        radial-gradient(circle at 90% 85%, color-mix(in srgb, var(--mk-tf-primary) 10%, transparent) 0%, transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--mk-tf-surface) 88%, #ffffff 12%) 0%, var(--mk-tf-surface) 100%);
    box-shadow: var(--mk-tf-shadow);
}

.mk-tf-search-hero--variant-contrast .mk-tf-search-hero__wrapper {
    --mk-tf-shadow: 0 22px 56px rgba(7, 20, 40, 0.18);
    background:
        radial-gradient(circle at 14% 16%, color-mix(in srgb, var(--mk-tf-primary) 22%, transparent) 0%, transparent 42%),
        radial-gradient(circle at 90% 88%, color-mix(in srgb, var(--mk-tf-secondary) 14%, transparent) 0%, transparent 35%),
        linear-gradient(135deg, color-mix(in srgb, var(--mk-tf-surface) 82%, #ffffff 18%) 0%, color-mix(in srgb, var(--mk-tf-surface) 95%, #dbe9ff 5%) 100%);
}

.mk-tf-search-hero--align-left .mk-tf-search-hero__wrapper {
    text-align: left;
}

.mk-tf-search-hero--align-left .mk-tf-search-hero__subtitle,
.mk-tf-search-hero--align-left .mk-tf-search-hero__form {
    margin-left: 0;
    margin-right: 0;
}

.mk-tf-search-hero--align-left .mk-tf-search-hero__benefits {
    justify-content: flex-start;
}

.mk-tf-search-hero__wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent 55%);
    pointer-events: none;
}

.mk-tf-search-hero__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--mk-tf-secondary) 40%, transparent);
    background: color-mix(in srgb, var(--mk-tf-secondary) 12%, transparent);
    color: color-mix(in srgb, var(--mk-tf-text) 72%, var(--mk-tf-secondary));
    font-size: 0.85rem;
    font-weight: 600;
}

.mk-tf-search-hero__pill-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--mk-tf-secondary);
    box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--mk-tf-secondary) 28%, transparent);
}

.mk-tf-search-hero__title {
    margin: 0;
    color: var(--mk-tf-text);
    font-size: clamp(1.9rem, 6vw, 3.6rem);
    line-height: 1.07;
    letter-spacing: -0.02em;
    font-weight: 800;
    text-wrap: balance;
}

.mk-tf-search-hero__title-accent {
    color: var(--mk-tf-primary);
}

.mk-tf-search-hero__subtitle {
    margin: 1.1rem auto 2rem;
    max-width: 760px;
    color: var(--mk-tf-muted);
    font-size: clamp(1rem, 2vw, 1.34rem);
    line-height: 1.55;
    text-wrap: pretty;
}

.mk-tf-search-hero__form {
    width: min(100%, 900px);
    margin: 0 auto;
}

.mk-tf-search-hero__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.55rem;
    border-radius: 22px;
    border: 1px solid color-mix(in srgb, var(--mk-tf-border) 86%, transparent);
    background: color-mix(in srgb, var(--mk-tf-surface-elevated) 94%, transparent);
    box-shadow: 0 10px 30px rgba(16, 23, 46, 0.12);
}

.mk-tf-search-hero__input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.45rem;
    width: 1.35rem;
    height: 1.35rem;
    color: color-mix(in srgb, var(--mk-tf-muted) 75%, var(--mk-tf-primary));
}

.mk-tf-search-hero__input-icon svg {
    width: 100%;
    height: 100%;
}

.mk-tf-search-hero__input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    color: var(--mk-tf-text) !important;
    padding: 0.95rem 0.65rem !important;
    border-radius: 12px !important;
    font-size: 1.12rem !important;
    line-height: 1.4;
}

.mk-tf-search-hero__input::placeholder {
    color: color-mix(in srgb, var(--mk-tf-muted) 84%, transparent);
}

.mk-tf-search-hero__input.is-invalid {
    color: #b42318 !important;
}

.mk-tf-search-hero__input.is-valid {
    color: color-mix(in srgb, var(--mk-tf-text) 88%, var(--mk-tf-primary)) !important;
}

.mk-tf-search-hero__input-wrapper:focus-within {
    border-color: color-mix(in srgb, var(--mk-tf-primary) 38%, var(--mk-tf-border));
    box-shadow: 0 0 0 4px var(--mk-tf-ring), 0 14px 36px rgba(16, 23, 46, 0.16);
}

.mk-tf-search-hero__button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 56px;
    min-width: 176px;
    border: 0 !important;
    border-radius: 16px !important;
    padding: 0.85rem 1.55rem !important;
    background: linear-gradient(135deg, var(--mk-tf-primary), var(--mk-tf-secondary)) !important;
    color: var(--wp--preset--color--text-light, #ffffff) !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    cursor: pointer !important;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease !important;
    box-shadow: 0 10px 20px color-mix(in srgb, var(--mk-tf-primary) 32%, transparent);
}

.mk-tf-search-hero__button-icon {
    font-size: 1.05em;
    line-height: 1;
    margin-left: 0.05rem;
}

.mk-tf-search-hero__button:hover {
    transform: translateY(-1px);
    filter: saturate(1.08);
}

.mk-tf-search-hero__button:active {
    transform: translateY(0);
}

.mk-tf-search-hero__button:focus-visible {
    outline: 2px solid var(--wp--preset--color--text-light, #ffffff);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--mk-tf-ring), 0 10px 20px color-mix(in srgb, var(--mk-tf-primary) 32%, transparent);
}

.mk-tf-search-hero__button:disabled {
    opacity: 0.68;
    cursor: not-allowed !important;
    transform: none;
    filter: grayscale(0.1);
}

.mk-tf-search-hero__button.is-loading .mk-tf-search-hero__button-text {
    opacity: 0;
}

.mk-tf-search-hero__button.is-loading .mk-tf-search-hero__button-icon {
    opacity: 0;
}

.mk-tf-search-hero__button.is-loading .mk-tf-search-hero__button-loader {
    display: inline-flex !important;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
}

.mk-tf-spinner {
    animation: mk-tf-rotate 2s linear infinite;
    width: 22px;
    height: 22px;
}

.mk-tf-spinner .path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: mk-tf-dash 1.5s ease-in-out infinite;
}

@keyframes mk-tf-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes mk-tf-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.mk-tf-search-hero__benefits {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.mk-tf-search-hero__benefit {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: color-mix(in srgb, var(--mk-tf-muted) 80%, var(--mk-tf-text));
    font-size: 0.96rem;
    font-weight: 500;
}

.mk-tf-search-hero__benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--mk-tf-primary);
    font-size: 0.96rem;
    line-height: 1;
}

.mk-tf-search-hero__benefit-icon::before {
    display: block;
}

.mk-tf-search-hero__benefit-icon--bolt::before {
    content: "⚡";
}

.mk-tf-search-hero__benefit-icon--search::before {
    content: "⌕";
    font-size: 1.1rem;
}

.mk-tf-search-hero__benefit-icon--check::before {
    content: "✓";
    font-weight: 700;
}

.mk-tf-search-hero__results {
    margin-top: 1.25rem;
    text-align: left;
    background-color: color-mix(in srgb, var(--mk-tf-surface-elevated) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--mk-tf-border) 88%, transparent);
    border-radius: 14px;
    padding: 1.15rem;
    color: var(--mk-tf-text);
    box-shadow: 0 8px 20px rgba(16, 23, 46, 0.08);
}

.mk-tf-result-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--mk-tf-text);
}

.mk-tf-result-card__cpt-match {
    border: 1px solid color-mix(in srgb, var(--mk-tf-result-success) 30%, var(--mk-tf-border));
    border-radius: 16px;
    padding: 1rem;
    background: linear-gradient(160deg, var(--mk-tf-result-success-bg), color-mix(in srgb, var(--mk-tf-surface-elevated) 92%, transparent));
}

.mk-tf-result-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.mk-tf-result-card__status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--mk-tf-result-success) 35%, transparent);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--mk-tf-result-success);
    background: color-mix(in srgb, var(--mk-tf-result-success) 12%, transparent);
}

.mk-tf-result-card__status-badge::before {
    content: "●";
    font-size: 0.6rem;
}

.mk-tf-result-card__theme-name {
    margin: 0.4rem 0 0;
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.25;
}

.mk-tf-result-card__theme-name strong {
    color: var(--mk-tf-text);
}

.mk-tf-result-card__theme-desc {
    margin: 0.35rem 0 0;
    color: var(--mk-tf-muted);
    font-size: 0.98rem;
}

.mk-tf-result-card__actions {
    margin-top: 0.85rem;
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.mk-tf-result-card__actions .mk-tf-btn {
    min-width: 150px;
}

.mk-tf-result-card__image-wrap {
    margin-top: 0.4rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--mk-tf-border) 88%, transparent);
    background: color-mix(in srgb, var(--mk-tf-surface) 85%, transparent);
}

.mk-tf-result-card__image-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: top;
}

.mk-tf-result-card__image-caption {
    margin: 0;
    padding: 0.55rem 0.8rem;
    font-size: 0.88rem;
    color: var(--mk-tf-muted);
    border-top: 1px solid color-mix(in srgb, var(--mk-tf-border) 88%, transparent);
    background: color-mix(in srgb, var(--mk-tf-surface-elevated) 95%, transparent);
}

.mk-tf-result-card__title {
    margin: 0;
    font-size: clamp(1.15rem, 2vw, 1.4rem);
}

.mk-tf-result-card__desc {
    margin: 0;
    color: var(--mk-tf-muted);
}

.mk-tf-result-card__child-info {
    margin: 0;
    font-size: 0.95rem;
    color: color-mix(in srgb, var(--mk-tf-text) 82%, var(--mk-tf-primary));
}

.mk-tf-error-notice {
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, #d92d20 35%, transparent);
    background: color-mix(in srgb, #d92d20 12%, transparent);
    color: color-mix(in srgb, #841f18 85%, var(--mk-tf-text));
    padding: 0.75rem 0.85rem;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .mk-tf-search-hero__wrapper {
        border-radius: 18px;
    }

    .mk-tf-search-hero__button {
        min-width: 160px;
    }
}

@media (max-width: 767px) {
    .mk-tf-search-hero {
        margin: 1.25rem auto;
    }

    .mk-tf-search-hero__wrapper {
        padding: 1.5rem 0.9rem;
        border-radius: 14px;
    }

    .mk-tf-search-hero__subtitle {
        margin-bottom: 1.25rem;
    }

    .mk-tf-search-hero__input-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 0.7rem;
        border-radius: 16px;
        gap: 0.6rem;
    }

    .mk-tf-search-hero__input-icon {
        display: none;
    }

    .mk-tf-search-hero__input {
        width: 100%;
        padding: 0.8rem 0.35rem !important;
        font-size: 1.02rem !important;
    }

    .mk-tf-search-hero__button {
        width: 100%;
        min-height: 52px;
        border-radius: 12px !important;
    }

    .mk-tf-search-hero__benefits {
        gap: 0.65rem 1rem;
        justify-content: center;
    }

    .mk-tf-search-hero__benefit {
        font-size: 0.9rem;
    }

    .mk-tf-search-hero__results {
        padding: 0.95rem;
    }

    .mk-tf-result-card__cpt-match {
        padding: 0.85rem;
    }

    .mk-tf-result-card__actions {
        flex-direction: column;
    }

    .mk-tf-result-card__actions .mk-tf-btn {
        width: 100%;
    }
}
