/* ============================================
   ACTIVE TRANSPORT WIDGET
   ============================================
   Floating button that appears when there's an active transport
   ============================================ */

.active-transport-widget {
    position: fixed;
    bottom: 100px; /* Above bottom nav on mobile */
    right: 20px;
    z-index: 9999;
    transition: all 0.3s ease;
}

.active-transport-widget.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translateY(20px);
}

/* Main button - larger for easy tap */
.active-transport-widget .widget-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark, #27ae60) 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.active-transport-widget .widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
}

.active-transport-widget .widget-button:active {
    transform: scale(0.95);
}

/* Icon - larger for visibility */
.active-transport-widget .widget-icon {
    font-size: 1.75rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white; /* For SVG icons */
}

.active-transport-widget .widget-icon svg {
    fill: white;
    width: 28px;
    height: 28px;
}

/* Pulse animation */
.active-transport-widget .widget-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: var(--color-success);
    animation: widget-pulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes widget-pulse {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

/* Tooltip */
.active-transport-widget .widget-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Hide tooltip if empty */
.active-transport-widget .widget-tooltip:empty,
.active-transport-widget .widget-tooltip:not(:has(.tooltip-text)) {
    display: none !important;
}

.active-transport-widget .widget-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(0, 0, 0, 0.85);
}

.active-transport-widget:hover .widget-tooltip {
    opacity: 1;
    right: 65px;
}

/* Mobile adjustments - keep FAB large and easy to tap */
@media (max-width: 767px) {
    .active-transport-widget {
        bottom: 85px; /* Above mobile bottom nav */
        right: 16px;
    }

    .active-transport-widget .widget-button {
        width: 60px;
        height: 60px;
    }

    .active-transport-widget .widget-icon {
        font-size: 1.6rem;
    }

    /* Completely hide tooltip on mobile - including the arrow pseudo-element */
    .active-transport-widget .widget-tooltip {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .active-transport-widget .widget-tooltip::after {
        display: none !important;
        content: none !important;
    }

    /* Prevent hover effects from showing tooltip on touch */
    .active-transport-widget:hover .widget-tooltip {
        display: none !important;
        opacity: 0 !important;
    }
}

/* Prevent tooltip on touch devices regardless of screen size */
@media (hover: none) and (pointer: coarse) {
    .active-transport-widget .widget-tooltip {
        display: none !important;
    }
}

/* Very small screens - still maintain touch target minimum */
@media (max-width: 380px) {
    .active-transport-widget {
        bottom: 80px;
        right: 12px;
    }

    .active-transport-widget .widget-button {
        width: 56px;
        height: 56px;
    }

    .active-transport-widget .widget-icon {
        font-size: 1.4rem;
    }
}
