/* ════════════════════════════════════
   jobs.css — Job dock bubbles & job drawer
   ════════════════════════════════════ */

/* ── Job Dock ── */
#jobDock {
    position: fixed;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.6rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid #334155;
    border-radius: 2rem;
    z-index: 1000;
    pointer-events: none;
    min-width: 68px;
}

.dock-bubble {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    flex-shrink: 0;
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
    animation: bubblePop .35s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes bubblePop {
    from {
        transform: scale(0) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.dock-bubble:hover {
    transform: scale(1.18) translateY(-6px);
}

.dock-bubble .bubble-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    position: relative;
}

/* Status ring animations */
.dock-bubble.running::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(#38bdf8 0%, #a855f7 35%, transparent 55%);
    animation: spin 1.1s linear infinite;
    z-index: -1;
}

.dock-bubble.running .bubble-inner {
    border-color: transparent;
}

.dock-bubble.completed .bubble-inner {
    border-color: #22c55e;
    box-shadow: 0 0 14px #22c55e88;
}

.dock-bubble.failed .bubble-inner {
    border-color: #ef4444;
    animation: redpulse 1.4s ease infinite;
}

@keyframes redpulse {

    0%,
    100% {
        box-shadow: 0 0 8px #ef444488;
    }

    50% {
        box-shadow: 0 0 20px #ef4444cc;
    }
}

.dock-bubble.pending .bubble-inner {
    border-color: #ca8a04;
}

.bubble-tooltip {
    position: absolute;
    right: 68px;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: .4rem;
    padding: .3rem .65rem;
    font-size: .72rem;
    white-space: nowrap;
    color: #f8fafc;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}

.dock-bubble:hover .bubble-tooltip {
    opacity: 1;
}

/* ── Job Drawer ── */
#jobDrawer {
    position: fixed;
    right: 90px;
    top: 50%;
    transform: translateY(-50%) translateX(calc(100% + 90px));
    width: min(600px, 88vw);
    background: #141e2e;
    border: 1px solid #334155;
    border-radius: 1rem;
    box-shadow: -8px 0 40px rgba(0, 0, 0, .55);
    z-index: 999;
    transition: transform .35s cubic-bezier(.32, .72, 0, 1);
    padding: 1.4rem 1.6rem 1.2rem;
    max-height: 80vh;
    overflow-y: auto;
}

#jobDrawer.open {
    transform: translateY(-50%) translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .9rem;
}

.drawer-title {
    font-weight: 700;
    font-size: 1rem;
}

.drawer-minimize {
    background: none;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: .4rem;
    padding: .25rem .65rem;
    cursor: pointer;
    font-size: .78rem;
    transition: all .15s;
}

.drawer-minimize:hover {
    background: #334155;
    color: #f8fafc;
}

/* ── Mobile overrides for dock & drawer ── */
@media (max-width: 650px) {
    #jobDock {
        display: none !important;
    }

    .bubble-tooltip {
        right: auto;
        left: 50%;
        top: -40px;
        bottom: auto;
        transform: translateX(-50%);
    }

    #jobDrawer {
        right: 0;
        left: 0;
        bottom: 64px;
        top: auto;
        width: 100%;
        max-width: 100%;
        transform: translateY(110%);
        border-radius: 1.5rem 1.5rem 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
    }

    #jobDrawer.open {
        transform: translateY(0);
    }
}