/**
 * Referans modülü — dairesel hover butonları
 */
.ref-circle-btn {
    --x: 50%;
    --y: 50%;

    position: relative;
    overflow: hidden;
    isolation: isolate;
    height: 52px;
    padding: 0 var(--theme-button-padding-x, 30px);
    border-radius: var(--theme-button-radius, 8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    cursor: pointer;
}

.ref-circle-btn span {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: inherit;
    transition: color 0.35s ease;
}

.ref-circle-btn span i {
    position: relative;
    z-index: 2;
    color: inherit;
    transition: color 0.35s ease;
}

.ref-circle-btn > i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: max(360px, 240%);
    height: max(360px, 240%);
    border-radius: 50%;
    background: #fff;
    z-index: 1;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.45s ease;
    pointer-events: none;
}

.ref-circle-btn--filled:hover > i,
.ref-circle-btn--filled:focus-visible > i,
.ref-case__prototype-btn:hover > i,
.ref-case__prototype-btn:focus-visible > i {
    transform: translate(-50%, -50%) scale(1);
}

.ref-circle-btn--filled:hover span,
.ref-circle-btn--filled:hover span i,
.ref-circle-btn--filled:focus-visible span,
.ref-circle-btn--filled:focus-visible span i {
    color: var(--ref-button-text, #fff) !important;
}

.ref-circle-btn--outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.ref-circle-btn--outline:not(.ref-case__prototype-btn) > i {
    display: none;
}

.ref-circle-btn--outline:hover,
.ref-circle-btn--outline:focus-visible {
    background: var(--ref-button-bg, #3b82f6);
    border-color: var(--ref-button-bg, #3b82f6);
    color: var(--ref-button-text, #fff);
}

.ref-circle-btn--outline:hover span,
.ref-circle-btn--outline:hover span i,
.ref-circle-btn--outline:focus-visible span,
.ref-circle-btn--outline:focus-visible span i {
    color: var(--ref-button-text, #fff);
}

/*
 * Prototip butonu (açık panel): beyaz radial hover fill + on-primary metin
 * çakışınca yazı kayboluyordu. Radial primary renk; metin her durumda kontrastlı.
 */
.ref-case__actions .ref-circle-btn.ref-case__prototype-btn,
.ref-case__prototype-btn.ref-circle-btn--outline {
    color: var(--theme-primary, #2563eb);
    border-color: color-mix(in srgb, var(--theme-primary, #2563eb) 55%, var(--theme-border, #e2e8f0));
    background: color-mix(in srgb, var(--theme-primary, #2563eb) 14%, var(--theme-surface, #fff));
}

.ref-case__actions .ref-circle-btn.ref-case__prototype-btn > i,
.ref-case__prototype-btn.ref-circle-btn--outline > i {
    background: var(--theme-primary, #2563eb);
}

.ref-case__actions .ref-circle-btn.ref-case__prototype-btn span,
.ref-case__actions .ref-circle-btn.ref-case__prototype-btn span i,
.ref-case__prototype-btn.ref-circle-btn--outline span,
.ref-case__prototype-btn.ref-circle-btn--outline span i {
    position: relative;
    z-index: 2;
    color: var(--theme-primary, #2563eb);
}

.ref-case__actions .ref-circle-btn.ref-case__prototype-btn span i,
.ref-case__prototype-btn.ref-circle-btn--outline span i {
    font-size: 1.05em;
    line-height: 1;
    vertical-align: -0.05em;
}

.ref-case__actions .ref-circle-btn.ref-case__prototype-btn:hover,
.ref-case__actions .ref-circle-btn.ref-case__prototype-btn:focus-visible,
.ref-case__prototype-btn.ref-circle-btn--outline:hover,
.ref-case__prototype-btn.ref-circle-btn--outline:focus-visible {
    color: var(--theme-on-primary, #fff);
    border-color: var(--theme-primary, #2563eb);
    background: var(--theme-primary, #2563eb);
}

.ref-case__actions .ref-circle-btn.ref-case__prototype-btn:hover span,
.ref-case__actions .ref-circle-btn.ref-case__prototype-btn:hover span i,
.ref-case__actions .ref-circle-btn.ref-case__prototype-btn:focus-visible span,
.ref-case__actions .ref-circle-btn.ref-case__prototype-btn:focus-visible span i,
.ref-case__prototype-btn.ref-circle-btn--outline:hover span,
.ref-case__prototype-btn.ref-circle-btn--outline:hover span i,
.ref-case__prototype-btn.ref-circle-btn--outline:focus-visible span,
.ref-case__prototype-btn.ref-circle-btn--outline:focus-visible span i {
    color: var(--theme-on-primary, #fff) !important;
}

.ref-case__actions .ref-circle-btn.ref-case__prototype-btn:focus-visible,
.ref-case__prototype-btn.ref-circle-btn--outline:focus-visible {
    outline: var(--ds-focus-ring, 2px solid var(--theme-primary, #2563eb));
    outline-offset: 2px;
}

.ref-circle-btn--filled {
    background: var(--ref-button-bg, #3b82f6);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    border: 0 !important;
    border-color: transparent !important;
    color: var(--ref-button-text, #fff);
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Filled hover — aynı rengin hafif koyusu; ripple beyaz diskini maskele */
.ref-circle-btn--filled:hover,
.ref-circle-btn--filled:focus-visible {
    background: color-mix(in srgb, var(--ref-button-bg, #3b82f6) 85%, #000);
    color: var(--ref-button-text, #fff);
    border: 0 !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.ref-circle-btn--filled::before,
.ref-circle-btn--filled::after {
    box-shadow: none !important;
    filter: none !important;
}

.ref-circle-btn--filled > i {
    width: max(420px, 280%);
    height: max(420px, 280%);
    /* Ripple rengi: buton renginin hafif koyusu → buton + yazı beyazlaşmaz */
    background: color-mix(in srgb, var(--ref-button-bg, #3b82f6) 80%, #000);
    box-shadow: none !important;
    filter: none !important;
    outline: none !important;
    border: 0 !important;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.ref-circle-btn--filled span,
.ref-circle-btn--filled span i {
    color: var(--ref-button-text, #fff);
}

.ref-case__site-btn.ref-circle-btn--filled {
    background: var(--ref-button-bg, #3b82f6);
    color: var(--ref-button-text, #fff);
}

.ref-case__site-btn.ref-circle-btn--filled span,
.ref-case__site-btn.ref-circle-btn--filled span i {
    color: var(--ref-button-text, #fff);
}

.refs-card__actions .ref-circle-btn {
    position: relative;
    z-index: 31;
    pointer-events: auto;
    flex: 1 1 160px;
    max-width: 100%;
}

.refs-card__actions .ref-circle-btn span,
.refs-card__actions .ref-circle-btn > i {
    pointer-events: none;
}

.ref-case__actions {
    position: relative;
    z-index: 10;
    pointer-events: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.85rem;
}

.ref-case__actions .ref-circle-btn {
    position: relative;
    z-index: 11;
    pointer-events: auto;
    flex: 1 1 160px;
    max-width: 100%;
    min-height: var(--ds-control-height-lg, 3.25rem);
}

@media (prefers-reduced-motion: reduce) {
    .ref-circle-btn > i {
        transition: none;
        display: none;
    }

    .ref-circle-btn--filled:hover span,
    .ref-circle-btn--filled:focus-visible span,
    .ref-circle-btn--filled:hover span i,
    .ref-circle-btn--filled:focus-visible span i {
        color: inherit !important;
    }

    .ref-circle-btn--outline {
        transition: none;
    }
}

/* Tablet & Mobil (<= 1020px): Butonlar esnek satır akışında hizalanır */
@media (max-width: 1020px) {
    .refs-card__actions,
    .ref-case__actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--ds-gap-sm, 0.5rem);
    }

    .ref-circle-btn {
        height: var(--ds-control-height, 44px);
        min-height: var(--ds-control-height, 44px);
        min-width: 0;
        padding-inline: var(--ds-control-pad-x, 1rem);
        font-size: 0.8125rem;
        flex: 0 1 auto;
    }

    .ref-circle-btn > i {
        width: max(280px, 200%);
        height: max(280px, 200%);
    }
}

/* Küçük mobil (<= 430px): Butonlar tek sütun, tam genişlik */
@media (max-width: 430px) {
    .refs-card__actions,
    .ref-case__actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--ds-gap-sm, 0.5rem);
    }

    .ref-circle-btn {
        width: 100%;
        flex: 1 1 100%;
    }
}

@media (hover: none) and (pointer: coarse) {
    .ref-circle-btn > i {
        display: none;
    }

    .ref-circle-btn--filled:hover span,
    .ref-circle-btn--filled:hover span i {
        color: inherit !important;
    }
}
