/* CSS Styles for Active Plan Minimization (Dock) */

/* The parent modal wrapper when the inner plan modal is minimized */
.plan-modal.plan-modal--minimized {
    position: fixed !important;
    top: auto !important;
    bottom: calc(var(--nav-height, 64px) + 16px) !important;
    left: 16px !important;
    right: 16px !important;
    width: calc(100% - 32px) !important;
    height: 58px !important;
    max-height: 58px !important;
    min-height: 58px !important;
    border-radius: 29px !important;
    background: var(--bg-secondary, #1e1e1e) !important;
    border: 2px solid var(--current-plan-color, var(--primary, #3b82f6)) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
    z-index: 1010 !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hover effect on minimized dock */
.plan-modal.plan-modal--minimized:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55), 0 0 10px rgba(var(--primary-rgb, 59, 130, 246), 0.15) !important;
}

/* Soft click scale effect */
.plan-modal.plan-modal--minimized:active {
    transform: translateY(0) scale(0.98);
}

/* Hide modal-overlay when minimized to enable interaction with agenda/background */
.plan-modal.plan-modal--minimized ~ .modal-overlay,
.modal-overlay:has(~ .plan-modal.plan-modal--minimized) {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Hide all heavy elements of the plan modal in minimized mode */
.plan-modal--minimized .plan-tabs,
.plan-modal--minimized .plan-content,
.plan-modal--minimized .plan-modal-header {
    display: none !important;
}

/* Styles for the Minimize Bar container */
.plan-modal-minimize-bar {
    display: none;
    height: 100%;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    user-select: none;
}

/* Display the bar only when minimized */
.plan-modal--minimized .plan-modal-minimize-bar {
    display: flex !important;
}

/* Info container (pulse indicator + client name) */
.minimize-bar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #f8fafc);
    min-width: 0;
    flex: 1;
}

.minimize-bar-client {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.minimize-bar-status-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success, #4ade80);
    box-shadow: 0 0 8px var(--success, #4ade80);
    animation: dockGlowPulse 2s infinite ease-in-out;
    flex-shrink: 0;
}

/* Right side action actions */
.minimize-bar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary, #cbd5e1);
    font-size: 0.8125rem;
    font-weight: 500;
}

.minimize-bar-expand-icon {
    font-size: 0.95rem;
    color: var(--current-plan-color, var(--primary, #3b82f6));
    animation: dockIconBounce 2s infinite ease-in-out;
}

@keyframes dockGlowPulse {
    0% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 4px var(--success, #4ade80); }
    50% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 12px var(--success, #4ade80); }
    100% { transform: scale(0.9); opacity: 0.6; box-shadow: 0 0 4px var(--success, #4ade80); }
}

@keyframes dockIconBounce {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

/* Drag handle for swipe-down to minimize */
.plan-modal-drag-handle {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 14px;
    width: 100%;
    cursor: grab;
    background: transparent;
    user-select: none;
    touch-action: none; /* Block default browser scroll/drag gestures on the handle */
    z-index: 102;
    flex-shrink: 0;
}

.plan-modal-drag-handle .drag-handle-bar {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.plan-modal-drag-handle:active {
    cursor: grabbing;
}

.plan-modal-drag-handle:hover .drag-handle-bar,
.plan-modal-drag-handle:active .drag-handle-bar {
    background: rgba(255, 255, 255, 0.45);
    transform: scaleX(1.1);
}

/* Hide drag handle when minimized */
.plan-modal--minimized .plan-modal-drag-handle {
    display: none !important;
}

/* Hide Exercises FAB container in minimized mode */
.plan-modal.plan-modal--minimized .exercises-fab-container,
.plan-modal--minimized .exercises-fab-container {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
