/* =========================================================
   VoerVinder – Widget & match-badge styles
   Loaded sitewide (small file — no quiz-specific rules here)
   ========================================================= */

/* Design tokens — duplicated here so this file works standalone
   on pages that don't also load voervinder-quiz.css             */
:root {
    --vv-green:       #003127;
    --vv-green-mid:   #004E3D;
    --vv-gold:        #CEAA5D;
    --vv-gold-light:  #F9EFD7;
    --vv-cream:       #FFF9EB;
    --vv-white:       #ffffff;
    --vv-text:        #616161;
    --vv-text-muted:  #666;
    --vv-border:      #616161;
    --vv-radius:      8px;
}

/* ---- Match badge — used via [voervinder_match] shortcode ------ */
.vv-match-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #C8E6C9;
    color: #1B5E20;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    white-space: nowrap;
    line-height: 1.4;
    border-radius: 6px;
    border-bottom: 2px solid var(--Green-200, #A5D6A7);
    background: var(--color-feedback-succes-container, #C8E6C9);
}

.vv-match-badge + .vv-match-badge {
    margin-left: 4px;
}

/* ================================================================
   Animals Widget — floating paw button + slide-out panel
   ================================================================ */

#vv-animals-widget {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: inherit;
}

/* Hide trigger until there are saved animals */
#vv-animals-widget:not(.has-animals) #vv-widget-trigger {
    display: none;
}

/* ---- Trigger button ------------------------------------------ */
#vv-widget-trigger {
    width: 52px;
    height: 52px;
    border-radius: 12px 0 0 12px;
    background: var(--vv-green);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 14px;
    overflow: hidden;
    transition: background .2s, width .3s cubic-bezier(.4,0,.2,1), gap .3s;
    position: relative;
}

#vv-widget-trigger:hover,
#vv-widget-trigger.is-active {
    background: var(--vv-gold);
}

/* Expand width on hover when there is a label */
#vv-animals-widget.has-label #vv-widget-trigger:hover {
    width: 200px;
    gap: 8px;
}

.vv-widget-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: var(--vv-gold);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    pointer-events: none;
    /* Badge is now a sibling of the trigger, positioned relative to
       #vv-animals-widget (position:fixed). top/left -4px places it
       at the top-left corner of the trigger button. */
}

/* ---- Panel --------------------------------------------------- */
.vv-widget-panel {
    position: absolute;
    top: 50%;
    right: 60px;
    transform: translateY(-50%) scale(.92);
    transform-origin: center right;
    width: 280px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}

.vv-widget-panel.is-open {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

/* ---- Panel header -------------------------------------------- */
.vv-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--vv-green);
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    font-size: 14px;
}

.vv-widget-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color .15s;
}

.vv-widget-close:hover {
    color: #fff;
}

/* ---- Animal list --------------------------------------------- */
.vv-widget-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 240px;
    overflow-y: auto;
}

.vv-widget-animal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--vv-text);
    border-bottom: 1px solid var(--vv-border);
}

.vv-widget-animal:last-child {
    border-bottom: none;
}

.vv-widget-animal > .fas.fa-paw {
    color: var(--vv-gold);
    font-size: 13px;
    flex-shrink: 0;
}

.vv-widget-animal-name {
    flex: 1;
    font-weight: 600;
}

.vv-widget-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 13px;
    display: flex;
    align-items: center;
    padding: 0;
    transition: color .15s;
    flex-shrink: 0;
}

.vv-widget-remove:hover {
    color: #c0392b;
}

.vv-widget-empty {
    padding: 16px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

/* ---- Footer -------------------------------------------------- */
.vv-widget-footer {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--vv-border);
}

.vv-widget-btn {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background .2s, opacity .2s;
}

.vv-widget-btn--save {
    background: var(--vv-green);
    color: #fff;
}

.vv-widget-btn--save:hover {
    background: var(--vv-green-mid, #004E3D);
}

.vv-widget-btn--save:disabled {
    opacity: .7;
    cursor: default;
}

.vv-widget-login-hint {
    font-size: 12px;
    color: #888;
    margin: 0;
    text-align: center;
    line-height: 1.4;
}

/* ---- Trigger label "Voer voor {naam}" — hidden, slides in on hover -- */
.vv-trigger-label {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
    order: -1; /* sits left of the paw icon */
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width .3s cubic-bezier(.4,0,.2,1), opacity .2s .05s;
}

#vv-animals-widget.has-label #vv-widget-trigger:hover .vv-trigger-label {
    max-width: 160px;
    opacity: 1;
}

/* ---- "Beheer in mijn account" footer link ------------------- */
.vv-widget-account-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--vv-text-muted, #666);
    text-decoration: none;
    padding-top: 8px;
    margin-top: 4px;
    transition: color .15s;
}

.vv-widget-account-link:hover {
    color: var(--vv-green, #003127);
}
