/* ==========================================================================
   Floating actions: WhatsApp chat pill + back to top
   Self-contained (fallbacks for every theme variable) so it works both on
   layout pages (premium.css loaded) and on the standalone homepage.
   Markup: resources/views/welcome/layouts/floatActions.blade.php
   ========================================================================== */
.tt-float {
    --tt-f-ease: var(--tt-ease, cubic-bezier(.2, .7, .2, 1));
    --tt-f-ink: var(--tt-ink, #121a2b);
    --tt-f-line: var(--tt-line, #e9e5dc);
    --tt-f-gold: var(--tt-gold, #b88a3e);
    position: fixed; right: 24px; bottom: 24px; z-index: 1040;
    display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
    font-family: 'Plus Jakarta Sans', 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    transition: bottom .3s var(--tt-f-ease);
    pointer-events: none; /* only the buttons themselves catch clicks */
}
.tt-float > * { pointer-events: auto; }
.tt-float-row { display: flex; align-items: center; gap: 12px; }
.tt-float svg { display: block; }

/* WhatsApp pill */
.tt-wa {
    --wa: #25d366; --wa-dark: #128c7e;
    position: relative; display: inline-flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 22px 0 6px; border-radius: 999px;
    background: linear-gradient(135deg, #2bd96f 0%, var(--wa) 45%, #1ebe5b 100%);
    color: #fff !important; text-decoration: none !important;
    box-shadow: 0 14px 30px -10px rgba(18, 140, 126, .65), 0 2px 6px rgba(0, 0, 0, .08);
    transition: transform .35s var(--tt-f-ease), box-shadow .35s var(--tt-f-ease);
    animation: tt-wa-in .7s var(--tt-f-ease) .4s both;
    isolation: isolate;
}
.tt-wa::before { /* soft pulsing halo */
    content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    background: var(--wa); animation: tt-wa-pulse 2.6s ease-out infinite;
}
.tt-wa::after { /* glossy sweep every few seconds */
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 48%, transparent 66%);
    background-size: 250% 100%; background-position: 130% 0;
    animation: tt-wa-shine 5s ease-in-out 2s infinite;
}
.tt-wa:hover { transform: translateY(-3px); box-shadow: 0 20px 36px -12px rgba(18, 140, 126, .75), 0 2px 6px rgba(0, 0, 0, .08); }
.tt-wa:focus-visible { outline: 3px solid rgba(37, 211, 102, .45); outline-offset: 3px; }
.tt-wa-icon {
    position: relative; flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
    background: #fff; color: var(--wa-dark);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(18, 140, 126, .08);
}
.tt-wa-icon svg { width: 27px; height: 27px; fill: currentColor; }
.tt-wa:hover .tt-wa-icon svg { animation: tt-wa-wiggle .6s ease; }
.tt-wa-dot { /* "online" indicator */
    position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%;
    background: #ffd84d; border: 2px solid #fff;
}
.tt-wa-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; color: #fff !important; text-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.tt-wa-text small { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .88) !important; letter-spacing: .02em; }
.tt-wa-text b { font-size: 15px; font-weight: 800; color: #fff !important; letter-spacing: .01em; }

/* Greeting bubble above the pill */
.tt-wa-bubble {
    position: relative; max-width: 260px; padding: 14px 38px 14px 16px; border-radius: 16px 16px 4px 16px;
    background: #fff; color: var(--tt-text, #3a4152); font-size: 13.5px; line-height: 1.5;
    box-shadow: var(--tt-shadow-lg, 0 24px 48px -16px rgba(18, 26, 43, .25)); border: 1px solid var(--tt-f-line);
    animation: tt-bubble-in .45s var(--tt-f-ease) both;
}
.tt-wa-bubble[hidden] { display: none; }
.tt-wa-bubble b { display: block; color: var(--tt-f-ink); font-size: 14px; margin-bottom: 2px; }
.tt-wa-bubble-close {
    position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%;
    border: 0; background: #f3f1ec; color: var(--tt-muted, #6b7280);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.tt-wa-bubble-close svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.tt-wa-bubble-close:hover { background: var(--tt-f-ink); color: #fff; }

/* Back to top with scroll-progress ring */
.tt-totop {
    position: relative; width: 50px; height: 50px; border-radius: 50%; padding: 0;
    border: 0; background: #fff; color: var(--tt-f-ink); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: var(--tt-shadow, 0 10px 24px -12px rgba(18, 26, 43, .3));
    opacity: 0; visibility: hidden; transform: translateY(14px) scale(.85);
    transition: opacity .3s var(--tt-f-ease), transform .3s var(--tt-f-ease), visibility 0s linear .3s, background .25s, color .25s;
}
.tt-totop.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.tt-totop:hover { background: var(--tt-f-ink); color: #fff; transform: translateY(-3px); }
.tt-totop:focus-visible { outline: 3px solid var(--tt-gold-2, #d4ad62); outline-offset: 2px; }
.tt-totop-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tt-totop circle { fill: none; stroke-width: 3; }
.tt-totop-track { stroke: var(--tt-f-line); }
.tt-totop-bar { stroke: var(--tt-f-gold); stroke-linecap: round; stroke-dasharray: 138.2; stroke-dashoffset: 138.2; transition: stroke-dashoffset .1s linear; }
.tt-totop:hover .tt-totop-track { stroke: rgba(255, 255, 255, .2); }
.tt-totop-arrow { position: relative; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--tt-f-ease); }
.tt-totop:hover .tt-totop-arrow { transform: translateY(-2px); }

@keyframes tt-wa-in { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes tt-wa-pulse {
    0% { transform: scale(1); opacity: .55; }
    70%, 100% { transform: scale(1.25, 1.5); opacity: 0; }
}
@keyframes tt-wa-shine { 0%, 70% { background-position: 130% 0; } 100% { background-position: -30% 0; } }
@keyframes tt-wa-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); } }
@keyframes tt-bubble-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* Phones: smaller pill, keep the label short */
@media (max-width: 575.98px) {
    .tt-float { right: 14px; bottom: 14px; gap: 10px; }
    .tt-float-row { gap: 10px; }
    .tt-wa { height: 52px; padding: 0 16px 0 5px; gap: 9px; }
    .tt-wa-icon { width: 42px; height: 42px; }
    .tt-wa-icon svg { width: 23px; height: 23px; }
    .tt-wa-text small { display: none; }
    .tt-wa-text b { font-size: 14px; }
    .tt-totop { width: 44px; height: 44px; }
    .tt-totop-arrow { width: 16px; height: 16px; }
    .tt-wa-bubble { max-width: 230px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
    .tt-wa, .tt-wa::before, .tt-wa::after, .tt-wa-bubble { animation: none !important; }
}
@media print { .tt-float { display: none !important; } }
