/* Workout Exercise Reordering Styles */

/* Exercise item styling */
.workout-exercise-item {
    position: relative;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: move;
}

.workout-exercise-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.workout-exercise-item.dragging {
    opacity: 0.5;
    background: #e2e8f0;
}

/* Exercise header with reorder controls */
.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.exercise-order-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exercise-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #4a90e2;
    color: white;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.9rem;
}

.order-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-order {
    background: #e2e8f0;
    border: none;
    padding: 0;
    width: 24px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-order:hover:not(:disabled) {
    background: #cbd5e0;
}

.btn-order:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-order i {
    font-size: 0.7rem;
    color: #4b5563;
}

/* Drag handle */
.drag-handle {
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem;
    cursor: grab;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: #4b5563;
}

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

/* Exercise name */
.exercise-header h4 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
    color: #1e293b;
}

/* Remove button */
.btn-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #fee2e2;
}

/* Exercise details */
.exercise-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.exercise-details .detail {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Drag indicators */
.drag-over-top {
    border-top: 3px solid #4a90e2;
}

.drag-over-bottom {
    border-bottom: 3px solid #4a90e2;
}

/* Drag clone for mobile */
.drag-clone {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: rotate(-2deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .workout-exercise-item {
        padding: 0.75rem;
        padding-left: 2rem; /* Space for drag handle */
    }
    
    .exercise-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .exercise-order-controls {
        order: -1;
        width: 100%;
        justify-content: space-between;
        margin-bottom: 0.5rem;
    }
    
    .exercise-header h4 {
        order: 0;
        width: 100%;
        font-size: 1rem;
    }
    
    .btn-remove {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .exercise-details {
        font-size: 0.85rem;
        gap: 0.75rem;
    }
    
    .drag-handle {
        left: 0;
        padding: 0.5rem 0.75rem;
    }
}

/* Desktop specific */
@media (min-width: 769px) {
    .workout-exercise-item {
        padding-left: 2.5rem; /* More space for drag handle on desktop */
    }
    
    .drag-handle {
        font-size: 1.2rem;
    }
}

/* Animation for reordering */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.workout-exercise-item {
    animation: slideIn 0.3s ease-out;
}

/* Ensure proper spacing in workout panel */
#workoutExercises {
    min-height: 100px;
    position: relative;
}

#workoutExercises .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

#workoutExercises .empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}