/* =========================================
   FLOATING ACTIONS — Sağ Sabit Hızlı Erişim
   Sıra (üstten alta): WhatsApp · Telefon · Instagram · Yukarı Çık
   ========================================= */

.floating-actions {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.floating-actions > * {
    pointer-events: auto;
}

/* === Ortak Buton (FAB) === */
.fab {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    border: none;
    cursor: pointer;
}

.fab:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    filter: brightness(1.05);
}

.fab:active {
    transform: scale(0.96);
}

/* === Tooltip (data-tooltip ile) === */
.fab[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: #1a0b3d;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    pointer-events: none;
    letter-spacing: 0.1px;
}

.fab[data-tooltip]::after {
    content: '';
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #1a0b3d;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    pointer-events: none;
}

.fab:hover::before,
.fab:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* === Etiketli FAB (WhatsApp — "Canlı Destek" yazısı solda, ikon sağda) === */
.fab--labeled {
    width: auto;
    height: 52px;
    border-radius: 999px;
    padding: 0 7px 0 18px;
    gap: 11px;
}
.fab__text {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1px;
    white-space: nowrap;
    color: #fff;
}
.fab__ic {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff; /* beyaz çember */
}
/* WhatsApp logosu beyaz çember üstünde yeşil görünsün */
.fab--labeled .fab__ic svg {
    color: #25d366;
    fill: #25d366;
    fill-rule: evenodd; /* telefon ahizesi oyularak belirsin */
}
.fab--labeled .fab__pulse {
    background: rgba(255, 255, 255, 0.55);
}

/* === "Canlı Destek" dikkat çekme hareketi === */
@media (prefers-reduced-motion: no-preference) {
    /* Beyaz çember + ikon zil gibi sallanır */
    .fab--labeled .fab__ic {
        animation: fabRing 2.8s ease-in-out infinite;
        transform-origin: center;
    }
    /* Etiket metni hafifçe nefes alır */
    .fab--labeled .fab__text {
        animation: fabTextPop 2.8s ease-in-out infinite;
    }
}

@keyframes fabRing {
    0%, 55%, 100% { transform: rotate(0) scale(1); }
    60% { transform: rotate(-14deg) scale(1.08); }
    65% { transform: rotate(12deg) scale(1.08); }
    70% { transform: rotate(-10deg) scale(1.05); }
    75% { transform: rotate(9deg) scale(1.05); }
    80% { transform: rotate(-6deg) scale(1.03); }
    85% { transform: rotate(5deg) scale(1.02); }
    90% { transform: rotate(-2deg) scale(1); }
}

@keyframes fabTextPop {
    0%, 55%, 100% { transform: translateX(0); }
    62% { transform: translateX(-2px); }
    78% { transform: translateX(1px); }
}

/* === Renk Varyantları === */
.fab--whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

.fab--phone {
    background: linear-gradient(135deg, var(--color-green) 0%, var(--color-green-dark) 100%);
}

.fab--instagram {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.fab--top {
    background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s, transform 0.3s ease, background 0.25s ease, filter 0.25s ease;
}

.fab--top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* === WhatsApp Pulse Animasyonu (dikkat çekmek için) === */
.fab__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #25d366;
    opacity: 0.5;
    z-index: -1;
    animation: fabPulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes fabPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* === Mobil === */
@media (max-width: 768px) {
    .floating-actions {
        right: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0));
        gap: 10px;
    }
    .fab {
        width: 48px;
        height: 48px;
    }
    .fab svg {
        width: 20px;
        height: 20px;
    }
    /* Etiketli WhatsApp butonu mobilde de pill kalsın */
    .fab--labeled {
        width: auto;
        height: 48px;
        padding: 0 6px 0 16px;
        gap: 9px;
    }
    .fab--labeled .fab__text {
        font-size: 13px;
    }
    .fab--labeled .fab__ic {
        width: 36px;
        height: 36px;
    }
    .fab--labeled .fab__ic svg {
        width: 19px;
        height: 19px;
    }
    /* Mobilde tooltip'leri gizle (touch'ta gereksiz) */
    .fab[data-tooltip]::before,
    .fab[data-tooltip]::after {
        display: none;
    }
}

/* === Safe area (iPhone home indicator) === */
@supports (padding: max(0px)) {
    .floating-actions {
        bottom: max(24px, env(safe-area-inset-bottom, 24px));
    }
}
