/* ─── Tip Floating Button ─── */
.tip-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    height: 48px;
    padding: 0 20px;
    border-radius: 24px;
    border: none;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a2e;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.tip-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(255, 215, 0, 0.45);
}
@keyframes tipFabPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 4px 28px rgba(255, 215, 0, 0.55); }
}
.tip-fab { animation: tipFabPulse 3s ease-in-out infinite; }

/* ─── Tip Modal Overlay ─── */
.tip-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.tip-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ─── Tip Modal ─── */
.tip-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 400px;
    width: 90vw;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tip-overlay.open .tip-modal {
    transform: translateY(0) scale(1);
}
.tip-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: #5a6380;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}
.tip-close:hover { color: #e0e0e0; }
.tip-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(90deg, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tip-subtitle {
    text-align: center;
    color: #8892b0;
    font-size: 0.85rem;
    margin-bottom: 24px;
}

/* ─── Amount Cards ─── */
.tip-amounts {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.tip-amount-card {
    flex: 1;
    padding: 14px 6px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: center;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    transform: translateY(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.tip-amount-card.visible {
    opacity: 1;
    transform: translateY(0);
}
.tip-amount-card:hover {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.06);
    transform: translateY(-2px);
}
.tip-amount-card.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
    transform: scale(1.03);
}
.tip-amount-card.loading {
    pointer-events: none;
    opacity: 0.5;
}
.tip-amount-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffd700;
}
.tip-amount-label {
    font-size: 0.72rem;
    color: #8892b0;
    margin-top: 4px;
}
.tip-amount-hint {
    font-size: 0.62rem;
    color: #5a6380;
    margin-top: 2px;
}

/* ─── Loading Spinner ─── */
.tip-loading {
    text-align: center;
    padding: 40px 0;
    display: none;
}
.tip-loading.visible { display: block; }
.tip-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 215, 0, 0.15);
    border-top-color: #ffd700;
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: tipSpin 0.8s linear infinite;
}
@keyframes tipSpin {
    to { transform: rotate(360deg); }
}
.tip-loading-text {
    color: #8892b0;
    font-size: 0.88rem;
}

/* ─── QR Code Section ─── */
.tip-qr-section {
    text-align: center;
    padding: 16px 0;
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tip-qr-section.visible {
    display: block;
}
.tip-qr-section.show {
    opacity: 1;
    transform: translateY(0);
}
.tip-qr-hint {
    color: #8892b0;
    font-size: 0.82rem;
    margin-bottom: 14px;
}
.tip-qr-wrapper {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border-radius: 14px;
    line-height: 0;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.08);
}
.tip-qr-wrapper canvas,
.tip-qr-wrapper img {
    display: block !important;
}
.tip-qr-wrapper canvas {
    display: none !important;
}
.tip-qr-amount {
    margin-top: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
}
.tip-qr-polling {
    margin-top: 8px;
    font-size: 0.78rem;
    color: #5a6380;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.tip-qr-polling::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffd700;
    animation: tipDotPulse 1.5s ease-in-out infinite;
}
@keyframes tipDotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ─── Thank You Animation ─── */
.tip-thankyou {
    text-align: center;
    padding: 20px 0;
    display: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.5s, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tip-thankyou.visible { display: block; }
.tip-thankyou.show {
    opacity: 1;
    transform: scale(1);
}
.tip-thankyou-icon {
    font-size: 3rem;
    margin-bottom: 8px;
    animation: tipBounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes tipBounceIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
.tip-thankyou-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, #ffd700, #ff6b6b, #64ffda);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
    animation: tipGradientShift 3s ease infinite;
    background-size: 200% auto;
}
@keyframes tipGradientShift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}
.tip-thankyou-sub {
    color: #8892b0;
    font-size: 0.88rem;
}
#tipConfetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2001;
}

/* ─── Nav Tip Button ─── */
.nav-btn.tip-nav-btn {
    background: rgba(255, 215, 0, 0.08);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.3);
}
.nav-btn.tip-nav-btn:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: #ffd700;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    .tip-modal { padding: 24px 18px; }
    .tip-amounts { gap: 8px; }
    .tip-amount-card { padding: 12px 6px; }
    .tip-amount-value { font-size: 1.3rem; }
    .tip-fab { height: 42px; padding: 0 16px; font-size: 0.85rem; bottom: 20px; right: 20px; }
}
