/**
 * awcf_keuzehulp_styling
 * Scoped op body.aw-keuzehulp (staat op /stoelkeuzehulp/ via body_class filter).
 * Overrules plugin's public-CSS met sterkere specificiteit + !important waar de
 * plugin `body div .velo-inner-choice` gebruikt.
 */

/* Top-bar knop "Stoelkeuzehulp" in de rode header. Class op de button-widget. */
.elementor-widget-button.aw-topbar-btn .elementor-button {
    background-color: #FFFFFF !important;
    color: #A12329 !important;
    border-radius: 4px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.elementor-widget-button.aw-topbar-btn .elementor-button:hover,
.elementor-widget-button.aw-topbar-btn .elementor-button:focus {
    background-color: #212121 !important;
    color: #FFFFFF !important;
}

/* Verberg plugin license-warning (dev-mode zonder licentie) */
body.aw-keuzehulp .aw-notice-license-error {
    display: none !important;
}

/* Verberg theme-widget #btn-back (algemene "Terug"-knop uit theme-template) */
body.aw-keuzehulp #btn-back {
    display: none !important;
}

/* Wrapper: rood achtergrond (sowecare-huisstijl) */
body.aw-keuzehulp .velo-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    font-family: Roboto, sans-serif;
    border: none;
    border-radius: 12px;
    background: #A12329;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: visible;
    text-align: left;
    color: #FFFFFF;
    /* Voorkomt overlap tussen back-knop en H2: elk direct child op eigen regel */
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* Vraag-titel: wit op rood, wit accent-line */
body.aw-keuzehulp .velo-wrapper h2.velo-title-steps {
    font-family: Roboto, sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    padding: 0 0 0 14px;
    border-left: 4px solid #FFFFFF;
    color: #FFFFFF;
    text-align: left;
    line-height: 1.35;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Terug-knop: wit-op-transparent op rode wrapper */
body.aw-keuzehulp .velo-wrapper button.velo-frontend-back-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #FFFFFF;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    margin: 0 0 20px;
    align-self: flex-start;
    position: static !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 80px;
    transition: all 0.2s ease;
}
body.aw-keuzehulp .velo-wrapper button.velo-frontend-back-button:hover {
    background: #FFFFFF;
    border-color: #FFFFFF;
    color: #A12329;
}

/* Cards-grid, override plugin flex-layout */
body.aw-keuzehulp .velo-wrapper .velo-choices-wrapper {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 16px !important;
    flex: none !important;
    align-items: stretch;
}

/* Individuele antwoord-card: wit-op-rood, hover met verhoogde shadow */
body.aw-keuzehulp .velo-wrapper .velo-inner-choice {
    flex: unset !important;
    margin: 0 !important;
    min-height: 120px;
    background: #FFFFFF;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #212121;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
body.aw-keuzehulp .velo-wrapper .velo-inner-choice:hover {
    border: 2px solid #FFFFFF !important;
    padding: 20px 16px !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    transform: translateY(-2px);
}
body.aw-keuzehulp .velo-wrapper .velo-inner-choice .velo-choice-image {
    max-width: 100%;
    max-height: 140px;
    height: auto;
    border-radius: 4px;
    object-fit: contain;
}
body.aw-keuzehulp .velo-wrapper .velo-inner-choice .velo-result-choice-title {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;
}

/* Loading-state van plugin overschrijven */
body.aw-keuzehulp .velo-wrapper .velo-loading {
    display: flex !important;
    justify-content: center;
    gap: 6px;
    padding: 40px 0;
    position: static !important;
    width: auto !important;
    height: auto !important;
}
body.aw-keuzehulp .velo-wrapper .velo-loading div {
    position: static !important;
    left: auto !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50%;
    background: #FFFFFF;
    opacity: 0.4;
    animation: aw-velo-pulse 1.4s ease-in-out infinite;
}
body.aw-keuzehulp .velo-wrapper .velo-loading div:nth-child(2) { animation-delay: 0.2s; }
body.aw-keuzehulp .velo-wrapper .velo-loading div:nth-child(3) { animation-delay: 0.4s; }

@keyframes aw-velo-pulse {
    0%, 80%, 100% { opacity: 0.4; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Eind-scherm titel + card-grid */
body.aw-keuzehulp .velo-wrapper h2.velo-title-all-results {
    font-family: Roboto, sans-serif;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin: 8px 0 24px;
    border: none;
    padding: 0;
    color: #FFFFFF;
}
body.aw-keuzehulp .velo-wrapper .velo-final-items {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px !important;
    margin-bottom: 40px;
    justify-items: center;
}
body.aw-keuzehulp .velo-wrapper .velo-final-items a.velo-inner-choice {
    max-width: 320px;
    width: 100%;
}

/* Waarom-tekst-blok (geïnjecteerd door JS): wit-op-rood met wit accent */
body.aw-keuzehulp .aw-keuzehulp-why {
    max-width: 720px;
    margin: 24px auto;
    padding: 24px 28px;
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #FFFFFF;
    border-radius: 4px;
}
body.aw-keuzehulp .aw-keuzehulp-why h3 {
    font-family: Roboto, sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #FFFFFF;
}
body.aw-keuzehulp .aw-keuzehulp-why p {
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    color: #FFFFFF;
}

/* CTA-blok (geïnjecteerd door JS) */
body.aw-keuzehulp .aw-keuzehulp-cta {
    max-width: 720px;
    margin: 20px auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
body.aw-keuzehulp .aw-keuzehulp-cta a {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1 1 200px;
    display: inline-block;
}
/* Primary CTA: wit met rode tekst (contrast op rode wrapper) */
body.aw-keuzehulp .aw-keuzehulp-cta .aw-keuzehulp-cta-primary {
    background: #FFFFFF;
    color: #A12329;
}
body.aw-keuzehulp .aw-keuzehulp-cta .aw-keuzehulp-cta-primary:hover {
    background: #212121;
    color: #FFFFFF;
}
/* Secondary CTA: outline-only wit */
body.aw-keuzehulp .aw-keuzehulp-cta .aw-keuzehulp-cta-secondary {
    background: transparent;
    color: #FFFFFF;
    border: 1px solid #FFFFFF;
}
body.aw-keuzehulp .aw-keuzehulp-cta .aw-keuzehulp-cta-secondary:hover {
    background: #FFFFFF;
    color: #A12329;
}

/* Responsive */
@media (max-width: 767px) {
    body.aw-keuzehulp .velo-wrapper {
        padding: 20px 16px 32px;
        border-radius: 8px;
    }
    body.aw-keuzehulp .velo-wrapper h2.velo-title-steps {
        font-size: 20px;
    }
    body.aw-keuzehulp .velo-wrapper .velo-choices-wrapper,
    body.aw-keuzehulp .velo-wrapper .velo-final-items {
        grid-template-columns: 1fr !important;
    }
    body.aw-keuzehulp .aw-keuzehulp-cta a {
        flex: 1 1 100%;
    }
}
