/* =========================================================
   Modern Floating Utility Dock (Dark Mode + Scroll to Top)
   ========================================================= */
.dt-floating-dock {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 1038;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

body.dark-mode .dt-floating-dock {
    background: rgba(24, 27, 35, 0.88);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
}

.dt-dock-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: rgba(15, 23, 42, 0.05);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0;
    transition: transform 0.18s ease, background-color 0.2s ease, color 0.2s ease;
}

.dt-dock-btn:hover {
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    transform: translateY(-1px);
}

.dt-dock-btn:active {
    transform: scale(0.92);
}

body.dark-mode .dt-dock-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

body.dark-mode .dt-dock-btn:hover {
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

#floatingDarkModeBtn .dt-theme-icon {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

body.dark-mode #floatingDarkModeBtn {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.14);
}

body.dark-mode #floatingDarkModeBtn:hover {
    background: rgba(251, 191, 36, 0.24);
    color: #fde68a;
}

#btn-back-to-top {
    position: static;
    width: 42px;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    margin-top: -6px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
    transition: height 0.22s ease, opacity 0.2s ease, margin-top 0.22s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

body.dark-mode #btn-back-to-top {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.42);
}

#btn-back-to-top.show {
    height: 42px;
    opacity: 1;
    margin-top: 0;
    pointer-events: auto;
}

#btn-back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.44);
}

#btn-back-to-top:active {
    transform: scale(0.92);
}

@media (max-width: 991.98px) {
    .dt-floating-dock {
        right: 12px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        padding: 5px;
        gap: 5px;
    }

    body:has(.ios-mobile-tabbar) .dt-floating-dock {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    .dt-dock-btn,
    #btn-back-to-top.show {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }

    #btn-back-to-top {
        width: 38px;
        margin-top: -5px;
        font-size: 1.05rem;
    }
}
