/* Tribut — Custom styles */

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Amount Display Effects ===== */

@keyframes amountBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

#amount-display.bounce {
    animation: amountBounce 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Preset Button Effects ===== */

.preset-btn:hover {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.04);
}

.preset-active {
    box-shadow: 0 0 24px var(--accent-glow);
}

/* ===== Focus Visible ===== */

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== Scrollbar ===== */

textarea::-webkit-scrollbar {
    width: 4px;
}
textarea::-webkit-scrollbar-track {
    background: transparent;
}
textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* ===== Number Input ===== */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ===== Loading Spinner Pulse Ring ===== */

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 var(--accent-glow); }
    70% { box-shadow: 0 0 0 20px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

[data-step="3"]:not(.hidden) .inline-flex {
    animation: pulseRing 2s ease-out infinite;
}

/* ===== Success Page Animations ===== */

/* Checkmark container */
.success-check-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    opacity: 0;
    animation: successScaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 0.1s;
}

/* Pulsing glow ring behind checkmark */
.success-glow-ring {
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow, rgba(168,85,247,0.35)) 0%, transparent 70%);
    animation: successGlow 2.5s ease-in-out infinite;
    animation-delay: 1s;
    opacity: 0;
}

/* Expanding ring burst on completion */
.success-ring-burst {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--accent, #a855f7);
    opacity: 0;
    animation: ringBurst 0.8s ease-out 0.9s forwards;
}

/* SVG circle draws itself — circumference of r=44 is ~276.5 */
.success-circle {
    stroke-dasharray: 276.5;
    stroke-dashoffset: 276.5;
    animation: successCircleDraw 0.7s ease-out 0.25s forwards;
}

/* SVG checkmark draws itself — path length ~55 */
.success-check {
    stroke-dasharray: 55;
    stroke-dashoffset: 55;
    animation: checkDraw 0.45s ease-out 0.85s forwards;
}

/* Amount reveal with scale spring */
.success-amount {
    position: relative;
    opacity: 0;
    transform: scale(0.5) translateY(8px);
    animation: amountReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    margin-bottom: 2rem;
    overflow: hidden;
}

.success-amount-value {
    font-size: 3.5rem;
    line-height: 1.1;
    display: inline-block;
}

/* Shimmer sweep over the amount */
.success-amount-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,0.15) 45%,
        rgba(255,255,255,0.25) 50%,
        rgba(255,255,255,0.15) 55%,
        transparent 70%
    );
    animation: shimmerSweep 1.2s ease-in-out 1.3s forwards;
    transform: translateX(-100%);
    pointer-events: none;
}

/* Generic staggered fade-in */
.success-fade-in {
    opacity: 0;
    transform: translateY(16px);
    animation: successFadeIn 0.6s ease-out forwards;
}

/* === Keyframes === */

@keyframes checkDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes successCircleDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes successScaleIn {
    0% { opacity: 0; transform: scale(0.3); }
    60% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes successGlow {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes ringBurst {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.8); }
}

@keyframes amountReveal {
    0% { opacity: 0; transform: scale(0.5) translateY(8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes successFadeIn {
    0% { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes shimmerSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== Select Option Styling (dark bg) ===== */

select option {
    background-color: #1e1e38;
    color: white;
}

/* ===== Verified Badge ===== */

/* Plattform-Siegel unten rechts am Avatar. Farben sind plattform-fix
   (Sky→Indigo im SVG-Gradient), bewusst nicht var(--accent). */
.verified-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    z-index: 10;
    width: 34px;
    height: 34px;
    display: block;
    cursor: default;
    border-radius: 50%;
    border: 2px solid var(--bg-deep);
    background: var(--bg-deep);
    box-shadow:
        0 0 12px rgba(56, 189, 248, 0.35),
        0 0 24px rgba(99, 102, 241, 0.25);
    /* Pop-in im Reveal-Rhythmus (nach Name/Handle, vor Socials);
       backwards hält das Badge vor Animationsstart unsichtbar. */
    animation: verifiedPop 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards;
}

.verified-badge svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes verifiedPop {
    0% { opacity: 0; transform: scale(0); }
    60% { opacity: 1; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

/* Glass-Tooltip über dem Badge — Rezept nach .glass-card (theme.css) */
.verified-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 255, 255, 0.04) 100%
    );
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 -1px 0 rgba(255, 255, 255, 0.02);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;
    transition:
        opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.2s;
}

.verified-badge:hover .verified-tooltip,
.verified-badge:focus-visible .verified-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .verified-badge {
        animation: none;
    }
    .verified-tooltip {
        transform: translateX(-50%);
        transition: opacity 0.2s ease;
    }
    .verified-badge:hover .verified-tooltip,
    .verified-badge:focus-visible .verified-tooltip {
        transform: translateX(-50%);
    }
}
