/**
 * DoctorBookly — compact floating actions (SOS + back-to-top)
 */

.dbk-fab {
    position: fixed;
    z-index: 9999;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: transparent;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dbk-fab:focus-visible {
    outline: 3px solid rgba(13, 148, 136, 0.45);
    outline-offset: 3px;
}

.dbk-fab__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
}

/* —— SOS —— */
.dbk-fab--sos {
    right: 16px;
    bottom: 16px;
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dbk-fab--sos.is-visible {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dbk-fab--sos .dbk-fab__inner {
    min-height: 44px;
    padding: 0 14px 0 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    font-family: Poppins, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.38);
    animation: dbk-fab-sos-pulse 2.4s ease-in-out infinite;
}

.dbk-fab--sos .dbk-fab__inner i {
    font-size: 15px;
    line-height: 1;
}

.dbk-fab--sos:hover .dbk-fab__inner,
.dbk-fab--sos:focus-visible .dbk-fab__inner {
    transform: scale(1.04);
}

@keyframes dbk-fab-sos-pulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(220, 38, 38, 0.38); }
    50% { box-shadow: 0 6px 20px rgba(220, 38, 38, 0.52); }
}

/* —— Back to top —— */
.dbk-fab--top {
    left: 16px;
    bottom: 16px;
    display: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dbk-fab--top.is-visible {
    display: block;
    opacity: 0.88;
    visibility: visible;
    pointer-events: auto;
}

.dbk-fab--top .dbk-fab__inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

.dbk-fab--top .dbk-fab__inner i {
    font-size: 14px;
    line-height: 1;
}

.dbk-fab--top:hover .dbk-fab__inner,
.dbk-fab--top:focus-visible .dbk-fab__inner {
    opacity: 1;
    transform: translateY(-2px);
}

/* Emergency menu offset for compact SOS */
@media (max-width: 768px) {
    #emergencyMenu {
        bottom: 72px !important;
    }

    .dbk-fab--sos {
        right: 12px;
        bottom: 12px;
    }

    .dbk-fab--top {
        left: 12px;
        bottom: 12px;
    }

    .dbk-fab--sos .dbk-fab__inner {
        min-height: 42px;
        padding: 0 12px 0 10px;
        font-size: 11px;
    }

    .dbk-fab--sos .dbk-fab__inner i {
        font-size: 14px;
    }

    .dbk-fab--top .dbk-fab__inner {
        width: 38px;
        height: 38px;
    }

    .dbk-fab--top .dbk-fab__inner i {
        font-size: 13px;
    }
}

@media (min-width: 769px) {
    .dbk-fab--sos {
        right: 24px;
        bottom: 24px;
    }

    .dbk-fab--top {
        left: 24px;
        bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dbk-fab--sos .dbk-fab__inner {
        animation: none;
    }

    .dbk-fab,
    .dbk-fab__inner {
        transition: none;
    }
}
